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

We currently pause playback to prevent further progress while the app thread runs assertion and triggers additional actions. This is not ideal because we do not actually want to pause playback in almost all cases where this method used. This can be improved by keeping the playback thread blocked and only unblock it the next time the app thread waits for the player (either via RobolectricUtil methods or by blocking the thread itself). To add this automatic handling, this change introduces a new util class for the tests that can keep the list of waiting threads statically (because the access to this logic is spread across multiple independent classes). PiperOrigin-RevId: 589784204