Player controls not showing up in Android Auto

41 Views Asked by At

I have setup the mediasession, along with the playbackstate, metadata and callback.

mediaSession = MediaSessionCompat(this, "MusicService")
        .apply {
            setSessionActivity(sessionActivityPendingIntent)
            stateBuilder = PlaybackStateCompat.Builder()
                .setActions(PlaybackStateCompat.ACTION_PLAY
                        or PlaybackStateCompat.ACTION_PLAY_PAUSE
                )
            setPlaybackState(stateBuilder.build())
            setMetadata(mediaMetadata)
            setCallback(mediaSessionCallback)
            isActive = true
        }
    sessionToken = mediaSession.sessionToken

The android auto application seems to be connected to the session, the onPlay from the mediasessioncallback is being called, and music is streaming from the app to the head unit but I just don't see the player controls. What else do I have to initialize? The screenshot shows the player controls I was referring to that is not showing up.

enter image description here

0

There are 0 best solutions below