Files
Obtainium/android
Imran Remtulla ab60373574 experiment: replace background_fetch + flutter_foreground_task with workmanager
THIS IS EXPERIMENTAL AND MAY NEED TO BE REVERTED.

- Replace background_fetch (^1.7.0) and flutter_foreground_task (^9.2.2)
  with workmanager (^0.9.0+3)
- Single callbackDispatcher replaces both the old headless task and the
  foreground service TaskHandler — simplifies to one code path
- WorkManager constraints enforce WiFi-only and charging-only at the OS
  level instead of checking in Dart after waking the app
- Fix: enableBackgroundUpdates toggle now properly cancels/resumes
  WorkManager tasks (previously the toggle was UI-only and didn't
  actually stop background checks)
- Add "Run background check now" button to the bottom of the Updates
  settings card for manual testing
- Detailed logging at every stage: WorkManager init, task registration,
  callback invocation, completion, and crashes
- Removed: foreground service declaration, FOREGROUND_SERVICE_SPECIAL_USE
  permission, useFGService setting, showBatteryOptimizationPrompt setting,
  and 4 orphaned translation keys

Known risk: workmanager was previously tried and abandoned in Nov 2022
(PR #97) due to fluttercommunity/flutter_workmanager#415 and #363 (tasks
stopping after app closed / after 3-5 days). These issues remain open
but the package has had 4 years of updates since then.
2026-07-06 17:29:44 +01:00
..
2025-12-15 13:31:09 +03:00