mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +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:
parent
5172242f88
commit
75d2d82d05
8 changed files with 58 additions and 33 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue