mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +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/ui/views/patcher/patcher_viewmodel.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
import 'package:wakelock/wakelock.dart';
|
||||
|
||||
class InstallerViewModel extends BaseViewModel {
|
||||
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
||||
@ -46,6 +47,7 @@ class InstallerViewModel extends BaseViewModel {
|
||||
),
|
||||
);
|
||||
await FlutterBackground.enableBackgroundExecution();
|
||||
await Wakelock.enable();
|
||||
} on Exception {
|
||||
// ignore
|
||||
}
|
||||
@ -119,9 +121,8 @@ class InstallerViewModel extends BaseViewModel {
|
||||
update(1.0, 'Aborting...', 'No app or patches selected! Aborting');
|
||||
}
|
||||
try {
|
||||
if (FlutterBackground.isBackgroundExecutionEnabled) {
|
||||
await FlutterBackground.disableBackgroundExecution();
|
||||
}
|
||||
await FlutterBackground.disableBackgroundExecution();
|
||||
await Wakelock.disable();
|
||||
} on Exception {
|
||||
// ignore
|
||||
}
|
||||
|
@ -52,6 +52,7 @@ dependencies:
|
||||
stacked_themes: ^0.3.9
|
||||
timeago: ^3.2.2
|
||||
url_launcher: ^6.1.5
|
||||
wakelock: ^0.6.2
|
||||
|
||||
dev_dependencies:
|
||||
build_runner: any
|
||||
|
Loading…
Reference in New Issue
Block a user