Skip to content

feat: Android Auto β€” browse & play playlists, Liked Songs and Discover Weekly#3064

Open
gituser-vibes wants to merge 1 commit into
KRTirtho:masterfrom
gituser-vibes:feat/android-auto-media-browsing
Open

feat: Android Auto β€” browse & play playlists, Liked Songs and Discover Weekly#3064
gituser-vibes wants to merge 1 commit into
KRTirtho:masterfrom
gituser-vibes:feat/android-auto-media-browsing

Conversation

@gituser-vibes

@gituser-vibes gituser-vibes commented Jun 24, 2026

Copy link
Copy Markdown

Summary

Adds Android Auto (and general media-browser) support: you can browse your
library and start playback from the car head unit, including the "Made for you"
hub.

What you get

  • Root: Liked Songs, a Browse folder, and your saved playlists.
  • Browse β†’ sections (Made For You, Your top mixes, …) β†’ playlists. This is
    how Discover Weekly / Daily Mixes / Release Radar are reached β€” they are
    not returned by me/playlists; they come from browse.sectionItems (the
    section preview from browse.sections omits them).
  • Each collection drills into its track list with a β–Ά Play all entry;
    tapping a track plays the collection from that point.
  • A shuffle control on the now-playing screen.

Implementation notes

  • Implements getChildren / playFromMediaId on MobileAudioService;
    audio_services.dart now passes ref so the hooks can read providers.
  • Playback reuses the existing AudioPlayerNotifier.load(...) pipeline.
  • Shuffle is exposed as an explicit MediaControl.custom (Android Auto doesn't
    reliably render a toggle from the standard ACTION_SET_SHUFFLE_MODE); icons
    added under res/drawable.
  • Auth-sensitive calls are retried β€” on cold start the stored token is often
    stale and the first request 401s before the plugin refreshes it.
  • Browse artwork uses http(s) URLs only (the media-browser process can't read
    app-private file:// paths).
  • The MediaBrowserService + automotive_app_desc.xml were already declared,
    so no native manifest changes were needed.

Depends on

The headless cold-start fix (#3063) β€” without it the app hangs when
Android Auto cold-starts it. Recommend merging that first (or together).

Testing

Built and exercised via the Desktop Head Unit on a Pixel 9 Pro: browse β†’
Made For You β†’ Discover Weekly β†’ Play all, plus shuffle and tap-to-play-from-track.

… Weekly

Implement the audio_service media-browser hooks so Android Auto (and other
media browsers) can browse the library and start playback:

- getChildren exposes Liked Songs, a "Browse" folder (the home / "Made for
  you" hub β€” including Discover Weekly, fetched via browse.sectionItems since
  the section preview omits it), and the user's saved playlists.
- Collections are browsable into their track list with a "Play all" entry;
  tapping a track plays the collection from that point.
- playFromMediaId resolves the selection and plays through the existing
  AudioPlayerNotifier.load pipeline.
- Add an explicit shuffle MediaControl + custom action (Android Auto does not
  reliably render a toggle from the standard ACTION_SET_SHUFFLE_MODE alone).
- Retry auth-sensitive requests: the stored token is often stale on cold
  start and the first call 401s before the plugin refreshes it.
- Browse-item artwork uses http(s) URLs only β€” the media-browser process
  cannot read app-private file:// paths.

The MediaBrowserService and automotive_app_desc.xml were already declared in
the manifest, so no native changes are required.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant