From 7f324168464934d711953dc748fbc7c65eb88f4b Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sat, 22 Aug 2026 01:08:22 +0000 Subject: 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. --- app/src/main/AndroidManifest.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'app/src/main/AndroidManifest.xml') diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b5b3532..a1053e3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -4,6 +4,12 @@ + + + + + + + + + -- cgit v1.2.3