fix(android auto): tapping a song (e.g. in Favoriten) did nothing — re-attach stream URI

Android Auto strips a MediaItem's URI (localConfiguration) when a browse-tree item
crosses the process boundary, so onAddMediaItems received the tapped song without a
playable URI and the else branch passed it through unchanged → no playback. Rebuild
the item with the stream URI resolved from its mediaId.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Opus 4.8 committed 2026-08-10 20:22:09 +02:00
1 parent 1d98b273e7
commit d35fb01306
1 file changed
+7 -1
@@ -385,7 +385,13 @@ class MusicService : MediaLibraryService() {
val pl = repo.getPlaylist(item.mediaId.removePrefix(ITEM_PREFIX_PL)) val pl = repo.getPlaylist(item.mediaId.removePrefix(ITEM_PREFIX_PL))
pl.entry.map { song -> song.toMediaItem(repo) } pl.entry.map { song -> song.toMediaItem(repo) }
} }
else -> listOf(item) // A tapped song (e.g. in Favoriten): Android Auto strips the URI
// (localConfiguration) when the browse item crosses the process boundary,
// so it comes back unplayable → nothing happens. Re-attach the stream URI.
else -> {
val uri = repo.streamUrl(item.mediaId)?.let { android.net.Uri.parse(it) }
listOf(item.buildUpon().setUri(uri).build())
}
} }
} }
settable.set(resolved.toMutableList()) settable.set(resolved.toMutableList())