feat: hold Android push in a foreground service #88
No reviewers
Labels
No labels
adr
android
area/calendar
area/design-system
area/i18n
area/jobs
area/offline
area/server
area/testing
bug
ci
duplicate
enhancement
help wanted
invalid
notifications
question
reliability
security
severity/low
severity/medium
tracking
web
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
eagraiclainne/app!88
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/push-foreground-service"
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?
Closes #59. Extends ADR-0030.
Promotes the
Subscribeconsumer from #58 into a foreground service, so Android push arrives within seconds even with the app closed — the deferred half of ADR-0030.What
PushService— a foreground service that owns theSubscribestream and renders each row viaNotifier. Silent, minimized persistent notification (IMPORTANCE_MINchannel, "Watching for updates").START_STICKYso the OS restarts it after a kill; idempotent start so re-arming doesn't stack streams.specialUse(with adataSyncfallback for pre-34).dataSynccarries a per-day cap on Android 15 that would break the overnight-idle case;specialUsefits a long-lived socket and we self-distribute (no Play review).Graph.cancelSessionWork).ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, device-levelbattery_prompt_seenflag) — materially improves survival on stock Android.InboxPollWorkerstays as the last-resort backstop for OEMs (Xiaomi/Huawei/Samsung) that kill foreground services anyway.The live-stream launch moves out of
MainActivity(activity-scoped, died on close) and into the service.Design decisions (agreed)
Both recorded in the ADR-0030 update.
Verification
make checkgreen;:app:assembleDebug(manifest merge for the FGS type/perms), app+data unit tests, andcompileDebugKotlinall pass.⚠️ The DoD is device-only and I cannot run it: closed-app delivery within seconds on a device left idle overnight, and recovery from airplane toggles / server restart / Wi-Fi↔mobile — needs a physical device over a multi-hour window. OEM battery-killer behaviour is inherently per-device. Please verify on the phone before merge.
Stacking
Stacked for fast-forward on
feat/self-contained-android-push(#87). Merge order: #82 → #79 → #80 → #81 → #84 → #85 → #86 → #87 → this.🤖 Generated with Claude Code
Test report
Coverage: 27.6%
Updated by the check workflow · commit
f189c2029cAndroid test report
Updated by the android workflow · commit
f189c2029cf189c2029c279d8d8f3a