Add support to get registered policy mixes
This new (Test)Api exposes all AudioMixes registered with AudioPolicyManager.
The TestApi is very useful in verifying AudioMix/AudioPolicy behavior in
the Java and Native layer to debug and assert the correct behavior.
Bug: 309080867
Test: atest AudioHostTest
Change-Id: Icdc2a482228ab06ac7386915ddbeb0cfcc24889d
diff --git a/services/audiopolicy/service/AudioPolicyService.cpp b/services/audiopolicy/service/AudioPolicyService.cpp
index aed6458..bc6498a 100644
--- a/services/audiopolicy/service/AudioPolicyService.cpp
+++ b/services/audiopolicy/service/AudioPolicyService.cpp
@@ -166,7 +166,8 @@
BINDER_METHOD_ENTRY(setPreferredMixerAttributes) \
BINDER_METHOD_ENTRY(getPreferredMixerAttributes) \
BINDER_METHOD_ENTRY(clearPreferredMixerAttributes) \
-
+BINDER_METHOD_ENTRY(getRegisteredPolicyMixes) \
+ \
// singleton for Binder Method Statistics for IAudioPolicyService
static auto& getIAudioPolicyServiceStatistics() {
using Code = int;
@@ -1348,7 +1349,8 @@
case TRANSACTION_getDevicesForRoleAndCapturePreset:
case TRANSACTION_getSpatializer:
case TRANSACTION_setPreferredMixerAttributes:
- case TRANSACTION_clearPreferredMixerAttributes: {
+ case TRANSACTION_clearPreferredMixerAttributes:
+ case TRANSACTION_getRegisteredPolicyMixes: {
if (!isServiceUid(IPCThreadState::self()->getCallingUid())) {
ALOGW("%s: transaction %d received from PID %d unauthorized UID %d",
__func__, code, IPCThreadState::self()->getCallingPid(),