Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit d327d33c authored by Cheney Ni's avatar Cheney Ni
Browse files

Always assign a free ID to the new MediaPlayer

It used current size plus 1 as the new MediaPlayer's ID in previous
design and if a player was removed before, the ID of size+1 maybe was
still in used but a ID < size+1 was freed.

This change finds a free ID by checking if the number is not in the
mMediaPlayerIds so we never use same ID in two player.

Bug: 110511529
Test: manually switching players by force-stop / disabled
runtest bluetooth -c com.android.bluetooth.avrcp.MediaPlayerWrapperTest

Change-Id: Ia9e67a34b5915ad615746e6b334c1596ee639c1a
parent 8d0ee001
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment