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

Commit 0129624d authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "AudioService: fix BT SCO audio reconnect" into main

parents 9313deec 2ed15ad6
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -979,13 +979,16 @@ public class BtHelper {
            Log.w(TAG, "onSetBtScoActiveDevice() failed to remove previous device "
                    + getAnonymizedAddress(previousActiveDevice));
        }
        // mBluetoothHeadsetDevice must correspond to previous device until now and new device from
        // now on for SCO activation/deactivation requests made by
        // AudioDeviceBroker.onUpdateCommunicationRouteClient() to succeed.
        mBluetoothHeadsetDevice = btDevice;
        if (!handleBtScoActiveDeviceChange(btDevice, true, false /*deviceSwitch*/)) {
            Log.e(TAG, "onSetBtScoActiveDevice() failed to add new device "
                    + getAnonymizedAddress(btDevice));
            // set mBluetoothHeadsetDevice to null when failing to add new device
            btDevice = null;
            mBluetoothHeadsetDevice = null;
        }
        mBluetoothHeadsetDevice = btDevice;
        if (mBluetoothHeadsetDevice == null) {
            resetBluetoothSco();
        }