mirror of
https://github.com/Monkopedia/rouse-context.git
synced 2026-11-30 03:32:28 +00:00
IdleTimeoutManager previously required at least one ACTIVE transition before arming the idle timer, so an FCM wake that never produced a client stream kept the foreground service alive indefinitely (reported 27+ min CONNECTED with no streams). Drop the `hasBeenActive` gate: every entry into CONNECTED arms a 5 min timer, every ACTIVE cancels it. Preserves the existing stream-resumes-timer behavior and adds a cap on pre-first-stream waits. Also adds wake-cycle observability so the relay-side spurious-wake theory can be confirmed on-device: - SpuriousWakeRecorder interface (kept in :work for testability) - SharedPreferencesSpuriousWakeRecorder persists lifetime total + up to 64 recent spurious timestamps (plain-text CSV, parseable in JVM unit tests) - Settings diagnostics row shows "Background wakes without client (24h): N / total: M" once at least one spurious wake has been seen - Dashboard SpuriousWakeBanner (low-severity, surface container) surfaces when the rolling-24h count exceeds 10; tapping navigates to Settings Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| build.gradle.kts | ||