hal: restore device for other active usecases when VOICE stopped
During record and VOICE both are active scenario, there is no
device restore for recording usecase after closing voice call.
Therefore, recording input device still use voice device even
if voice is not active.
Fix this by updating proper device for other active usecase when
voice is closed.
CRs-Fixed: 2041312
Change-Id: I300c2fdb4379cc784cef58bca52d8f138ad7a551
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 99c291c..e03d40c 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -7032,6 +7032,7 @@
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);
@@ -7058,6 +7059,11 @@
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);