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

Commit f175f673 authored by kunleiz's avatar kunleiz
Browse files

hal: add check for BT SCO status when start voice call

Before starting the voice call over BT SCO, BT SCO status
is checked, and if BT SCO status is true, APM set output
to BT SCO, but bt-sco disconnect then. Voice usecase would
start without enabling BT SCO back end, and failure happens
with setting in_call to true. Finally no sound issue happens
during bt-sco call, and voice call usecase also cannot start
even if APM set output to handset due to in_call is true already.

Fix by adding check for BT SCO status when staring voice
usecase to avoid voice call still route BT SCO even if BT
SCO has been disconnected, and reseting in_call flag when
voice start failure happens.

CRs-Fixed: 2107853
Change-Id: I7d9f05447e8c29d038a2ed49e9f3ed2a7994eb6c
parent cc6a6e60
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -221,6 +221,13 @@ int voice_start_usecase(struct audio_device *adev, audio_usecase_t usecase_id)
    uc_info->in_snd_device = SND_DEVICE_NONE;
    uc_info->in_snd_device = SND_DEVICE_NONE;
    uc_info->out_snd_device = SND_DEVICE_NONE;
    uc_info->out_snd_device = SND_DEVICE_NONE;


    if (audio_is_bluetooth_sco_device(uc_info->devices) && !adev->bt_sco_on) {
        ALOGE("start_call: couldn't find BT SCO, SCO is not ready");
        adev->voice.in_call = false;
        ret = -EIO;
        goto error_start_voice;
    }

    list_add_tail(&adev->usecase_list, &uc_info->list);
    list_add_tail(&adev->usecase_list, &uc_info->list);


    select_devices(adev, usecase_id);
    select_devices(adev, usecase_id);