audio policy: fix mmap behavior on device disconnection
Commit 8e70cf81 changed the behavior od an AAudio MMAP stream when
playing over built-in speaker and a wired headset is connected.
This change restores previous behavior while preserving the fix for
b/345044066.
Bug: 345044066
Bug: 338143144
Bug: 349622795
Flag: EXEMPT bug fix
Test: Oboe Tester TEST DISCONNECT
Change-Id: I905585b718c298b0dabefacff4f667f7e4981572
diff --git a/services/audiopolicy/common/managerdefinitions/include/AudioIODescriptorInterface.h b/services/audiopolicy/common/managerdefinitions/include/AudioIODescriptorInterface.h
index 3edd4de..e519766 100644
--- a/services/audiopolicy/common/managerdefinitions/include/AudioIODescriptorInterface.h
+++ b/services/audiopolicy/common/managerdefinitions/include/AudioIODescriptorInterface.h
@@ -53,7 +53,7 @@
// a preferred device in which case the first client drives the selection.
if (desc->isMmap()) {
auto matchingClients = desc->clientsList(
- false /*activeOnly*/, filter, true /*preferredDevice*/);
+ false /*activeOnly*/, filter, false /*preferredDevice*/);
if (matchingClients.empty()) {
return nullptr;
}