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

Commit a6e17106 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "HFP AG: Fix the condition to check if SCO is connected"

parents 493a0024 65d4db9d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1127,9 +1127,9 @@ final class HeadsetStateMachine extends StateMachine {
                    mAudioState = BluetoothHeadset.STATE_AUDIO_CONNECTED;
                    setAudioParameters(device); /*Set proper Audio Paramters.*/
                    mAudioManager.setBluetoothScoOn(true);
                    mActiveScoDevice = device;
                    broadcastAudioState(device, BluetoothHeadset.STATE_AUDIO_CONNECTED,
                            BluetoothHeadset.STATE_AUDIO_CONNECTING);
                    mActiveScoDevice = device;
                    transitionTo(mAudioOn);
                    break;
                case HeadsetHalConstants.AUDIO_STATE_CONNECTING:
@@ -2104,7 +2104,7 @@ final class HeadsetStateMachine extends StateMachine {
            sco disconnect issued in AudioOn state. This was causing a mismatch in the
            Incall screen UI. */

            if (getCurrentState() == mAudioOn && mCurrentDevice.equals(device)
            if (mActiveScoDevice != null && mActiveScoDevice.equals(device)
                    && mAudioState != BluetoothHeadset.STATE_AUDIO_DISCONNECTED) {
                return true;
            }