Conditionally remove the package->id association and NOT the player
From a previous bug, b/150462872, it was noticed that removing a player
ID from a package with a browsed player just because the media session
was removed was causing crashes when browsing to the package. A change
was put in to remedy that which still had issues.
This change makes sure to remove the wrapper player and NOT the player
ID, which was easy to do given the naming conventions, etc. This change
also moves some of the checks we've been doing in to functions that are
nicely named and easier to use.
Lastly, this change makes sure we re-add a wrapped media player object
when we get media key session updates because on if a player exists and
NOT on whether a player ID exists. This is important because a player
wont exist if an ID doesn't exist, but a player ID might exist now if a
browser exists and the player was removed. Adding a player is smart
enough to reuse player IDs as well, so it is safe.
Bug: b/153296661
Test: Build, flash, interop
Change-Id: Ie283e7e9bfdc3d81ae71acbf579c5113c5720bbb
Merged-In: Ie283e7e9bfdc3d81ae71acbf579c5113c5720bbb
1 file changed