audiopolicy: Fix after commit 11d301045991dd66bf3f64ba510e069b7c09fedb
The change ag/5874343 switched to DeviceVector usage instead of
audio_devices_t. In AudioPolicyManager::setOutputDevices, one of
the conditions comparing a device to AUDIO_DEVICE_NONE had been
inverted.
This was resulting in resetting of default patches during
a call to 'setForceUse' function.
Test: audiopolicy_tests
Change-Id: Idc43bc152c3d749cd1dab9b696e7e1e700ef3926
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index cc151e7..e6dc9a7 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -5319,7 +5319,7 @@
// AND force is not specified
// AND the output is connected by a valid audio patch.
// Doing this check here allows the caller to call setOutputDevices() without conditions
- if ((!filteredDevices.isEmpty() || filteredDevices == prevDevices) &&
+ if ((filteredDevices.isEmpty() || filteredDevices == prevDevices) &&
!force && outputDesc->getPatchHandle() != 0) {
ALOGV("%s setting same device %s or null device, force=%d, patch handle=%d", __func__,
filteredDevices.toString().c_str(), force, outputDesc->getPatchHandle());