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

Commit 9b2e567a authored by RoboErik's avatar RoboErik Committed by Android (Google) Code Review
Browse files

Merge "Remove BT routes when BT is turned off" into lmp-dev

parents 40968da1 5535ea8e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -4174,6 +4174,14 @@ public class AudioService extends IAudioService.Stub {
                AudioSystem.DEVICE_STATE_UNAVAILABLE,
                address);
        mConnectedDevices.remove(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP);
        synchronized (mCurAudioRoutes) {
            // Remove A2DP routes as well
            if (mCurAudioRoutes.mBluetoothName != null) {
                mCurAudioRoutes.mBluetoothName = null;
                sendMsg(mAudioHandler, MSG_REPORT_NEW_ROUTES,
                        SENDMSG_NOOP, 0, 0, null, 0);
            }
        }
    }

    // must be called synchronized on mConnectedDevices