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

Commit dbcddf24 authored by Alexy Joseph's avatar Alexy Joseph Committed by Gerrit - the friendly Code Review server
Browse files

hal: Fix voice call usecase de-referencing

Fix referencing of voice call use case only
when the use case is relevant

CRs-Fixed: 1017180
Change-Id: I29ebfd75c8953ff3d464bdb8d7ff7b77cf2cbdf6
parent 9a7292d4
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1037,9 +1037,9 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id)
        if (voice_is_in_call(adev) && adev->mode != AUDIO_MODE_NORMAL) {
            vc_usecase = get_usecase_from_list(adev,
                                               get_usecase_id_from_usecase_type(adev, VOICE_CALL));
            if (((vc_usecase) && ((vc_usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND) &&
                                 (usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND))) ||
                                (usecase->devices == AUDIO_DEVICE_IN_VOICE_CALL)) {
            if ((vc_usecase) && (((vc_usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND) &&
                                 (usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND)) ||
                                (usecase->devices == AUDIO_DEVICE_IN_VOICE_CALL))) {
                in_snd_device = vc_usecase->in_snd_device;
                out_snd_device = vc_usecase->out_snd_device;
            }