audio policy: return input source updates to audio flinger
Make sure the input source updated by getInputForAttr() is also used by
audio flinger for consistency of source metadata forwarded to the audio HAL.
Bug: 363831992
Test: atest audiopolicymanager_test
Flag: EXEMPT bug fix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:0064ac30d8437d19eb69f828ce2e8809c122dc13)
Merged-In: I4d59d271deab5c1f4b06dc1c5642c1135a487132
Change-Id: I4d59d271deab5c1f4b06dc1c5642c1135a487132
diff --git a/media/libaudioclient/AudioSystem.cpp b/media/libaudioclient/AudioSystem.cpp
index c675c34..1430913 100644
--- a/media/libaudioclient/AudioSystem.cpp
+++ b/media/libaudioclient/AudioSystem.cpp
@@ -1399,7 +1399,8 @@
audio_config_base_t* config,
audio_input_flags_t flags,
audio_port_handle_t* selectedDeviceId,
- audio_port_handle_t* portId) {
+ audio_port_handle_t* portId,
+ audio_source_t* source) {
if (attr == NULL) {
ALOGE("getInputForAttr NULL attr - shouldn't happen");
return BAD_VALUE;
@@ -1447,7 +1448,7 @@
*selectedDeviceId = VALUE_OR_RETURN_STATUS(
aidl2legacy_int32_t_audio_port_handle_t(response.selectedDeviceId));
*portId = VALUE_OR_RETURN_STATUS(aidl2legacy_int32_t_audio_port_handle_t(response.portId));
-
+ *source = VALUE_OR_RETURN_STATUS(aidl2legacy_AudioSource_audio_source_t(response.source));
return OK;
}