[Android] Opt-in to early Android Auto tab support
Robert Stone
git at videolan.org
Tue Feb 23 11:35:50 UTC 2021
vlc-android | branch: master | Robert Stone <rhstone at gmail.com> | Mon Feb 22 17:35:08 2021 -0800| [6ce68c185edadefe392b9418704d8b9038747de5] | committer: Nicolas Pomepuy
Opt-in to early Android Auto tab support
> https://code.videolan.org/videolan/vlc-android/commit/6ce68c185edadefe392b9418704d8b9038747de5
---
.../resources/src/main/java/org/videolan/resources/Constants.kt | 1 +
application/vlc-android/src/org/videolan/vlc/PlaybackService.kt | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/application/resources/src/main/java/org/videolan/resources/Constants.kt b/application/resources/src/main/java/org/videolan/resources/Constants.kt
index 456eef443..6dd122b12 100644
--- a/application/resources/src/main/java/org/videolan/resources/Constants.kt
+++ b/application/resources/src/main/java/org/videolan/resources/Constants.kt
@@ -65,6 +65,7 @@ const val PLAYBACK_SLOT_RESERVATION_SKIP_TO_PREV = "android.media.playback.ALWAY
const val CONTENT_STYLE_SUPPORTED = "android.media.browse.CONTENT_STYLE_SUPPORTED"
const val CONTENT_STYLE_PLAYABLE_HINT = "android.media.browse.CONTENT_STYLE_PLAYABLE_HINT"
const val CONTENT_STYLE_BROWSABLE_HINT = "android.media.browse.CONTENT_STYLE_BROWSABLE_HINT"
+const val TABS_OPT_IN_HINT = "android.media.browse.AUTO_TABS_OPT_IN_HINT"
const val CONTENT_STYLE_LIST_ITEM_HINT_VALUE = 1
const val CONTENT_STYLE_GRID_ITEM_HINT_VALUE = 2
diff --git a/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt b/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
index 009f3f2c2..f882236a9 100644
--- a/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
+++ b/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
@@ -1393,7 +1393,9 @@ class PlaybackService : MediaBrowserServiceCompat(), LifecycleOwner {
override fun onGetRoot(clientPackageName: String, clientUid: Int, rootHints: Bundle?): BrowserRoot? {
return if (Permissions.canReadStorage(this at PlaybackService)) {
- BrowserRoot(MediaSessionBrowser.ID_ROOT, MediaSessionBrowser.getContentStyle(CONTENT_STYLE_LIST_ITEM_HINT_VALUE, CONTENT_STYLE_LIST_ITEM_HINT_VALUE))
+ val extras = MediaSessionBrowser.getContentStyle(CONTENT_STYLE_LIST_ITEM_HINT_VALUE, CONTENT_STYLE_LIST_ITEM_HINT_VALUE)
+ extras.putBoolean(TABS_OPT_IN_HINT, true)
+ BrowserRoot(MediaSessionBrowser.ID_ROOT, extras)
} else null
}
More information about the Android
mailing list