diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-08-22 01:08:22 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-08-22 01:08:22 +0000 |
| commit | 7f324168464934d711953dc748fbc7c65eb88f4b (patch) | |
| tree | 1bac6e3957ceca6736083dc4c1684c1d67941305 /app/src/main/java/org/terst/feedreader/ui/ReaderScreen.kt | |
| parent | 78bc7b3c48eae1b68d3f35c81ea2b959d8136477 (diff) | |
Add a 5am morning-fetch alarm so articles are fresh before you open the app
FeedFetchWorker's periodic 60-minute WorkManager job can (and does)
get silently deferred for hours by Doze on an idle overnight device.
An exact alarm (setExactAndAllowWhileIdle) wakes the device at a fixed
5am to run a fetch, without requesting the much broader "ignore
battery optimizations" exemption -- battery optimization stays on
otherwise, just this one daily wake-up.
Android 12+ requires a one-time user grant for exact alarms (no in-app
permission dialog); MainActivity requests it via Settings if not
already granted, tracked across rotation via savedInstanceState so a
config change doesn't re-trigger the Settings screen. The alarm also
gets re-armed on BOOT_COMPLETED, since AlarmManager alarms don't
survive a device restart on their own.
Diffstat (limited to 'app/src/main/java/org/terst/feedreader/ui/ReaderScreen.kt')
0 files changed, 0 insertions, 0 deletions
