Open albertkhang opened 3 years ago
I set the callback for media session in MusicService like this
mediaSession.setCallback(object : MediaSessionCompat.Callback() { override fun onPlayFromMediaId(mediaId: String?, extras: Bundle?) { super.onPlayFromMediaId(mediaId, extras) val type = extras?.getInt("type", -1) val trackNumber = extras?.getInt("MediaMetadataCompat.METADATA_KEY_TRACK_NUMBER", -1) Log.i(MusicService::class.java.simpleName, "onPlayFromMediaId type $type, trackNumber: $trackNumber, extras: ${extras.toString()}") } })
In android auto, I can get bundle with some data in it, but in Android Automotive, it always returns empty.
Seeing the same problem. Tested on both Polestar 2 (Android 10) and Automotive (Volvo) emulator images.
Seems like the current and only work-around is by concatenating all extras to the mediaId.
I set the callback for media session in MusicService like this
In android auto, I can get bundle with some data in it, but in Android Automotive, it always returns empty.