1 /* 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 24 namespace android { 25 namespace hardware { 26 namespace audiocontrol { 27 namespace testutils { 28 29 std::string toAlphaNumeric(const std::string& info); 30 31 bool getAudioPortDeviceDescriptor( 32 const android::media::audio::common::AudioPort& audioPort, 33 android::media::audio::common::AudioDeviceDescription& description); 34 35 bool getAddressForAudioPort(const android::media::audio::common::AudioPort& audioPort, 36 std::string& address); 37 38 bool getAddressForAudioDevice( 39 const android::hardware::automotive::audiocontrol::DeviceToContextEntry& device, 40 std::string& address); 41 42 std::vector<std::string> getDeviceAddressesForVolumeGroup( 43 const android::hardware::automotive::audiocontrol::VolumeGroupConfig& config); 44 45 std::vector<std::string> getDeviceAddressesForZoneConfig( 46 const android::hardware::automotive::audiocontrol::AudioZoneConfig& config); 47 48 std::vector<std::string> getDeviceAddressesForZone( 49 const android::hardware::automotive::audiocontrol::AudioZone& config); 50 51 bool contextInfosContainAllAudioAttributeUsages( 52 const std::vector<android::hardware::automotive::audiocontrol::AudioZoneContextInfo>& infos, 53 std::string& message); 54 55 bool contextContainsAllAudioAttributeUsages( 56 const android::hardware::automotive::audiocontrol::AudioZoneContext& context, 57 std::string& message); 58 59 std::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 68