Revert "AudioPolicyManager: fix closure of output supporting more than on device"
This reverts commit d7a5f2de9dd87eb1c4558331e838ee58432b8af2.
It introduced a regression on patch / port id alignement between
java and native layer.
The patch involving the output was neither deleted nor recreated.
It still involves a device port id that was disconnected, thus does
not exist anymore.
Java side layer will not identify this port (match on id).
The resolution of the issue (particurily for the primary output, since
it may be removed and not assigned until one or more device reachable
by the primary is reconnected) shall reconsider the output (either closing
or rerouting) rather than keeping it blindly.
Signed-off-by: Francois Gaffie <francois.gaffie@renault.com>
Change-Id: I39e2346b9205df4ca3804ea00b7ea05117e13b52
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 0462727..00ca1f1 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -5218,8 +5218,7 @@
if (!desc->isDuplicated()) {
// exact match on device
if (device_distinguishes_on_address(deviceType) && desc->supportsDevice(device)
- && desc->containsSingleDeviceSupportingEncodedFormats(device)
- && !mAvailableOutputDevices.containsAtLeastOne(desc->supportedDevices())) {
+ && desc->containsSingleDeviceSupportingEncodedFormats(device)) {
outputs.add(mOutputs.keyAt(i));
} else if (!mAvailableOutputDevices.containsAtLeastOne(desc->supportedDevices())) {
ALOGV("checkOutputsForDevice(): disconnecting adding output %d",