Skip to content

Commit

Permalink
Twelve: Add library commands to session commands
Browse files Browse the repository at this point in the history
Unbreak Android Auto

Change-Id: I2f0dacfb44886937562d29a696de4d5d0b42ea07
  • Loading branch information
luca020400 committed Nov 26, 2024
1 parent 16e8374 commit c9df309
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c9df309

Please sign in to comment.