rouse-context/work
Jason Monk 35b0b53f2e Fix #104: Cap idle timeout regardless of prior ACTIVE + track spurious wakes
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>
2026-04-13 22:20:16 -04:00
..
src Fix #104: Cap idle timeout regardless of prior ACTIVE + track spurious wakes 2026-04-13 22:20:16 -04:00
build.gradle.kts Fix #18: Update Gradle wrapper and dependencies to latest stable 2026-04-11 17:36:46 -04:00