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

Commit 036ce6be authored by Satish Kodishala's avatar Satish Kodishala Committed by android-build-merger
Browse files

Merge \"Check for call/call setup state before creating SCO\"

am: d0e08e83

Change-Id: I74d86b349b86efb7c82f114aa72be4a4af55ce0a
parents 227d8a89 d0e08e83
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -857,6 +857,10 @@ final class HeadsetStateMachine extends StateMachine {
                case CONNECT_AUDIO:
                {
                    BluetoothDevice device = mCurrentDevice;
                    if (!isScoAcceptable()) {
                        Log.w(TAG,"No Active/Held call, MO call setup, not allowing SCO");
                        break;
                    }
                    // TODO(BT) when failure, broadcast audio connecting to disconnected intent
                    //          check if device matches mCurrentDevice
                    if (mActiveScoDevice != null) {
@@ -3299,7 +3303,8 @@ final class HeadsetStateMachine extends StateMachine {

    private boolean isInCall() {
        return ((mPhoneState.getNumActiveCall() > 0) || (mPhoneState.getNumHeldCall() > 0) ||
                (mPhoneState.getCallState() != HeadsetHalConstants.CALL_STATE_IDLE));
                ((mPhoneState.getCallState() != HeadsetHalConstants.CALL_STATE_IDLE) &&
                 (mPhoneState.getCallState() != HeadsetHalConstants.CALL_STATE_INCOMING)));
    }

    // Accept incoming SCO only when there is active call, VR activated,