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

Commit 8f261495 authored by Matthew Xie's avatar Matthew Xie Committed by Android Git Automerger
Browse files

am fe0ec4b6: Merge "ignore telephony call state if telephony mgr state is idle"

* commit 'fe0ec4b6':
  ignore telephony call state if telephony mgr state is idle
parents 42d05ff2 fe0ec4b6
Loading
Loading
Loading
Loading
+22 −8
Original line number Diff line number Diff line
@@ -2623,16 +2623,30 @@ final class HeadsetStateMachine extends StateMachine {
        log("mNumActive: " + callState.mNumActive + " mNumHeld: " +
            callState.mNumHeld +" mCallState: " + callState.mCallState);
        log("mNumber: " + callState.mNumber + " mType: " + callState.mType);
        if(!isVirtualCall) {
            /* Not a Virtual call request. End the virtual call, if running,
            before sending phoneStateChangeNative to BTIF */

        if (isVirtualCall) {
            // virtual call state update
            if (getCurrentState() != mDisconnected) {
                phoneStateChangeNative(callState.mNumActive, callState.mNumHeld,
                    callState.mCallState, callState.mNumber, callState.mType);
            }
        } else {
            // circuit-switch voice call update
            // stop virtual voice call if there is a CSV call ongoing
            if (callState.mNumActive > 0 || callState.mNumHeld > 0
                    || callState.mCallState != HeadsetHalConstants.CALL_STATE_IDLE) {
                terminateScoUsingVirtualVoiceCall();
            }
            // at this step: if there is virtual call ongoing, it means there is no CSV call
            // let virtual call continue and skip phone state update
            if (!isVirtualCallInProgress()) {
                if (getCurrentState() != mDisconnected) {
                    phoneStateChangeNative(callState.mNumActive, callState.mNumHeld,
                        callState.mCallState, callState.mNumber, callState.mType);
                }
            }
        }
    }

    // 1 enable noice reduction
    // 0 disable noice reduction