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
@@ -122,8 +122,8 @@ class BackgroundService {
|
||||
}
|
||||
}
|
||||
|
||||
/// Opens an activity to let the user disable battery optimizations for Immich
|
||||
Future<bool> disableBatteryOptimizations() async {
|
||||
/// Returns `true` if battery optimizations are disabled
|
||||
Future<bool> isIgnoringBatteryOptimizations() async {
|
||||
if (!Platform.isAndroid) {
|
||||
return true;
|
||||
}
|
||||
@@ -131,12 +131,8 @@ class BackgroundService {
|
||||
if (!_isForegroundInitialized) {
|
||||
await _initialize();
|
||||
}
|
||||
final String message =
|
||||
"backup_background_service_disable_battery_optimizations".tr();
|
||||
return await _foregroundChannel.invokeMethod(
|
||||
'disableBatteryOptimizations',
|
||||
message,
|
||||
);
|
||||
return await _foregroundChannel
|
||||
.invokeMethod('isIgnoringBatteryOptimizations');
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user