blob: 9771374c3377729caecc60bb856806dc6cdaedbb [file] [log] [blame]
Kevin Rocard96d2cd92018-11-14 16:22:07 -08001/*
2 * Copyright (C) 2018 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 ANDROID_HARDWARE_AUDIO_EFFECT_VERSION_UTILS_H
18#define ANDROID_HARDWARE_AUDIO_EFFECT_VERSION_UTILS_H
19
Mikhail Naganov7d015382022-01-15 01:15:12 +000020// A workaround for b/216149583 (vendor code having its own copy of VersionMacro.h)
21#ifndef COMMON_TYPES_MINOR_VERSION
22#define COMMON_TYPES_MINOR_VERSION MINOR_VERSION
23#endif
24#ifndef CORE_TYPES_MINOR_VERSION
25#define CORE_TYPES_MINOR_VERSION MINOR_VERSION
26#endif
27#ifndef COMMON_TYPES_FILE_VERSION
28#define COMMON_TYPES_FILE_VERSION EXPAND_CONCAT_3(MAJOR_VERSION, ., COMMON_TYPES_MINOR_VERSION)
29#endif
30#ifndef CORE_TYPES_FILE_VERSION
31#define CORE_TYPES_FILE_VERSION EXPAND_CONCAT_3(MAJOR_VERSION, ., CORE_TYPES_MINOR_VERSION)
32#endif
33#ifndef COMMON_TYPES_CPP_VERSION
34#define COMMON_TYPES_CPP_VERSION EXPAND_CONCAT_4(V, MAJOR_VERSION, _, COMMON_TYPES_MINOR_VERSION)
35#endif
36#ifndef CORE_TYPES_CPP_VERSION
37#define CORE_TYPES_CPP_VERSION EXPAND_CONCAT_4(V, MAJOR_VERSION, _, CORE_TYPES_MINOR_VERSION)
38#endif
39// End of workaround
40
41// clang-format off
42#include PATH(android/hardware/audio/common/COMMON_TYPES_FILE_VERSION/types.h)
43// clang-format on
Kevin Rocard96d2cd92018-11-14 16:22:07 -080044
45namespace android {
46namespace hardware {
47namespace audio {
48namespace common {
49namespace CPP_VERSION {
50namespace implementation {
51
52#if MAJOR_VERSION == 2
53typedef common::CPP_VERSION::AudioDevice AudioDeviceBitfield;
54typedef common::CPP_VERSION::AudioChannelMask AudioChannelBitfield;
55typedef common::CPP_VERSION::AudioOutputFlag AudioOutputFlagBitfield;
56typedef common::CPP_VERSION::AudioInputFlag AudioInputFlagBitfield;
Mikhail Naganov648ec5b2020-09-24 18:00:44 +000057#elif MAJOR_VERSION >= 4 && MAJOR_VERSION <= 6
Kevin Rocard96d2cd92018-11-14 16:22:07 -080058typedef hidl_bitfield<common::CPP_VERSION::AudioDevice> AudioDeviceBitfield;
59typedef hidl_bitfield<common::CPP_VERSION::AudioChannelMask> AudioChannelBitfield;
60typedef hidl_bitfield<common::CPP_VERSION::AudioOutputFlag> AudioOutputFlagBitfield;
61typedef hidl_bitfield<common::CPP_VERSION::AudioInputFlag> AudioInputFlagBitfield;
62#endif
63
64} // namespace implementation
65} // namespace CPP_VERSION
66} // namespace common
67} // namespace audio
68} // namespace hardware
69} // namespace android
70
71#endif // ANDROID_HARDWARE_AUDIO_EFFECT_VERSION_UTILS_H