mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00

We currently set both actions depending on the playWhenReady state and we require both actions when converting a platform session to a Media3 session (if ACTION_PLAY_PAUSE isn't set anyway). This causes problems in two situations: - A controller using the platform ACTION_PAUSE/ACTION_PLAY to determine which button to show in a UI. This needs to be aligned to the existing Util.shouldShowPlayButton we already use when setting the PlaybackStateCompat state. - A session only setting either ACTION_PAUSE or ACTION_PLAY depending on its state. We should check if the action triggered by setPlayWhenReady(...) is possible and allow COMMAND_PLAY_PAUSE accordingly. PiperOrigin-RevId: 726916720 (cherry picked from commit 28bfb27fb59ceb0cd209ac1eebd803d31f78afa4)
Session test module
Tests cross-process use of the session module. To run the tests:
- Prepare a device (either an emulator or a real device) to run the tests on.
- Run
./gradlew :test-session-current:cAT