hal: Update active input stream when voip input is closed
In recording and VoIP both active scenario, when voip input
is closed, active input stream would set to NULL. Therefore,
as active input stream is NULL, audio recording input device
is wrong to select after closing voip call.
Fix this by updating proper active input stream when voip input
is closed.
CRs-Fixed: 2035512
Change-Id: Ie8be5d6d9de65249122de497d8689ad4c78698e5
diff --git a/hal/audio_hw.h b/hal/audio_hw.h
index 8f2ac98..28ae060 100644
--- a/hal/audio_hw.h
+++ b/hal/audio_hw.h
@@ -446,6 +446,8 @@
struct audio_usecase *get_usecase_from_list(const struct audio_device *adev,
audio_usecase_t uc_id);
+struct stream_in *get_next_active_input(const struct audio_device *adev);
+
bool is_offload_usecase(audio_usecase_t uc_id);
bool audio_is_true_native_stream_active(struct audio_device *adev);
diff --git a/hal/voice_extn/compress_voip.c b/hal/voice_extn/compress_voip.c
index e89d4ac..f23ff5b 100644
--- a/hal/voice_extn/compress_voip.c
+++ b/hal/voice_extn/compress_voip.c
@@ -631,9 +631,9 @@
ALOGD("%s: enter", __func__);
if(voip_data.in_stream_count > 0) {
- adev->active_input = NULL;
voip_data.in_stream_count--;
status = voip_stop_call(adev);
+ adev->active_input = get_next_active_input(adev);
in->pcm = NULL;
}