From c9df30980d852cd4e8ad0b8f5d51fc55aab81f62 Mon Sep 17 00:00:00 2001 From: Luca Stefani Date: Tue, 26 Nov 2024 18:02:02 +0100 Subject: [PATCH] Twelve: Add library commands to session commands Unbreak Android Auto Change-Id: I2f0dacfb44886937562d29a696de4d5d0b42ea07 --- .../lineageos/twelve/services/PlaybackService.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/lineageos/twelve/services/PlaybackService.kt b/app/src/main/java/org/lineageos/twelve/services/PlaybackService.kt index c49dd0bc..fc5411fd 100644 --- a/app/src/main/java/org/lineageos/twelve/services/PlaybackService.kt +++ b/app/src/main/java/org/lineageos/twelve/services/PlaybackService.kt @@ -100,13 +100,14 @@ class PlaybackService : MediaLibraryService(), Player.Listener, LifecycleOwner { session: MediaSession, controller: MediaSession.ControllerInfo ): MediaSession.ConnectionResult { - val sessionCommands = MediaSession.ConnectionResult.DEFAULT_SESSION_COMMANDS.buildUpon() - .apply { - for (command in CustomCommand.entries) { - add(command.sessionCommand) + val sessionCommands = + MediaSession.ConnectionResult.DEFAULT_SESSION_AND_LIBRARY_COMMANDS.buildUpon() + .apply { + for (command in CustomCommand.entries) { + add(command.sessionCommand) + } } - } - .build() + .build() return MediaSession.ConnectionResult.AcceptedResultBuilder(session) .setAvailableSessionCommands(sessionCommands)