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

Commit 837cc1b1 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Bluetooth:Handling Connect request in AudioOn state."

parents 6688afea 7e44e26d
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -935,6 +935,21 @@ final class HeadsetStateMachine extends StateMachine {

            boolean retValue = HANDLED;
            switch(message.what) {
                case CONNECT:
                {
                    BluetoothDevice device = (BluetoothDevice) message.obj;
                    if (mCurrentDevice.equals(device)) {
                        break;
                    }
                    deferMessage(obtainMessage(DISCONNECT, mCurrentDevice));
                    deferMessage(obtainMessage(CONNECT, message.obj));
                    if (disconnectAudioNative(getByteAddress(mCurrentDevice))) {
                        log("Disconnecting SCO audio");
                    } else {
                        Log.e(TAG, "disconnectAudioNative failed");
                    }
                }
                break;
                case DISCONNECT:
                {
                    BluetoothDevice device = (BluetoothDevice) message.obj;