mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-02 10:05:19 +00:00
The XML audio policy configuration is expected to be located in /vendor. Additionally for AOSP builds (no vendor) and as a fallback in case of missing vendor configuration, the system supports loading the XML from /system. This fallback config is not guaranty to be compatible with the phone HAL, but probably does for a wide range of android phones (at least for basic use cases). In each of those cases, there is only one configuration file, either in /vendor or /system. As a result, the audio policy configuration VTS test was asserting that only one audio_policy_configuration.xml could be found. If multiple were found, one was useless and the platform integrator should remove it. But VTS are now run on phone with a /system partition from an AOSP build and a /vendor partition from a device build. In such scenario two audio policy config are now present on the device, thus breaking the VTS expectation. This is not a problem for the framework because it does not look for a /system config if one was found in /vendor. In the future, the /system XML might be removed as boards specific config should be found in /vendor only as per treble requirements. Test: Compile Bug: 65482614 Change-Id: I7cd7eb7284c0aa52782aa591411f8a9bf2a87a76 Signed-off-by: Kevin Rocard <krocard@google.com>
34 lines
1.2 KiB
C++
34 lines
1.2 KiB
C++
/*
|
|
* Copyright (C) 2017 The Android Open Source Project
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
#include <string>
|
|
#include <unistd.h>
|
|
|
|
#include "utility/ValidateXml.h"
|
|
|
|
TEST(CheckConfig, audioPolicyConfigurationValidation) {
|
|
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);
|
|
}
|
|
}
|
|
}
|