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

Commit ff864719 authored by Anish Kumar's avatar Anish Kumar Committed by Vineeta Srivastava
Browse files

hal: fix the reference count for devices during speaker protection

In speaker protection voice call usecase AHAL has two
usecases (VI-RECORD and regular capture) but the
function (check_and_route_capture_usecases) enables and
disables the voice-speaker-mic wrongly as it doesn't see
that the record device is not speaker mic record but
rather vi-record. So it wrongly enables the speaker mic device
which causes mismatch in device reference count.

Change-Id: I981b2e446b4efe4679e21ed5113217dff9ec2a0f
parent 7631557c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -439,7 +439,8 @@ static void check_and_route_capture_usecases(struct audio_device *adev,
        usecase = node_to_item(node, struct audio_usecase, list);
        if (usecase->type != PCM_PLAYBACK &&
                usecase != uc_info &&
                usecase->in_snd_device != snd_device) {
                usecase->in_snd_device != snd_device &&
                (usecase->id != USECASE_AUDIO_SPKR_CALIB_TX)) {
            ALOGV("%s: Usecase (%s) is active on (%s) - disabling ..",
                  __func__, use_case_table[usecase->id],
                  platform_get_snd_device_name(usecase->in_snd_device));