diff options
Diffstat (limited to 'audio')
-rw-r--r-- | audio/2.0/config/audio_policy_configuration.xsd | 8 | ||||
-rw-r--r-- | audio/2.0/vts/functional/ValidateAudioConfiguration.cpp | 16 |
2 files changed, 18 insertions, 6 deletions
diff --git a/audio/2.0/config/audio_policy_configuration.xsd b/audio/2.0/config/audio_policy_configuration.xsd index c94da80bfa..eb59152c91 100644 --- a/audio/2.0/config/audio_policy_configuration.xsd +++ b/audio/2.0/config/audio_policy_configuration.xsd @@ -365,10 +365,10 @@ </xs:restriction> </xs:simpleType> <xs:complexType name="profile"> - <xs:attribute name="name" type="xs:token" use="required"/> - <xs:attribute name="format" type="audioFormat" use="required"/> - <xs:attribute name="samplingRates" type="samplingRates" use="required"/> - <xs:attribute name="channelMasks" type="channelMask" use="required"/> + <xs:attribute name="name" type="xs:token" use="optional"/> + <xs:attribute name="format" type="audioFormat" use="optional"/> + <xs:attribute name="samplingRates" type="samplingRates" use="optional"/> + <xs:attribute name="channelMasks" type="channelMask" use="optional"/> </xs:complexType> <xs:simpleType name="gainMode"> <xs:restriction base="xs:string"> diff --git a/audio/2.0/vts/functional/ValidateAudioConfiguration.cpp b/audio/2.0/vts/functional/ValidateAudioConfiguration.cpp index 01324c87d3..ec3259a1e3 100644 --- a/audio/2.0/vts/functional/ValidateAudioConfiguration.cpp +++ b/audio/2.0/vts/functional/ValidateAudioConfiguration.cpp @@ -14,9 +14,21 @@ * limitations under the License. */ +#include <string> +#include <unistd.h> + #include "utility/ValidateXml.h" TEST(CheckConfig, audioPolicyConfigurationValidation) { - ASSERT_VALID_XML("/vendor/etc/audio_policy_configuration.xml", - "/data/local/tmp/audio_policy_configuration.xsd"); + const char* configName = "audio_policy_configuration.xml"; + const char* possibleConfigLocations[] = {"/odm/etc", "/vendor/etc", "/system/etc"}; + const char* configSchemaPath = "/data/local/tmp/audio_policy_configuration.xsd"; + + for (std::string folder : possibleConfigLocations) { + const auto configPath = folder + '/' + configName; + if (access(configPath.c_str(), R_OK) == 0) { + ASSERT_VALID_XML(configPath.c_str(), configSchemaPath); + return; // The framework does not read past the first config file found + } + } } |