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
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue