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

Commit a3c98d8c authored by Devin Kim's avatar Devin Kim Committed by Martin Brabham
Browse files

Fix the double PCM open during HFP call

If the second call is receving during a HFP call, audio path may change
to deep-buffer for ringtone playback intermediately and then come
back to HFP. So in this case, just keep the previsous opened PCM instead
of re-opening the PCM.

Bug: 66324788
Change-Id: I37666dac2602dc6d9d57a7fedc5a33f04890c1b5
(cherry picked from commit 74ab78e8356119b01f5d23d82221d8e2d5c9b3ac)
parent 787b2f57
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -438,10 +438,17 @@ void audio_extn_hfp_set_parameters(struct audio_device *adev, struct str_parms *
    ret = str_parms_get_str(parms, AUDIO_PARAMETER_HFP_ENABLE, value,
                            sizeof(value));
    if (ret >= 0) {
           if (!strncmp(value,"true",sizeof(value)))
               ret = start_hfp(adev,parms);
           if (!strncmp(value,"true",sizeof(value))) {
               if (!hfpmod.is_hfp_running)
                   start_hfp(adev,parms);
               else
                   ALOGW("%s: HFP is already active.", __func__);
           } else {
               if (hfpmod.is_hfp_running)
                   stop_hfp(adev);
               else
                   ALOGW("%s: ignore STOP, HFC not active", __func__);
           }
    }
    memset(value, 0, sizeof(value));
    ret = str_parms_get_str(parms,AUDIO_PARAMETER_HFP_SET_SAMPLING_RATE, value,