Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7fc9c4c8 authored by Oscar Azucena's avatar Oscar Azucena
Browse files

Add audio control configuraiton APIs VTS

Bug: 359686069
Test: atest VtsAidlHalAudioControlTest
Flag: EXEMPT HAL interface
Change-Id: I9fcaaae15dc9049567587ce1fefd4ff1caa71ef1
parent 2bf55fb6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
<manifest version="2.0" type="device">
    <hal format="aidl">
        <name>android.hardware.automotive.audiocontrol</name>
        <version>4</version>
        <version>5</version>
        <fqname>IAudioControl/default</fqname>
    </hal>
</manifest>
+21 −0
Original line number Diff line number Diff line
@@ -22,6 +22,25 @@ package {
    default_applicable_licenses: ["hardware_interfaces_license"],
}

cc_library {
    name: "AudioControlHalTestUtils",
    srcs: [
        "src/AudioControlTestUtils.cpp",
    ],
    export_include_dirs: [
        "include",
    ],
    defaults: [
        "latest_android_hardware_audio_common_cpp_static",
        "latest_android_hardware_automotive_audiocontrol_cpp_static",
        "latest_android_media_audio_common_types_cpp_static",
    ],
    shared_libs: [
        "libbase",
        "libutils",
    ],
}

cc_test {
    name: "VtsAidlHalAudioControlTest",
    defaults: [
@@ -39,9 +58,11 @@ cc_test {
        "libbinder",
        "libbase",
        "libxml2",
        "libutils",
    ],
    static_libs: [
        "libgmock",
        "AudioControlHalTestUtils",
    ],
    test_suites: [
        "general-tests",
+415 −0

File changed.

Preview size limit exceeded, changes collapsed.

+67 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 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.
 */

#ifndef MAIN8_AUDIOCONTROLTESTUTILS_H
#define MAIN8_AUDIOCONTROLTESTUTILS_H

#include <android/hardware/automotive/audiocontrol/IAudioControl.h>
#include <string>
#include <vector>

namespace android {
namespace hardware {
namespace audiocontrol {
namespace testutils {

std::string toAlphaNumeric(const std::string& info);

bool getAudioPortDeviceDescriptor(
        const android::media::audio::common::AudioPort& audioPort,
        android::media::audio::common::AudioDeviceDescription& description);

bool getAddressForAudioPort(const android::media::audio::common::AudioPort& audioPort,
                            std::string& address);

bool getAddressForAudioDevice(
        const android::hardware::automotive::audiocontrol::DeviceToContextEntry& device,
        std::string& address);

std::vector<std::string> getDeviceAddressesForVolumeGroup(
        const android::hardware::automotive::audiocontrol::VolumeGroupConfig& config);

std::vector<std::string> getDeviceAddressesForZoneConfig(
        const android::hardware::automotive::audiocontrol::AudioZoneConfig& config);

std::vector<std::string> getDeviceAddressesForZone(
        const android::hardware::automotive::audiocontrol::AudioZone& config);

bool contextInfosContainAllAudioAttributeUsages(
        const std::vector<android::hardware::automotive::audiocontrol::AudioZoneContextInfo>& infos,
        std::string& message);

bool contextContainsAllAudioAttributeUsages(
        const android::hardware::automotive::audiocontrol::AudioZoneContext& context,
        std::string& message);

std::vector<std::string> getContextInfoNamesForVolumeGroup(
        const android::hardware::automotive::audiocontrol::VolumeGroupConfig& group);

}  // namespace testutils
}  // namespace audiocontrol
}  // namespace hardware
}  // namespace android

#endif  // MAIN8_AUDIOCONTROLTESTUTILS_H
+203 −0

File added.

Preview size limit exceeded, changes collapsed.