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

Commit 932a6bfe authored by Sanket Agarwal's avatar Sanket Agarwal Committed by android-build-merger
Browse files

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

am: 8d3d9aa5

Change-Id: I358a75c0b793d81c56107094f46cea37c07185a4
parents ca6f51bf 8d3d9aa5
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 {