rouse-context/work
Jason Monk 67f60bf1ec Fix #110: Handle FGS 6h limit gracefully — notify + stopSelf instead of crash
Before this fix, when `startForeground(...)` was called after the
cumulative `dataSync` foreground-service budget had been exhausted
(6h / 24h on Android 14+), the resulting
`ForegroundServiceStartNotAllowedException` propagated out of
`TunnelForegroundService.onCreate` and crashed the process. Every
subsequent FCM wake re-crashed until the rolling 24h window reset,
producing a crash loop for affected users.

Keep `foregroundServiceType=dataSync` — masking the cap via specialUse
would hide a real signal. Instead, catch the exception, post a
user-visible HIGH-importance notification on a new `rouse_fgs_limit`
channel explaining the situation, and call `stopSelf()`. No retry is
scheduled: the next FCM wake naturally re-attempts `startForeground`,
and once the rolling window gives budget back, the service starts
normally.

A fixed notification id is used so repeated exhausted wakes update the
same notification rather than spamming the shade.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 06:20:44 -04:00
..
src Fix #110: Handle FGS 6h limit gracefully — notify + stopSelf instead of crash 2026-04-14 06:20:44 -04:00
build.gradle.kts Fix #87: Implement FirebaseRenewalAuthProvider with AndroidKeystore EC signing 2026-04-13 22:42:22 -04:00