add new audio sources for audio capture
This commit adds the following audio capture sources:
- AUDIO_SOURCE_VOICE_PERFORMANCE: for real time live performances like Karaoke.
- AUDIO_SOURCE_ECHO_REFERENCE: for capturing the reference signal to suppress by an echo
canceller. Protected by privileged permission CAPTURE_AUDIO_OUTPUT.
Also added device AUDIO_DEVICE_IN_ECHO_REFERENCE selected when the requested
capture source is AUDIO_SOURCE_ECHO_REFERENCE.
Bug: 118203066
Test: CTS tests for audio capture
Change-Id: Ieb159ea82a7b81acf762506a44e24ec80111609f
diff --git a/services/audiopolicy/engineconfigurable/src/InputSource.cpp b/services/audiopolicy/engineconfigurable/src/InputSource.cpp
index b9a38d4..d252d3f 100644
--- a/services/audiopolicy/engineconfigurable/src/InputSource.cpp
+++ b/services/audiopolicy/engineconfigurable/src/InputSource.cpp
@@ -25,7 +25,8 @@
status_t Element<audio_source_t>::setIdentifier(audio_source_t identifier)
{
- if (identifier > AUDIO_SOURCE_MAX && identifier != AUDIO_SOURCE_HOTWORD) {
+ if (identifier > AUDIO_SOURCE_MAX && identifier != AUDIO_SOURCE_HOTWORD
+ && identifier != AUDIO_SOURCE_FM_TUNER && identifier != AUDIO_SOURCE_ECHO_REFERENCE) {
return BAD_VALUE;
}
mIdentifier = identifier;