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

Commit dbe4060f authored by Jakub Tyszkowski's avatar Jakub Tyszkowski
Browse files

McpService: Fix not unregistering AudioManager callback

Bug: 287538438
Test: atest BluetoothInstrumentationTests
Change-Id: I8ee2e83f3436d704f54565488ed19bb7e8e813c0
parent 293d340c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -247,6 +247,7 @@ public class MediaPlayerList {
    }

    public void cleanup() {
        mCallback = null;
        mContext.unregisterReceiver(mPackageChangedBroadcastReceiver);

        mActivePlayerId = NO_ACTIVE_PLAYER;
+3 −0
Original line number Diff line number Diff line
@@ -115,6 +115,9 @@ public class McpService extends ProfileService {
        synchronized (mLock) {
            if (getGmcsLocked() == null) {
                // Initialize the Media Control Service Server
                if (mGmcs != null) {
                    mGmcs.cleanup();
                }
                mGmcs = new MediaControlProfile(this);
                // Requires this service to be already started thus we have to make it an async call
                mHandler.post(() -> {