mirror of
https://github.com/Monkopedia/rouse-context.git
synced 2026-11-29 11:13:05 +00:00
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> |
||
|---|---|---|
| .. | ||
| src | ||
| build.gradle.kts | ||