media3/libraries/test_session_current
tonihei ac42b593cc Delay unbinding the controller until pending commands are handled.
Once a controller bound to a MediaSessionService unbinds, this service
may be destroyed immediately if this was the last bound controller and
the service isn't started in the foreground.

At the time of releasing the controller, there may still be pending
commands that need to be handled by the session service. These commands
may cause the session service to post a foreground notification to
keep it alive. So to avoid the destruction of the service while these
commands are still handled, we need to keep the controller bound.

We also add a timeout in case the session tasks are never completed
by the session implementation. In case the controller is destroyed,
the unbinding happens automatically by the system.

PiperOrigin-RevId: 463802220
2022-08-08 08:19:35 +00:00
..
2021-10-27 09:12:46 +01:00

Session test module

Tests cross-process use of the session module. To run the tests:

  1. Prepare a device (either an emulator or a real device) to run the tests on.
  2. Run ./gradlew :test-session-current:cAT