[Feature] "Play x" Voice Commands via Assistant/Gemini on Android Auto - #13648
Open
EspoTek wants to merge 1 commit into
Open
[Feature] "Play x" Voice Commands via Assistant/Gemini on Android Auto#13648EspoTek wants to merge 1 commit into
EspoTek wants to merge 1 commit into
Conversation
Implement MediaBrowserPlaybackPreparer.onPrepareFromSearch (previously a no-op that returned ERROR_CODE_NOT_SUPPORTED): search the user's selected service and start background playback of the first matching stream. An empty query (e.g. a bare "play music" voice command) resumes the most recently played stream instead of erroring, so voice agents don't treat the app as non-search-capable. Advertise the PREPARE/PLAY variants for both media id and search in getSupportedPrepareActions(), so the MediaSessionConnector delegates prepareFromSearch as well as playFromSearch. Add PlayMediaFromSearchActivity with a bare MEDIA_PLAY_FROM_SEARCH intent filter (no data constraints). Android Auto only routes a spoken play-from-search to an app's MediaSession when such an activity is declared (see android/uamp#479); the existing filters on RouterActivity are all gated behind YouTube-URL data constraints and don't qualify. The activity also handles the activity-style intent directly (search + play) as a fallback. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
EspoTek
marked this pull request as ready for review
June 28, 2026 16:07
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR Adds
As the title suggests, you can now say "Play x" on Android Auto and it'll play x on NewPipe - with slight caveats (see below)
WhatsApp.Video.2026-06-29.at.02.02.22.mp4
According to PR #12044, this isn't possible:
But that didn't stop me because I'm too lazy to read!

Testing and Caveats
I tested this on two devices in 3 configurations.
Who actually deserves the credit for this
All code written by Claude Opus 4.8 with some gentle steering on my end.
Unedited Claude PR text below:
NewPipe's
onPrepareFromSearchwas a no-op (it returnedERROR_CODE_NOT_SUPPORTED), so voice "play <something>" commands in Android Auto did nothing. This implements it.Changes
onPrepareFromSearch— search the selected service and play the top result. An empty query (e.g. a bare "play music") resumes the most recently played stream instead of erroring.getSupportedPrepareActions()(PREPARE/PLAY_FROM_MEDIA_ID+PREPARE/PLAY_FROM_SEARCH), so the connector forwards bothplayFromSearchandprepareFromSearch.PlayMediaFromSearchActivitywith a bareMEDIA_PLAY_FROM_SEARCHintent filter. Android Auto only routes a spoken play-from-search to an app that declares such an activity (see UAMP play from search not working on Android Auto (DHU): "Sorry, something went wrong. Try opening the app to continue" android/uamp#479); NewPipe's existing filters are all gated behind YouTube-URLdataconstraints, so AA never treated it as voice-search-capable. The activity also handles the direct intent (search + play) for automation tools.Testing
Verified in Android Auto (Desktop Head Unit + a real connection) on Pixel 5 and Pixel 7: saying "play <query>" plays the top result.
Note / scope
This targets Android Auto. The phone Google Assistant/Gemini only routes "play on <app>" to apps in Google's curated media-provider catalog, so it won't trigger this for a non-listed app like NewPipe — that's a Google-side gate, not something the app can change.