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

Commit 10c1bd2a authored by Mallikarjuna GB's avatar Mallikarjuna GB Committed by Andre Eisenbach
Browse files

Handle startScoUsingVirtualVoiceCall in HeadsetService

Use case:
Connect headset while in VOIP call

Failure:
SCO is not established with headset

Root cause:
When HS is connected while in VOIP call, sometimes
startScoUsingVirtualVoiceCall() is called even before HSM is
transitioning from Disconnected/Pending to Connected state.

Fix:
Do not ignore startScoUsingVirtualVoiceCall in HeadsetService
if HeadsetStateMachine is still in process of transition to
Connected state.

Change-Id: I8a6c7f3e08b8a9dfc4c4efc6d1d041149874eab0
parent ba0e1b43
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -472,11 +472,8 @@ public class HeadsetService extends ProfileService {
    }

    boolean startScoUsingVirtualVoiceCall(BluetoothDevice device) {
        int connectionState = mStateMachine.getConnectionState(device);
        if (connectionState != BluetoothProfile.STATE_CONNECTED &&
            connectionState != BluetoothProfile.STATE_CONNECTING) {
            return false;
        }
        /* Do not ignore request if HSM state is still Disconnected or
           Pending, it will be processed when transitioned to Connected */
        mStateMachine.sendMessage(HeadsetStateMachine.VIRTUAL_CALL_START, device);
        return true;
    }