-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update session position info on timeline change
This fixes an inconsistent state of the `PlayerInfo` when the index of the playing media item is changed by a playlist modification. In this inconsistent state, calling `Playerinfo.getCurrentMediaItem` can produce an `ArrayIndexOutOfBoundException` (see stack trace in GH issue). This change takes the following measurements: - always update sessionPosition and timeline of the PlayerInfo together in `MediaSessionImpl.PlayerListener` where the PlayerInfo originates from - add an assertion to avoid building a `PlayerInfo` instance in an inconsistent state - reduce the window of opportunity for concurrent access to `mediaSessionImpl.playerInfo` when dispatching player info changes in `MediaSessionImpl` Issue: #51 PiperOrigin-RevId: 444812661
- Loading branch information
1 parent
9369348
commit dee83cc
Showing
4 changed files
with
39 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters