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

Commit eac56523 authored by Marie Janssen's avatar Marie Janssen Committed by android-build-merger
Browse files

Merge "AVRCP: Prevent concurrent access of Browser List"

am: bad40a0a

Change-Id: Ib94ee58541d80392a009bce128b8b506ea361ae6
parents abda0958 bad40a0a
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@ public final class Avrcp {
    private SortedMap<Integer, MediaPlayerInfo> mMediaPlayerInfoList;

    /* List of media players which supports browse */
    private ArrayList<BrowsePlayerInfo> mBrowsePlayerInfoList;
    private List<BrowsePlayerInfo> mBrowsePlayerInfoList;

    /* Manage browsed players */
    private AvrcpBrowseManager mAvrcpBrowseManager;
@@ -301,7 +301,7 @@ public final class Avrcp {
        mMediaControllerCb = new MediaControllerListener();
        mAvrcpMediaRsp = new AvrcpMediaRsp();
        mMediaPlayerInfoList = new TreeMap<Integer, MediaPlayerInfo>();
        mBrowsePlayerInfoList = new ArrayList<BrowsePlayerInfo>();
        mBrowsePlayerInfoList = Collections.synchronizedList(new ArrayList<BrowsePlayerInfo>());
        mPassthroughDispatched = 0;
        mPassthroughLogs = new EvictingQueue<MediaKeyLog>(PASSTHROUGH_LOG_MAX_SIZE);
        mPassthroughPending = Collections.synchronizedList(new ArrayList<MediaKeyLog>());
@@ -1725,13 +1725,10 @@ public final class Avrcp {
            mCurrentBrowser = null;
            mBrowsePlayerInfoList.add(mCurrentPlayer);
            MediaPlayerInfo info = getMediaPlayerInfo(mCurrentPlayer.packageName);
            if (info != null) {
            MediaController controller = (info == null) ? null : info.getMediaController();
            // Refresh the media player entry so it notices we can browse
                MediaController controller = info.getMediaController();
            if (controller != null) {
                addMediaPlayerController(controller.getWrappedInstance());
                }
                // If there's no controller, the entry is already browsable-only.
            } else {
                addMediaPlayerPackage(mCurrentPlayer.packageName);
            }