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

Commit d13fc624 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: restore device for other active usecases when VOICE stopped"

parents 1c867dc1 dc4af9d0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -7751,6 +7751,7 @@ static int adev_set_mode(struct audio_hw_device *dev, audio_mode_t mode)
    struct listnode *node;
    struct audio_usecase *usecase = NULL;
    int ret = 0;

    pthread_mutex_lock(&adev->lock);
    if (adev->mode != mode) {
        ALOGD("%s: mode %d\n", __func__, mode);
@@ -7777,6 +7778,11 @@ static int adev_set_mode(struct audio_hw_device *dev, audio_mode_t mode)
            voice_stop_call(adev);
            platform_set_gsm_mode(adev->platform, false);
            adev->current_call_output = NULL;
            // restore device for other active usecases after stop call
            list_for_each(node, &adev->usecase_list) {
                usecase = node_to_item(node, struct audio_usecase, list);
                select_devices(adev, usecase->id);
            }
        }
    }
    pthread_mutex_unlock(&adev->lock);