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/CodecInfo.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/CodecInfo.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/ChannelMode.h>
26 #include <aidl/android/hardware/bluetooth/audio/CodecId.h>
27 #include <aidl/android/hardware/bluetooth/audio/CodecInfo.h>
28 #include <aidl/android/hardware/bluetooth/audio/ConfigurationFlags.h>
29 #ifdef BINDER_STABILITY_SUPPORT
30 #include <android/binder_stability.h>
31 #endif  // BINDER_STABILITY_SUPPORT
32 
33 #ifndef __BIONIC__
34 #define __assert2(a,b,c,d) ((void)0)
35 #endif
36 
37 namespace aidl::android::hardware::bluetooth::audio {
38 class ConfigurationFlags;
39 }  // namespace aidl::android::hardware::bluetooth::audio
40 namespace aidl {
41 namespace android {
42 namespace hardware {
43 namespace bluetooth {
44 namespace audio {
45 class CodecInfo {
46 public:
47   typedef std::false_type fixed_size;
48   static const char* descriptor;
49 
50   class A2dp {
51   public:
52     typedef std::false_type fixed_size;
53     static const char* descriptor;
54 
55     std::vector<uint8_t> capabilities;
56     std::vector<::aidl::android::hardware::bluetooth::audio::ChannelMode> channelMode;
57     std::vector<int32_t> samplingFrequencyHz;
58     std::vector<int32_t> bitdepth;
59     bool lossless = false;
60 
61     binder_status_t readFromParcel(const AParcel* parcel);
62     binder_status_t writeToParcel(AParcel* parcel) const;
63 
64     inline bool operator==(const A2dp& _rhs) const {
65       return std::tie(capabilities, channelMode, samplingFrequencyHz, bitdepth, lossless) == std::tie(_rhs.capabilities, _rhs.channelMode, _rhs.samplingFrequencyHz, _rhs.bitdepth, _rhs.lossless);
66     }
67     inline bool operator<(const A2dp& _rhs) const {
68       return std::tie(capabilities, channelMode, samplingFrequencyHz, bitdepth, lossless) < std::tie(_rhs.capabilities, _rhs.channelMode, _rhs.samplingFrequencyHz, _rhs.bitdepth, _rhs.lossless);
69     }
70     inline bool operator!=(const A2dp& _rhs) const {
71       return !(*this == _rhs);
72     }
73     inline bool operator>(const A2dp& _rhs) const {
74       return _rhs < *this;
75     }
76     inline bool operator>=(const A2dp& _rhs) const {
77       return !(*this < _rhs);
78     }
79     inline bool operator<=(const A2dp& _rhs) const {
80       return !(_rhs < *this);
81     }
82 
83     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()84     inline std::string toString() const {
85       std::ostringstream _aidl_os;
86       _aidl_os << "A2dp{";
87       _aidl_os << "capabilities: " << ::android::internal::ToString(capabilities);
88       _aidl_os << ", channelMode: " << ::android::internal::ToString(channelMode);
89       _aidl_os << ", samplingFrequencyHz: " << ::android::internal::ToString(samplingFrequencyHz);
90       _aidl_os << ", bitdepth: " << ::android::internal::ToString(bitdepth);
91       _aidl_os << ", lossless: " << ::android::internal::ToString(lossless);
92       _aidl_os << "}";
93       return _aidl_os.str();
94     }
95   };
96   class Hfp {
97   public:
98     typedef std::false_type fixed_size;
99     static const char* descriptor;
100 
101     int32_t inputDataPath = 1;
102     int32_t outputDataPath = 1;
103     bool useControllerCodec = true;
104 
105     binder_status_t readFromParcel(const AParcel* parcel);
106     binder_status_t writeToParcel(AParcel* parcel) const;
107 
108     inline bool operator==(const Hfp& _rhs) const {
109       return std::tie(inputDataPath, outputDataPath, useControllerCodec) == std::tie(_rhs.inputDataPath, _rhs.outputDataPath, _rhs.useControllerCodec);
110     }
111     inline bool operator<(const Hfp& _rhs) const {
112       return std::tie(inputDataPath, outputDataPath, useControllerCodec) < std::tie(_rhs.inputDataPath, _rhs.outputDataPath, _rhs.useControllerCodec);
113     }
114     inline bool operator!=(const Hfp& _rhs) const {
115       return !(*this == _rhs);
116     }
117     inline bool operator>(const Hfp& _rhs) const {
118       return _rhs < *this;
119     }
120     inline bool operator>=(const Hfp& _rhs) const {
121       return !(*this < _rhs);
122     }
123     inline bool operator<=(const Hfp& _rhs) const {
124       return !(_rhs < *this);
125     }
126 
127     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()128     inline std::string toString() const {
129       std::ostringstream _aidl_os;
130       _aidl_os << "Hfp{";
131       _aidl_os << "inputDataPath: " << ::android::internal::ToString(inputDataPath);
132       _aidl_os << ", outputDataPath: " << ::android::internal::ToString(outputDataPath);
133       _aidl_os << ", useControllerCodec: " << ::android::internal::ToString(useControllerCodec);
134       _aidl_os << "}";
135       return _aidl_os.str();
136     }
137   };
138   class LeAudio {
139   public:
140     typedef std::false_type fixed_size;
141     static const char* descriptor;
142 
143     std::vector<::aidl::android::hardware::bluetooth::audio::ChannelMode> channelMode;
144     std::vector<int32_t> samplingFrequencyHz;
145     std::vector<int32_t> frameDurationUs;
146     std::vector<int32_t> bitdepth;
147     std::optional<::aidl::android::hardware::bluetooth::audio::ConfigurationFlags> flags;
148 
149     binder_status_t readFromParcel(const AParcel* parcel);
150     binder_status_t writeToParcel(AParcel* parcel) const;
151 
152     inline bool operator==(const LeAudio& _rhs) const {
153       return std::tie(channelMode, samplingFrequencyHz, frameDurationUs, bitdepth, flags) == std::tie(_rhs.channelMode, _rhs.samplingFrequencyHz, _rhs.frameDurationUs, _rhs.bitdepth, _rhs.flags);
154     }
155     inline bool operator<(const LeAudio& _rhs) const {
156       return std::tie(channelMode, samplingFrequencyHz, frameDurationUs, bitdepth, flags) < std::tie(_rhs.channelMode, _rhs.samplingFrequencyHz, _rhs.frameDurationUs, _rhs.bitdepth, _rhs.flags);
157     }
158     inline bool operator!=(const LeAudio& _rhs) const {
159       return !(*this == _rhs);
160     }
161     inline bool operator>(const LeAudio& _rhs) const {
162       return _rhs < *this;
163     }
164     inline bool operator>=(const LeAudio& _rhs) const {
165       return !(*this < _rhs);
166     }
167     inline bool operator<=(const LeAudio& _rhs) const {
168       return !(_rhs < *this);
169     }
170 
171     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()172     inline std::string toString() const {
173       std::ostringstream _aidl_os;
174       _aidl_os << "LeAudio{";
175       _aidl_os << "channelMode: " << ::android::internal::ToString(channelMode);
176       _aidl_os << ", samplingFrequencyHz: " << ::android::internal::ToString(samplingFrequencyHz);
177       _aidl_os << ", frameDurationUs: " << ::android::internal::ToString(frameDurationUs);
178       _aidl_os << ", bitdepth: " << ::android::internal::ToString(bitdepth);
179       _aidl_os << ", flags: " << ::android::internal::ToString(flags);
180       _aidl_os << "}";
181       return _aidl_os.str();
182     }
183   };
184   class Transport {
185   public:
186     typedef std::false_type fixed_size;
187     static const char* descriptor;
188 
189     enum class Tag : int32_t {
190       leAudio = 0,
191       a2dp = 1,
192       hfp = 2,
193     };
194 
195     // Expose tag symbols for legacy code
196     static const inline Tag leAudio = Tag::leAudio;
197     static const inline Tag a2dp = Tag::a2dp;
198     static const inline Tag hfp = Tag::hfp;
199 
200     template<typename _Tp>
201     static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, Transport>;
202 
Transport()203     Transport() : _value(std::in_place_index<static_cast<size_t>(leAudio)>, ::aidl::android::hardware::bluetooth::audio::CodecInfo::LeAudio()) { }
204 
205     template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
206     // NOLINTNEXTLINE(google-explicit-constructor)
Transport(_Tp && _arg)207     constexpr Transport(_Tp&& _arg)
208         : _value(std::forward<_Tp>(_arg)) {}
209 
210     template <size_t _Np, typename... _Tp>
Transport(std::in_place_index_t<_Np>,_Tp &&..._args)211     constexpr explicit Transport(std::in_place_index_t<_Np>, _Tp&&... _args)
212         : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
213 
214     template <Tag _tag, typename... _Tp>
make(_Tp &&..._args)215     static Transport make(_Tp&&... _args) {
216       return Transport(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
217     }
218 
219     template <Tag _tag, typename _Tp, typename... _Up>
make(std::initializer_list<_Tp> _il,_Up &&..._args)220     static Transport make(std::initializer_list<_Tp> _il, _Up&&... _args) {
221       return Transport(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
222     }
223 
getTag()224     Tag getTag() const {
225       return static_cast<Tag>(_value.index());
226     }
227 
228     template <Tag _tag>
get()229     const auto& get() const {
230       if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
231       return std::get<static_cast<size_t>(_tag)>(_value);
232     }
233 
234     template <Tag _tag>
get()235     auto& get() {
236       if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
237       return std::get<static_cast<size_t>(_tag)>(_value);
238     }
239 
240     template <Tag _tag, typename... _Tp>
set(_Tp &&..._args)241     void set(_Tp&&... _args) {
242       _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
243     }
244 
245     binder_status_t readFromParcel(const AParcel* _parcel);
246     binder_status_t writeToParcel(AParcel* _parcel) const;
247 
248     inline bool operator==(const Transport& _rhs) const {
249       return _value == _rhs._value;
250     }
251     inline bool operator<(const Transport& _rhs) const {
252       return _value < _rhs._value;
253     }
254     inline bool operator!=(const Transport& _rhs) const {
255       return !(*this == _rhs);
256     }
257     inline bool operator>(const Transport& _rhs) const {
258       return _rhs < *this;
259     }
260     inline bool operator>=(const Transport& _rhs) const {
261       return !(*this < _rhs);
262     }
263     inline bool operator<=(const Transport& _rhs) const {
264       return !(_rhs < *this);
265     }
266 
267     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()268     inline std::string toString() const {
269       std::ostringstream os;
270       os << "Transport{";
271       switch (getTag()) {
272       case leAudio: os << "leAudio: " << ::android::internal::ToString(get<leAudio>()); break;
273       case a2dp: os << "a2dp: " << ::android::internal::ToString(get<a2dp>()); break;
274       case hfp: os << "hfp: " << ::android::internal::ToString(get<hfp>()); break;
275       }
276       os << "}";
277       return os.str();
278     }
279   private:
280     std::variant<::aidl::android::hardware::bluetooth::audio::CodecInfo::LeAudio, ::aidl::android::hardware::bluetooth::audio::CodecInfo::A2dp, ::aidl::android::hardware::bluetooth::audio::CodecInfo::Hfp> _value;
281   };
282   ::aidl::android::hardware::bluetooth::audio::CodecId id;
283   std::string name;
284   ::aidl::android::hardware::bluetooth::audio::CodecInfo::Transport transport;
285 
286   binder_status_t readFromParcel(const AParcel* parcel);
287   binder_status_t writeToParcel(AParcel* parcel) const;
288 
289   inline bool operator==(const CodecInfo& _rhs) const {
290     return std::tie(id, name, transport) == std::tie(_rhs.id, _rhs.name, _rhs.transport);
291   }
292   inline bool operator<(const CodecInfo& _rhs) const {
293     return std::tie(id, name, transport) < std::tie(_rhs.id, _rhs.name, _rhs.transport);
294   }
295   inline bool operator!=(const CodecInfo& _rhs) const {
296     return !(*this == _rhs);
297   }
298   inline bool operator>(const CodecInfo& _rhs) const {
299     return _rhs < *this;
300   }
301   inline bool operator>=(const CodecInfo& _rhs) const {
302     return !(*this < _rhs);
303   }
304   inline bool operator<=(const CodecInfo& _rhs) const {
305     return !(_rhs < *this);
306   }
307 
308   static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()309   inline std::string toString() const {
310     std::ostringstream _aidl_os;
311     _aidl_os << "CodecInfo{";
312     _aidl_os << "id: " << ::android::internal::ToString(id);
313     _aidl_os << ", name: " << ::android::internal::ToString(name);
314     _aidl_os << ", transport: " << ::android::internal::ToString(transport);
315     _aidl_os << "}";
316     return _aidl_os.str();
317   }
318 };
319 }  // namespace audio
320 }  // namespace bluetooth
321 }  // namespace hardware
322 }  // namespace android
323 }  // namespace aidl
324 namespace aidl {
325 namespace android {
326 namespace hardware {
327 namespace bluetooth {
328 namespace audio {
toString(CodecInfo::Transport::Tag val)329 [[nodiscard]] static inline std::string toString(CodecInfo::Transport::Tag val) {
330   switch(val) {
331   case CodecInfo::Transport::Tag::leAudio:
332     return "leAudio";
333   case CodecInfo::Transport::Tag::a2dp:
334     return "a2dp";
335   case CodecInfo::Transport::Tag::hfp:
336     return "hfp";
337   default:
338     return std::to_string(static_cast<int32_t>(val));
339   }
340 }
341 }  // namespace audio
342 }  // namespace bluetooth
343 }  // namespace hardware
344 }  // namespace android
345 }  // namespace aidl
346 namespace ndk {
347 namespace internal {
348 #pragma clang diagnostic push
349 #pragma clang diagnostic ignored "-Wc++17-extensions"
350 template <>
351 constexpr inline std::array<aidl::android::hardware::bluetooth::audio::CodecInfo::Transport::Tag, 3> enum_values<aidl::android::hardware::bluetooth::audio::CodecInfo::Transport::Tag> = {
352   aidl::android::hardware::bluetooth::audio::CodecInfo::Transport::Tag::leAudio,
353   aidl::android::hardware::bluetooth::audio::CodecInfo::Transport::Tag::a2dp,
354   aidl::android::hardware::bluetooth::audio::CodecInfo::Transport::Tag::hfp,
355 };
356 #pragma clang diagnostic pop
357 }  // namespace internal
358 }  // namespace ndk
359