fix(android): failed UPnP play reverts to phone and resumes locally

This commit is contained in:
2026-06-06 17:29:58 -04:00
parent 8a3104443c
commit 41da012494
@@ -429,7 +429,10 @@ class OutputPickerController @Inject constructor(
*/ */
private fun handleRemoteDrop() { private fun handleRemoteDrop() {
val capturedPositionMs = remoteState.positionMs val capturedPositionMs = remoteState.positionMs
val wasPlayingRemote = remoteState.isPlaying // Resume on the operator's last play-intent, not the observed remote
// state: after a pause, isPlaying is false, but a failed play() that
// triggered this drop means the operator DID ask to play -- honor it.
val wasPlayingRemote = remoteState.lastPlayIntent
activeUpnpHolder.set(null) activeUpnpHolder.set(null)
activeUpnpHolder.setTarget(null) activeUpnpHolder.setTarget(null)
selectedUpnpRouteIdInternal.value = null selectedUpnpRouteIdInternal.value = null
@@ -552,6 +555,9 @@ class OutputPickerController @Inject constructor(
rendering = rendering, rendering = rendering,
), ),
) )
// Selecting a route loads the queue and Plays on the renderer, so
// the standing intent is "play" -- a later drop should resume local.
remoteState.setPlayIntent(true)
}.onFailure { e -> }.onFailure { e ->
Timber.w(e, "UPnP select failed for route ${effectiveRoute.id}") Timber.w(e, "UPnP select failed for route ${effectiveRoute.id}")
activeUpnpHolder.set(null) activeUpnpHolder.set(null)