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

Commit d0e08e83 authored by Andre Eisenbach's avatar Andre Eisenbach Committed by Gerrit Code Review
Browse files

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

parents 6c27db53 b73acbef
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,