blob: 46fdce21117894308378345e20242c57f08cd193 [file] [log] [blame]
Oscar Azucena7fc9c4c2024-10-18 20:25:46 -07001/*
2 * Copyright (C) 2024 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef MAIN8_AUDIOCONTROLTESTUTILS_H
18#define MAIN8_AUDIOCONTROLTESTUTILS_H
19
20#include <android/hardware/automotive/audiocontrol/IAudioControl.h>
21#include <string>
22#include <vector>
23
24namespace android {
25namespace hardware {
26namespace audiocontrol {
27namespace testutils {
28
29std::string toAlphaNumeric(const std::string& info);
30
31bool getAudioPortDeviceDescriptor(
32 const android::media::audio::common::AudioPort& audioPort,
33 android::media::audio::common::AudioDeviceDescription& description);
34
35bool getAddressForAudioPort(const android::media::audio::common::AudioPort& audioPort,
36 std::string& address);
37
38bool getAddressForAudioDevice(
39 const android::hardware::automotive::audiocontrol::DeviceToContextEntry& device,
40 std::string& address);
41
42std::vector<std::string> getDeviceAddressesForVolumeGroup(
43 const android::hardware::automotive::audiocontrol::VolumeGroupConfig& config);
44
45std::vector<std::string> getDeviceAddressesForZoneConfig(
46 const android::hardware::automotive::audiocontrol::AudioZoneConfig& config);
47
48std::vector<std::string> getDeviceAddressesForZone(
49 const android::hardware::automotive::audiocontrol::AudioZone& config);
50
51bool contextInfosContainAllAudioAttributeUsages(
52 const std::vector<android::hardware::automotive::audiocontrol::AudioZoneContextInfo>& infos,
53 std::string& message);
54
55bool contextContainsAllAudioAttributeUsages(
56 const android::hardware::automotive::audiocontrol::AudioZoneContext& context,
57 std::string& message);
58
59std::vector<std::string> getContextInfoNamesForVolumeGroup(
60 const android::hardware::automotive::audiocontrol::VolumeGroupConfig& group);
61
62} // namespace testutils
63} // namespace audiocontrol
64} // namespace hardware
65} // namespace android
66
67#endif // MAIN8_AUDIOCONTROLTESTUTILS_H