d6290a3ef0
android / Build + lint + test (push) Successful in 3m43s
Observed on device: casting to Sonos on battery + screen locked, a transient ~67s reachability gap (NetworkStatus -> ServerDown while WiFi itself stayed associated) starved the 1 Hz poll past DROP_THRESHOLD. The poll loop then dropped the route and fell back to the local player, which honored the play-intent -- so the phone suddenly started playing the song out loud locally while the Sonos was still happily streaming it. A poll failure during a phone-side network outage means "we can't see the renderer right now," not "the renderer died": a UPnP renderer streams autonomously and keeps playing, and the local player we'd fall back to can't reach the server either. Dropping is strictly worse than waiting. Gate the drop on NetworkStatusController: only drop when the phone's network is Healthy (renderer genuinely unreachable on an otherwise-fine link). While Unstable/ServerDown/Offline, hold the route, keep polling, and clear the failure streak so recovery re-evaluates from scratch rather than re-dropping on the first post-recovery hiccup. The poll reconciles to the renderer's real (advanced) position once the network returns. Complements the CastNetworkLock fix: the lock reduces how often these gaps happen; this stops a gap that does happen from punishing the user. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>