1 /*
2 * This file is auto-generated. DO NOT MODIFY.
3 * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation --structured --version 5 --hash notfrozen -t --stability vintf --min_sdk_version 31 -pout/soong/.intermediates/hardware/interfaces/audio/aidl/android.hardware.audio.common_interface/4/preprocessed.aidl -pout/soong/.intermediates/hardware/interfaces/common/aidl/android.hardware.common_interface/2/preprocessed.aidl -pout/soong/.intermediates/hardware/interfaces/common/fmq/aidl/android.hardware.common.fmq_interface/1/preprocessed.aidl --previous_api_dir=hardware/interfaces/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/4 --previous_hash ac25616dda1c45dc2915d3f5ac82687a1a6f6e46 --ninja -d out/soong/.intermediates/hardware/interfaces/bluetooth/audio/aidl/android.hardware.bluetooth.audio-V5-ndk-source/gen/staging/android/hardware/bluetooth/audio/AudioConfiguration.cpp.d -h out/soong/.intermediates/hardware/interfaces/bluetooth/audio/aidl/android.hardware.bluetooth.audio-V5-ndk-source/gen/include/staging -o out/soong/.intermediates/hardware/interfaces/bluetooth/audio/aidl/android.hardware.bluetooth.audio-V5-ndk-source/gen/staging -Nhardware/interfaces/bluetooth/audio/aidl hardware/interfaces/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioConfiguration.aidl
4 *
5 * DO NOT CHECK THIS FILE INTO A CODE TREE (e.g. git, etc..).
6 * ALWAYS GENERATE THIS FILE FROM UPDATED AIDL COMPILER
7 * AS A BUILD INTERMEDIATE ONLY. THIS IS NOT SOURCE CODE.
8 */
9 #pragma once
10
11 #include <array>
12 #include <cassert>
13 #include <cstdint>
14 #include <memory>
15 #include <optional>
16 #include <string>
17 #include <type_traits>
18 #include <utility>
19 #include <variant>
20 #include <vector>
21 #include <android/binder_enums.h>
22 #include <android/binder_interface_utils.h>
23 #include <android/binder_parcelable_utils.h>
24 #include <android/binder_to_string.h>
25 #include <aidl/android/hardware/bluetooth/audio/A2dpStreamConfiguration.h>
26 #include <aidl/android/hardware/bluetooth/audio/CodecConfiguration.h>
27 #include <aidl/android/hardware/bluetooth/audio/HfpConfiguration.h>
28 #include <aidl/android/hardware/bluetooth/audio/LeAudioBroadcastConfiguration.h>
29 #include <aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.h>
30 #include <aidl/android/hardware/bluetooth/audio/PcmConfiguration.h>
31 #ifdef BINDER_STABILITY_SUPPORT
32 #include <android/binder_stability.h>
33 #endif // BINDER_STABILITY_SUPPORT
34
35 #ifndef __BIONIC__
36 #define __assert2(a,b,c,d) ((void)0)
37 #endif
38
39 namespace aidl::android::hardware::bluetooth::audio {
40 class A2dpStreamConfiguration;
41 class CodecConfiguration;
42 class HfpConfiguration;
43 class LeAudioBroadcastConfiguration;
44 class LeAudioConfiguration;
45 class PcmConfiguration;
46 } // namespace aidl::android::hardware::bluetooth::audio
47 namespace aidl {
48 namespace android {
49 namespace hardware {
50 namespace bluetooth {
51 namespace audio {
52 class AudioConfiguration {
53 public:
54 typedef std::false_type fixed_size;
55 static const char* descriptor;
56
57 enum class Tag : int32_t {
58 pcmConfig = 0,
59 a2dpConfig = 1,
60 leAudioConfig = 2,
61 leAudioBroadcastConfig = 3,
62 hfpConfig = 4,
63 a2dp = 5,
64 };
65
66 // Expose tag symbols for legacy code
67 static const inline Tag pcmConfig = Tag::pcmConfig;
68 static const inline Tag a2dpConfig = Tag::a2dpConfig;
69 static const inline Tag leAudioConfig = Tag::leAudioConfig;
70 static const inline Tag leAudioBroadcastConfig = Tag::leAudioBroadcastConfig;
71 static const inline Tag hfpConfig = Tag::hfpConfig;
72 static const inline Tag a2dp = Tag::a2dp;
73
74 template<typename _Tp>
75 static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, AudioConfiguration>;
76
AudioConfiguration()77 AudioConfiguration() : _value(std::in_place_index<static_cast<size_t>(pcmConfig)>, ::aidl::android::hardware::bluetooth::audio::PcmConfiguration()) { }
78
79 template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
80 // NOLINTNEXTLINE(google-explicit-constructor)
AudioConfiguration(_Tp && _arg)81 constexpr AudioConfiguration(_Tp&& _arg)
82 : _value(std::forward<_Tp>(_arg)) {}
83
84 template <size_t _Np, typename... _Tp>
AudioConfiguration(std::in_place_index_t<_Np>,_Tp &&..._args)85 constexpr explicit AudioConfiguration(std::in_place_index_t<_Np>, _Tp&&... _args)
86 : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
87
88 template <Tag _tag, typename... _Tp>
make(_Tp &&..._args)89 static AudioConfiguration make(_Tp&&... _args) {
90 return AudioConfiguration(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
91 }
92
93 template <Tag _tag, typename _Tp, typename... _Up>
make(std::initializer_list<_Tp> _il,_Up &&..._args)94 static AudioConfiguration make(std::initializer_list<_Tp> _il, _Up&&... _args) {
95 return AudioConfiguration(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
96 }
97
getTag()98 Tag getTag() const {
99 return static_cast<Tag>(_value.index());
100 }
101
102 template <Tag _tag>
get()103 const auto& get() const {
104 if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
105 return std::get<static_cast<size_t>(_tag)>(_value);
106 }
107
108 template <Tag _tag>
get()109 auto& get() {
110 if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
111 return std::get<static_cast<size_t>(_tag)>(_value);
112 }
113
114 template <Tag _tag, typename... _Tp>
set(_Tp &&..._args)115 void set(_Tp&&... _args) {
116 _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
117 }
118
119 binder_status_t readFromParcel(const AParcel* _parcel);
120 binder_status_t writeToParcel(AParcel* _parcel) const;
121
122 inline bool operator==(const AudioConfiguration& _rhs) const {
123 return _value == _rhs._value;
124 }
125 inline bool operator<(const AudioConfiguration& _rhs) const {
126 return _value < _rhs._value;
127 }
128 inline bool operator!=(const AudioConfiguration& _rhs) const {
129 return !(*this == _rhs);
130 }
131 inline bool operator>(const AudioConfiguration& _rhs) const {
132 return _rhs < *this;
133 }
134 inline bool operator>=(const AudioConfiguration& _rhs) const {
135 return !(*this < _rhs);
136 }
137 inline bool operator<=(const AudioConfiguration& _rhs) const {
138 return !(_rhs < *this);
139 }
140
141 static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()142 inline std::string toString() const {
143 std::ostringstream os;
144 os << "AudioConfiguration{";
145 switch (getTag()) {
146 case pcmConfig: os << "pcmConfig: " << ::android::internal::ToString(get<pcmConfig>()); break;
147 case a2dpConfig: os << "a2dpConfig: " << ::android::internal::ToString(get<a2dpConfig>()); break;
148 case leAudioConfig: os << "leAudioConfig: " << ::android::internal::ToString(get<leAudioConfig>()); break;
149 case leAudioBroadcastConfig: os << "leAudioBroadcastConfig: " << ::android::internal::ToString(get<leAudioBroadcastConfig>()); break;
150 case hfpConfig: os << "hfpConfig: " << ::android::internal::ToString(get<hfpConfig>()); break;
151 case a2dp: os << "a2dp: " << ::android::internal::ToString(get<a2dp>()); break;
152 }
153 os << "}";
154 return os.str();
155 }
156 private:
157 std::variant<::aidl::android::hardware::bluetooth::audio::PcmConfiguration, ::aidl::android::hardware::bluetooth::audio::CodecConfiguration, ::aidl::android::hardware::bluetooth::audio::LeAudioConfiguration, ::aidl::android::hardware::bluetooth::audio::LeAudioBroadcastConfiguration, ::aidl::android::hardware::bluetooth::audio::HfpConfiguration, ::aidl::android::hardware::bluetooth::audio::A2dpStreamConfiguration> _value;
158 };
159 } // namespace audio
160 } // namespace bluetooth
161 } // namespace hardware
162 } // namespace android
163 } // namespace aidl
164 namespace aidl {
165 namespace android {
166 namespace hardware {
167 namespace bluetooth {
168 namespace audio {
toString(AudioConfiguration::Tag val)169 [[nodiscard]] static inline std::string toString(AudioConfiguration::Tag val) {
170 switch(val) {
171 case AudioConfiguration::Tag::pcmConfig:
172 return "pcmConfig";
173 case AudioConfiguration::Tag::a2dpConfig:
174 return "a2dpConfig";
175 case AudioConfiguration::Tag::leAudioConfig:
176 return "leAudioConfig";
177 case AudioConfiguration::Tag::leAudioBroadcastConfig:
178 return "leAudioBroadcastConfig";
179 case AudioConfiguration::Tag::hfpConfig:
180 return "hfpConfig";
181 case AudioConfiguration::Tag::a2dp:
182 return "a2dp";
183 default:
184 return std::to_string(static_cast<int32_t>(val));
185 }
186 }
187 } // namespace audio
188 } // namespace bluetooth
189 } // namespace hardware
190 } // namespace android
191 } // namespace aidl
192 namespace ndk {
193 namespace internal {
194 #pragma clang diagnostic push
195 #pragma clang diagnostic ignored "-Wc++17-extensions"
196 template <>
197 constexpr inline std::array<aidl::android::hardware::bluetooth::audio::AudioConfiguration::Tag, 6> enum_values<aidl::android::hardware::bluetooth::audio::AudioConfiguration::Tag> = {
198 aidl::android::hardware::bluetooth::audio::AudioConfiguration::Tag::pcmConfig,
199 aidl::android::hardware::bluetooth::audio::AudioConfiguration::Tag::a2dpConfig,
200 aidl::android::hardware::bluetooth::audio::AudioConfiguration::Tag::leAudioConfig,
201 aidl::android::hardware::bluetooth::audio::AudioConfiguration::Tag::leAudioBroadcastConfig,
202 aidl::android::hardware::bluetooth::audio::AudioConfiguration::Tag::hfpConfig,
203 aidl::android::hardware::bluetooth::audio::AudioConfiguration::Tag::a2dp,
204 };
205 #pragma clang diagnostic pop
206 } // namespace internal
207 } // namespace ndk
208