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

Commit d13d573c authored by Sanket Agarwal's avatar Sanket Agarwal Committed by Gerrit Code Review
Browse files

Merge "Disable HFP audio path when HFP call goes on hold/resume when goes off hold"

parents 676347dd 849169b3
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -598,6 +598,14 @@ final class HeadsetClientStateMachine extends StateMachine {
                return;
        }

        if (flag == BluetoothHeadsetClient.CALL_ACCEPT_HOLD) {
            // HFP is disabled when a call is put on hold to ensure correct audio routing for
            // cellular calls accepted while an HFP call is in progress. Reenable HFP when the HFP
            // call is put off hold.
            Log.d(TAG,"hfp_enable=true");
            mAudioManager.setParameters("hfp_enable=true");
        }

        if (handleCallActionNative(action, 0)) {
            addQueuedAction(ACCEPT_CALL, action);
        } else {
@@ -671,6 +679,11 @@ final class HeadsetClientStateMachine extends StateMachine {
            action = HeadsetClientHalConstants.CALL_ACTION_CHLD_2;
        }

        // Set HFP enable to false in case the call is being held to accept a cellular call. This
        // allows the cellular call's audio to be correctly routed.
        Log.d(TAG,"hfp_enable=false");
        mAudioManager.setParameters("hfp_enable=false");

        if (handleCallActionNative(action, 0)) {
            addQueuedAction(HOLD_CALL, action);
        } else {