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

Commit 68edbbd1 authored by Christine Hallstrom's avatar Christine Hallstrom
Browse files

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

This fixes the issue where a cellular call made to a watch when an
HFP call is in progress causes the cellular audio to go through the
HFP path.

Bug: 32164561
Change-Id: I179ba4e1f1a1e76496f3062cc29bc20014fe5661
parent 9d54dc77
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -993,6 +993,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 {
@@ -1056,6 +1064,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 {