
The periodic updates are only meant to happen while we are in the same period or ad. This was already guaranteed except for two cases: 1. The Player in a session has updated its state without yet calling its listeners 2. The session scheduled a PlayerInfo update that hasn't been sent yet ... and in both cases, the following happened: - The change updated the mediaItemIndex to an index that didn't exist in a previous Timeline known to the Controller - One of the period position updates happened to be sent at exactly this time This problem can be avoided by only scheduling the update if we are still in the same period/ad and haven't scheduled a normal PlayerInfo update already. Since new MediaControllers may still connect to old sessons with this bug, we need an equivalent change on the controller side to ignore such buggy updates. PiperOrigin-RevId: 532089328 (cherry picked from commit 96dd0ae5837a5fd82d7407623bedb5fd4d1e9252)
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