audio: fix AEC/NS effect control
Android Q supports concurrent capture and will
create more than one AEC/NS effects if app creates
over 1 voice record tracks.
Refine the AEC/NS control to support mutilple
AEC/NS effects.
Also correct the voice-call stream type in STHAL.
Bug: 129111371
Bug: 128456220
Test: manual
Change-Id: Icd0863f54e17cd6a5ee765f9bb5fe1b4580743a4
Signed-off-by: Carter Hsu <carterhsu@google.com>
diff --git a/hal/audio_extn/soundtrigger.c b/hal/audio_extn/soundtrigger.c
index 063a7ba..b635777 100644
--- a/hal/audio_extn/soundtrigger.c
+++ b/hal/audio_extn/soundtrigger.c
@@ -422,7 +422,7 @@
if (valid_type && platform_sound_trigger_usecase_needs_event(uc_info->id)) {
ALOGV("%s: uc_id %d of type %d for Event %d, with Raise=%d",
__func__, uc_info->id, uc_info->type, event, raise_event);
- if (uc_info->type == PCM_CAPTURE) {
+ if (uc_info->type == PCM_CAPTURE || uc_info->type == VOICE_CALL) {
ev = (event == ST_EVENT_STREAM_BUSY) ? AUDIO_EVENT_CAPTURE_STREAM_ACTIVE :
AUDIO_EVENT_CAPTURE_STREAM_INACTIVE;
} else {