fix(android): backup button stuck on „Sichert …" — periodic ENQUEUED no longer counts as active #1400
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/backup-button-stuck-enqueued"
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 (device-reproduced, Pixel 2 / LineageOS)
On the Sicherung tab the primary button permanently showed „Sichert …" (disabled, presses no-op) while nothing ran. Counters 0, „Letzter Lauf: Geplant".
Root cause
BackupStatusUiState.isWorkActivetreatedBackupWorkState.ENQUEUEDas active. The UI snapshot (WorkManagerBackupStatusSource.observe) falls back to the periodic WorkInfo when no one-off row exists — and a periodic job sits ENQUEUED virtually forever (waiting for its next 6h window; JobScheduler on-device confirmed: constraints satisfied, only TIMING_DELAY unsatisfied, no immediate-work job registered). So the fallback mapped "schedule waiting" → "run active": button disabled forever,backupNow()/retryFailed()early-return no-ops.Fix
BackupWorkSnapshot.isPeriodic: the periodic fallback marks its snapshotisWorkActive: RUNNING counts from either source; ENQUEUED only for the one-offLastRunCard: periodic-ENQUEUED shows the idle label ("Noch kein Lauf aufgezeichnet") instead of the lying „Geplant"