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

Commit 52ccaf97 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: avoid audio rerouting to different device when hfp is active"

parents 6528137d 8fa9eab9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -188,4 +188,10 @@ void audio_extn_dolby_send_ddp_endp_params(struct audio_device *adev);
bool audio_extn_hfp_is_active(struct audio_device *adev);
#endif

#ifndef HFP_ENABLED
#define audio_extn_hfp_is_active(adev)                  (0)
#else
bool audio_extn_hfp_is_active(struct audio_device *adev);
#endif

#endif /* AUDIO_EXTN_H */
+6 −0
Original line number Diff line number Diff line
@@ -662,6 +662,12 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id)
                   in_snd_device = hfp_usecase->in_snd_device;
                   out_snd_device = hfp_usecase->out_snd_device;
            }
        } else if (audio_extn_hfp_is_active(adev)) {
            hfp_usecase = get_usecase_from_list(adev, USECASE_AUDIO_HFP_SCO);
            if (hfp_usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND) {
                   in_snd_device = hfp_usecase->in_snd_device;
                   out_snd_device = hfp_usecase->out_snd_device;
            }
        }
        if (usecase->type == PCM_PLAYBACK) {
            usecase->devices = usecase->stream.out->devices;