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

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

Merge "AVRCP: Prevent multithread issues in cleanup"

am: f297d325

Change-Id: Ic02f71b18f80c23791f6cd2bb8f69f99b533e6f5
parents 62cb1d82 f297d325
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -133,7 +133,9 @@ public class AddressedMediaPlayer {
        }
        mNowPlayingList = items;
        // TODO (jamuraa): test to see if the single-item queue is the same and don't send
        if (mMediaInterface != null) {
            mMediaInterface.nowPlayingChangedRsp(AvrcpConstants.NOTIFICATION_TYPE_CHANGED);
        }
        return items;
    }

+3 −5
Original line number Diff line number Diff line
@@ -292,7 +292,7 @@ public final class Avrcp {
        context.registerReceiver(mBootReceiver, bootFilter);
    }

    private void start() {
    private synchronized void start() {
        HandlerThread thread = new HandlerThread("BluetoothAvrcpHandler");
        thread.start();
        Looper looper = thread.getLooper();
@@ -334,11 +334,9 @@ public final class Avrcp {
        return ar;
    }

    public void doQuit() {
    public synchronized void doQuit() {
        if (DEBUG) Log.d(TAG, "doQuit");
        synchronized (this) {
        if (mMediaController != null) mMediaController.unregisterCallback(mMediaControllerCb);
        }
        if (mMediaSessionManager != null) {
            mMediaSessionManager.setCallback(null, null);
            mMediaSessionManager.removeOnActiveSessionsChangedListener(mActiveSessionListener);