Fix direct/offload thread output devices into MSD
Without this change, direct/offload threads show
"Output devices: (Empty device types)". Empty device
causes timestamp correction to always be disabled for
output threads requiring timestamp correction.
Test: check direct/offload output into MSD dumpsys output devices
atest audiopolicy_tests
Bug: 159948389
Change-Id: I7006c9da2f0a228dd49ce0297c30035fef983090
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 67e085c..d51053b 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -5266,6 +5266,12 @@
}
}
+ // Do not retrieve engine device for outputs through MSD
+ // TODO: support explicit routing requests by resetting MSD patch to engine device.
+ if (outputDesc->devices() == getMsdAudioOutDevices()) {
+ return outputDesc->devices();
+ }
+
// Honor explicit routing requests only if no client using default routing is active on this
// input: a specific app can not force routing for other apps by setting a preferred device.
bool active; // unused