From fc35ca3d3267a3a0e334626fbcf09e1c2e4df1d8 Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Mon, 2 Oct 2023 17:08:12 -0700 Subject: [PATCH] audio: Use hardcoded r_submix configuration with XML There are several reasons why parsing the canonical XML configuration for the remote submix module will not work correctly (see the commend in the code). Since de facto all vendors use the canonical configuration XML for the remote submix, substitute parsing it with a correct hardcoded version. Bug: 205884982 Test: atest VtsHalAudioCoreTargetTest (cherry picked from commit ea604d50deded0a83490643f83f9bd5d2ea40660) Change-Id: Ib9d9da25d315ff4ce36c1870241fb61d95fcca88 --- audio/aidl/default/AudioPolicyConfigXmlConverter.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/audio/aidl/default/AudioPolicyConfigXmlConverter.cpp b/audio/aidl/default/AudioPolicyConfigXmlConverter.cpp index 5d06cb607c..2f1282a306 100644 --- a/audio/aidl/default/AudioPolicyConfigXmlConverter.cpp +++ b/audio/aidl/default/AudioPolicyConfigXmlConverter.cpp @@ -184,9 +184,15 @@ void AudioPolicyConfigXmlConverter::init() { // 'primary' in the XML schema used by HIDL is equivalent to 'default' module. const std::string name = xsdcModule.getName() != "primary" ? xsdcModule.getName() : "default"; - mModuleConfigurations->emplace_back( - name, VALUE_OR_FATAL(convertModuleConfigToAidl(xsdcModule))); + if (name != "r_submix") { + mModuleConfigurations->emplace_back( + name, VALUE_OR_FATAL(convertModuleConfigToAidl(xsdcModule))); + } else { + // See the note on the 'getRSubmixConfiguration' function. + mModuleConfigurations->emplace_back(name, nullptr); + } } } } + } // namespace aidl::android::hardware::audio::core::internal