4d5af3599e
android / Build + lint + test (push) Successful in 3m46s
While casting, the wrapped ExoPlayer is paused, releasing its WAKE_MODE_NETWORK locks -- so nothing kept the phone's radio awake. On a locked, on-battery phone the WiFi power-saves within seconds and the CPU dozes, stalling the 1 Hz liveness poll to the renderer and the queue-extend calls to the server. The poll then trips DROP_THRESHOLD and playback falls back to a phone that also has no network: silence, while the Sonos was streaming fine the whole time. Diagnosed from logcat: ~12s after screen-off the phone logged "Unable to resolve host minstrel.fabledsword.com" (its own DNS, not the server), the extend aborted (1/58 appended), then the drop tripped and the local fallback came up active=null. USB charging masks it (no Doze while charging), which is why it only bit on battery. Add CastNetworkLock: a high-perf/low-latency WifiLock + partial WakeLock acquired when a UPnP route goes active and released on drop/switch-back (every teardown path funnels through holder.set(null) -> onActiveChanged). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>