You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensure masking PlayerInfos are not merged into real PlayerInfo updates
The masking process in MediaController sends pending actions and creates
placeholder PlayerInfo objects. Once all pending actions are received
and we got a final new PlayerInfo from the session, the masking stops
and we should continue using the real PlayerInfo from session again.
The current tracking wasn't quite accurate, leading to some cases
where we accidentally merge a masking PlayerInfo with a real one, which
may cause exceptions since they may not be compatible.
To solve this, we can
- Clearly start the masking process by setting pendingPlayerInfo to
the currently known PlayerInfo (not just when receiving intermediate
updates). This has the nice side effect that we no longer need the
pendingBundlingExclusions as we start off with no exlusions already
and never have to deal with a pending state that has values excluded.
- When ending the masking process, clearly copy over the last real
PlayerInfo (without any exclusions), so that no merging with any
placeholder/masking PlayerInfo object happens.
There is a remaining bug where no-op updated never send a real PlayerInfo,
meaning the controller stays in its masking state forever. This causes
some of the test flakiness, which we can temporarily work around by sleeping
to ensure the order of events in the remote process is guaranteed.
PiperOrigin-RevId: 776629604
Copy file name to clipboardExpand all lines: libraries/test_session_current/src/androidTest/java/androidx/media3/session/MediaControllerStateMaskingTest.java
0 commit comments