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

Commit f297d325 authored by Marie Janssen's avatar Marie Janssen Committed by Gerrit Code Review
Browse files

Merge "AVRCP: Prevent multithread issues in cleanup"

parents 79ba291e 2db96940
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);