Add Support for Driving Mode
Description
This MR enables VLC to return suggested albums (with cover art) to the new Google Maps Driving Mode UI, which replaces Android Auto for Phones in Android 12 and beyond. Three major things are accomplished in this change:
- Suggestions are returned based on playback history (if available), or last added tracks
- The menu for the Home and My Library tabs are flattened into a single root menu (only for one specific caller)
- The application type is updated from 'video' to 'audio', as driving mode filters out non-audio media browsers (What else uses that type?)
Motivation and Context
VLC is now able to display albums in the 'For You' section on the driving mode landing page.
How Has This Been Tested?
Frankly, this is a difficult feature to test because the 'For You' entries are cached in some unknown location I cannot clear on-demand (they usually expire in 12 hours or less). I recommend leveraging the Streams tab (temporarily) to confirm the appropriate playable media items are returned.
Update MediaSessionBrowser.kt to provide the list of suggestions:
ID_STREAM -> {
//list = ml.lastStreamsPlayed()
//list.sortWith(MediaComparators.ANDROID_AUTO)
return buildSuggestions(context, parentId, ml)
}
Tested on a Google Pixel 3, Running Android 11.
Note: I still experience a race condition which terminates playback at around the 10 second mark documented in #2248 (closed). That should be addressed in a separate fix.
Screenshots / GIFs (if appropriate):
Types of changes
-
New feature (non-breaking change which adds functionality)
Checklist
-
I have read the CONTRIBUTING section of the README document.