mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
ask user to disable battery optimizations when turning on background backup (#554)
* ask user to disable battery optimizations when turning on background backup * remove obsolete texts/translations * add button link to dontkillmyapp
This commit is contained in:
committed by
GitHub
parent
5172242f88
commit
75d2d82d05
@@ -117,6 +117,7 @@ class BackupNotifier extends StateNotifier<BackUpState> {
|
||||
bool? requireWifi,
|
||||
bool? requireCharging,
|
||||
required void Function(String msg) onError,
|
||||
required void Function() onBatteryInfo,
|
||||
}) async {
|
||||
assert(enabled != null || requireWifi != null || requireCharging != null);
|
||||
if (Platform.isAndroid) {
|
||||
@@ -131,7 +132,9 @@ class BackupNotifier extends StateNotifier<BackUpState> {
|
||||
|
||||
if (state.backgroundBackup) {
|
||||
if (!wasEnabled) {
|
||||
await _backgroundService.disableBatteryOptimizations();
|
||||
if (!await _backgroundService.isIgnoringBatteryOptimizations()) {
|
||||
onBatteryInfo();
|
||||
}
|
||||
}
|
||||
final bool success = await _backgroundService.stopService() &&
|
||||
await _backgroundService.startService(
|
||||
|
||||
Reference in New Issue
Block a user