feat(android): background-run exemption — wizard card + backup tab hint #1392
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/android-battery-exemption"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem\nAndroid (Doze + aggressive OEM battery savers) can defer or kill the periodic WorkManager backup — the app had no battery-optimization handling at all, so backups could silently stall on Samsung/Xiaomi/Huawei devices. This is the gap every background-backup app covers with an "always run in background" ask.\n\n## What it does\n-
PowerExemptionboundary (PowerManager-backed) +REQUEST_IGNORE_BATTERY_OPTIMIZATIONSmanifest permission; request fires the real system dialog (resolve-guarded no-op).\n- Wizard: 4th card "Immer im Hintergrund ausführen" in the backup step — tap-to-ask only (never auto-fires; unlike runtime permissions this dialog is intrusive), granted state flips in place on resume. Not counted as a required/optional permission — it's a system setting.\n- Backup tab: quiet hint card (title + where-to-check hint + Allow) only while the exemption is missing; disappears entirely when granted.\n- de/en/da strings in parity; ON_RESUME-refreshingrememberExemptState()helper (JVM-tested).\n\n## Verification\n./gradlew :app:testDebugUnitTest :core:test :app:assembleDebug→ BUILD SUCCESSFUL, 1009 tests / 0 failures (new: ExemptStateTest 4, PowerExemptionRobolectricTest 3; BackupPermissionsTest 108 regression green). Android CI image scoped runs apply.