mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-05-02 14:54:25 +02:00
feat: Keep screen awake during patching
This commit is contained in:
parent
04bcb1ec24
commit
92a84c3bfb
@ -10,6 +10,7 @@ import 'package:revanced_manager/services/manager_api.dart';
|
|||||||
import 'package:revanced_manager/services/patcher_api.dart';
|
import 'package:revanced_manager/services/patcher_api.dart';
|
||||||
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
|
import 'package:wakelock/wakelock.dart';
|
||||||
|
|
||||||
class InstallerViewModel extends BaseViewModel {
|
class InstallerViewModel extends BaseViewModel {
|
||||||
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
||||||
@ -46,6 +47,7 @@ class InstallerViewModel extends BaseViewModel {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
await FlutterBackground.enableBackgroundExecution();
|
await FlutterBackground.enableBackgroundExecution();
|
||||||
|
await Wakelock.enable();
|
||||||
} on Exception {
|
} on Exception {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
@ -119,9 +121,8 @@ class InstallerViewModel extends BaseViewModel {
|
|||||||
update(1.0, 'Aborting...', 'No app or patches selected! Aborting');
|
update(1.0, 'Aborting...', 'No app or patches selected! Aborting');
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (FlutterBackground.isBackgroundExecutionEnabled) {
|
await FlutterBackground.disableBackgroundExecution();
|
||||||
await FlutterBackground.disableBackgroundExecution();
|
await Wakelock.disable();
|
||||||
}
|
|
||||||
} on Exception {
|
} on Exception {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,7 @@ dependencies:
|
|||||||
stacked_themes: ^0.3.9
|
stacked_themes: ^0.3.9
|
||||||
timeago: ^3.2.2
|
timeago: ^3.2.2
|
||||||
url_launcher: ^6.1.5
|
url_launcher: ^6.1.5
|
||||||
|
wakelock: ^0.6.2
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
build_runner: any
|
build_runner: any
|
||||||
|
Loading…
x
Reference in New Issue
Block a user