Reopen output when routing changed for preferred mixer.
When output stream is open with preferred mixer attributes, it should
apply to the targeted device. In that case, when the routed device is
changed, close the output with preferred mixer attributes and reopen
with default configuration.
Bug: 239435816
Test: set preferred mixer attr, connect and disconnect BT while playing
over USB device.
Test: atest audiopolicy_tests
Change-Id: I982c47d9786ae56314f7c8ba8c1361cd2c2e9f42
diff --git a/services/audiopolicy/tests/AudioPolicyManagerTestClient.h b/services/audiopolicy/tests/AudioPolicyManagerTestClient.h
index 2a65546..6eca7cc 100644
--- a/services/audiopolicy/tests/AudioPolicyManagerTestClient.h
+++ b/services/audiopolicy/tests/AudioPolicyManagerTestClient.h
@@ -189,7 +189,7 @@
mAudioParameters.addInt(String8(AudioParameter::keyStreamSupportedSamplingRates), 48000);
std::string channelMasks;
for (const auto& cm : mSupportedChannelMasks) {
- if (audio_channel_mask_is_valid(cm)) {
+ if (!audio_channel_mask_is_valid(cm)) {
continue;
}
if (!channelMasks.empty()) channelMasks += AUDIO_PARAMETER_VALUE_LIST_SEPARATOR;