1 /*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #ifndef LOG_TAG
17 #define LOG_TAG "AudioManagerUtil"
18 #endif
19
20 #include "audio_device_info.h"
21
22 namespace OHOS {
23 namespace AudioStandard {
GetSupportedDeviceType()24 const std::unordered_map<DeviceType, std::string> &GetSupportedDeviceType()
25 {
26 static const std::unordered_map<DeviceType, std::string> supportedDevicetype = {
27 {DEVICE_TYPE_NONE, "DEVICE_TYPE_NONE"},
28 {DEVICE_TYPE_INVALID, "DEVICE_TYPE_INVALID"},
29 {DEVICE_TYPE_EARPIECE, "DEVICE_TYPE_EARPIECE"},
30 {DEVICE_TYPE_SPEAKER, "DEVICE_TYPE_SPEAKER"},
31 {DEVICE_TYPE_WIRED_HEADSET, "DEVICE_TYPE_WIRED_HEADSET"},
32 {DEVICE_TYPE_WIRED_HEADPHONES, "DEVICE_TYPE_WIRED_HEADPHONES"},
33 {DEVICE_TYPE_BLUETOOTH_SCO, "DEVICE_TYPE_BLUETOOTH_SCO"},
34 {DEVICE_TYPE_BLUETOOTH_A2DP, "DEVICE_TYPE_BLUETOOTH_A2DP"},
35 {DEVICE_TYPE_BLUETOOTH_A2DP_IN, "DEVICE_TYPE_BLUETOOTH_A2DP_IN"},
36 {DEVICE_TYPE_MIC, "DEVICE_TYPE_MIC"},
37 {DEVICE_TYPE_WAKEUP, "DEVICE_TYPE_WAKEUP"},
38 {DEVICE_TYPE_USB_HEADSET, "DEVICE_TYPE_USB_HEADSET"},
39 {DEVICE_TYPE_USB_ARM_HEADSET, "DEVICE_TYPE_USB_ARM_HEADSET"},
40 {DEVICE_TYPE_DP, "DEVICE_TYPE_DP"},
41 {DEVICE_TYPE_FILE_SINK, "DEVICE_TYPE_FILE_SINK"},
42 {DEVICE_TYPE_FILE_SOURCE, "DEVICE_TYPE_FILE_SOURCE"},
43 {DEVICE_TYPE_EXTERN_CABLE, "DEVICE_TYPE_EXTERN_CABLE"},
44 {DEVICE_TYPE_DEFAULT, "DEVICE_TYPE_DEFAULT"},
45 };
46 return supportedDevicetype;
47 }
48 } // namespace AudioStandard
49 } // namespace OHOS