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 -Werror -Weverything --structured --version 4 --hash notfrozen -t --stability vintf --min_sdk_version 29 --previous_api_dir=system/hardware/interfaces/media/aidl_api/android.media.audio.common.types/3 --previous_hash 0c86a38729dd5d560fe3a0eca6aa9d8cf83efb00 --ninja -d out/soong/.intermediates/system/hardware/interfaces/media/android.media.audio.common.types-V4-ndk-source/gen/staging/android/media/audio/common/AudioHalCapCriterionV2.cpp.d -h out/soong/.intermediates/system/hardware/interfaces/media/android.media.audio.common.types-V4-ndk-source/gen/include/staging -o out/soong/.intermediates/system/hardware/interfaces/media/android.media.audio.common.types-V4-ndk-source/gen/staging -Nsystem/hardware/interfaces/media/aidl system/hardware/interfaces/media/aidl/android/media/audio/common/AudioHalCapCriterionV2.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/media/audio/common/AudioDeviceAddress.h>
26 #include <aidl/android/media/audio/common/AudioDeviceDescription.h>
27 #include <aidl/android/media/audio/common/AudioHalCapCriterionV2.h>
28 #include <aidl/android/media/audio/common/AudioMode.h>
29 #include <aidl/android/media/audio/common/AudioPolicyForceUse.h>
30 #ifdef BINDER_STABILITY_SUPPORT
31 #include <android/binder_stability.h>
32 #endif  // BINDER_STABILITY_SUPPORT
33 
34 #ifndef __BIONIC__
35 #define __assert2(a,b,c,d) ((void)0)
36 #endif
37 
38 namespace aidl::android::media::audio::common {
39 class AudioDeviceDescription;
40 }  // namespace aidl::android::media::audio::common
41 namespace aidl {
42 namespace android {
43 namespace media {
44 namespace audio {
45 namespace common {
46 class AudioHalCapCriterionV2 {
47 public:
48   typedef std::false_type fixed_size;
49   static const char* descriptor;
50 
51   enum class LogicalDisjunction : int8_t {
52     EXCLUSIVE = 0,
53     INCLUSIVE = 1,
54   };
55 
56   class ForceConfigForUse {
57   public:
58     typedef std::false_type fixed_size;
59     static const char* descriptor;
60 
61     std::vector<::aidl::android::media::audio::common::AudioPolicyForceUse> values;
62     ::aidl::android::media::audio::common::AudioPolicyForceUse defaultValue;
63     ::aidl::android::media::audio::common::AudioHalCapCriterionV2::LogicalDisjunction logic = ::aidl::android::media::audio::common::AudioHalCapCriterionV2::LogicalDisjunction::EXCLUSIVE;
64 
65     binder_status_t readFromParcel(const AParcel* parcel);
66     binder_status_t writeToParcel(AParcel* parcel) const;
67 
68     inline bool operator==(const ForceConfigForUse& _rhs) const {
69       return std::tie(values, defaultValue, logic) == std::tie(_rhs.values, _rhs.defaultValue, _rhs.logic);
70     }
71     inline bool operator<(const ForceConfigForUse& _rhs) const {
72       return std::tie(values, defaultValue, logic) < std::tie(_rhs.values, _rhs.defaultValue, _rhs.logic);
73     }
74     inline bool operator!=(const ForceConfigForUse& _rhs) const {
75       return !(*this == _rhs);
76     }
77     inline bool operator>(const ForceConfigForUse& _rhs) const {
78       return _rhs < *this;
79     }
80     inline bool operator>=(const ForceConfigForUse& _rhs) const {
81       return !(*this < _rhs);
82     }
83     inline bool operator<=(const ForceConfigForUse& _rhs) const {
84       return !(_rhs < *this);
85     }
86 
87     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()88     inline std::string toString() const {
89       std::ostringstream _aidl_os;
90       _aidl_os << "ForceConfigForUse{";
91       _aidl_os << "values: " << ::android::internal::ToString(values);
92       _aidl_os << ", defaultValue: " << ::android::internal::ToString(defaultValue);
93       _aidl_os << ", logic: " << ::android::internal::ToString(logic);
94       _aidl_os << "}";
95       return _aidl_os.str();
96     }
97   };
98   class TelephonyMode {
99   public:
100     typedef std::false_type fixed_size;
101     static const char* descriptor;
102 
103     std::vector<::aidl::android::media::audio::common::AudioMode> values;
104     ::aidl::android::media::audio::common::AudioMode defaultValue = ::aidl::android::media::audio::common::AudioMode::NORMAL;
105     ::aidl::android::media::audio::common::AudioHalCapCriterionV2::LogicalDisjunction logic = ::aidl::android::media::audio::common::AudioHalCapCriterionV2::LogicalDisjunction::EXCLUSIVE;
106 
107     binder_status_t readFromParcel(const AParcel* parcel);
108     binder_status_t writeToParcel(AParcel* parcel) const;
109 
110     inline bool operator==(const TelephonyMode& _rhs) const {
111       return std::tie(values, defaultValue, logic) == std::tie(_rhs.values, _rhs.defaultValue, _rhs.logic);
112     }
113     inline bool operator<(const TelephonyMode& _rhs) const {
114       return std::tie(values, defaultValue, logic) < std::tie(_rhs.values, _rhs.defaultValue, _rhs.logic);
115     }
116     inline bool operator!=(const TelephonyMode& _rhs) const {
117       return !(*this == _rhs);
118     }
119     inline bool operator>(const TelephonyMode& _rhs) const {
120       return _rhs < *this;
121     }
122     inline bool operator>=(const TelephonyMode& _rhs) const {
123       return !(*this < _rhs);
124     }
125     inline bool operator<=(const TelephonyMode& _rhs) const {
126       return !(_rhs < *this);
127     }
128 
129     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()130     inline std::string toString() const {
131       std::ostringstream _aidl_os;
132       _aidl_os << "TelephonyMode{";
133       _aidl_os << "values: " << ::android::internal::ToString(values);
134       _aidl_os << ", defaultValue: " << ::android::internal::ToString(defaultValue);
135       _aidl_os << ", logic: " << ::android::internal::ToString(logic);
136       _aidl_os << "}";
137       return _aidl_os.str();
138     }
139   };
140   class AvailableDevices {
141   public:
142     typedef std::false_type fixed_size;
143     static const char* descriptor;
144 
145     std::vector<::aidl::android::media::audio::common::AudioDeviceDescription> values;
146     ::aidl::android::media::audio::common::AudioHalCapCriterionV2::LogicalDisjunction logic = ::aidl::android::media::audio::common::AudioHalCapCriterionV2::LogicalDisjunction::INCLUSIVE;
147 
148     binder_status_t readFromParcel(const AParcel* parcel);
149     binder_status_t writeToParcel(AParcel* parcel) const;
150 
151     inline bool operator==(const AvailableDevices& _rhs) const {
152       return std::tie(values, logic) == std::tie(_rhs.values, _rhs.logic);
153     }
154     inline bool operator<(const AvailableDevices& _rhs) const {
155       return std::tie(values, logic) < std::tie(_rhs.values, _rhs.logic);
156     }
157     inline bool operator!=(const AvailableDevices& _rhs) const {
158       return !(*this == _rhs);
159     }
160     inline bool operator>(const AvailableDevices& _rhs) const {
161       return _rhs < *this;
162     }
163     inline bool operator>=(const AvailableDevices& _rhs) const {
164       return !(*this < _rhs);
165     }
166     inline bool operator<=(const AvailableDevices& _rhs) const {
167       return !(_rhs < *this);
168     }
169 
170     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()171     inline std::string toString() const {
172       std::ostringstream _aidl_os;
173       _aidl_os << "AvailableDevices{";
174       _aidl_os << "values: " << ::android::internal::ToString(values);
175       _aidl_os << ", logic: " << ::android::internal::ToString(logic);
176       _aidl_os << "}";
177       return _aidl_os.str();
178     }
179   };
180   class AvailableDevicesAddresses {
181   public:
182     typedef std::false_type fixed_size;
183     static const char* descriptor;
184 
185     std::vector<::aidl::android::media::audio::common::AudioDeviceAddress> values;
186     ::aidl::android::media::audio::common::AudioHalCapCriterionV2::LogicalDisjunction logic = ::aidl::android::media::audio::common::AudioHalCapCriterionV2::LogicalDisjunction::INCLUSIVE;
187 
188     binder_status_t readFromParcel(const AParcel* parcel);
189     binder_status_t writeToParcel(AParcel* parcel) const;
190 
191     inline bool operator==(const AvailableDevicesAddresses& _rhs) const {
192       return std::tie(values, logic) == std::tie(_rhs.values, _rhs.logic);
193     }
194     inline bool operator<(const AvailableDevicesAddresses& _rhs) const {
195       return std::tie(values, logic) < std::tie(_rhs.values, _rhs.logic);
196     }
197     inline bool operator!=(const AvailableDevicesAddresses& _rhs) const {
198       return !(*this == _rhs);
199     }
200     inline bool operator>(const AvailableDevicesAddresses& _rhs) const {
201       return _rhs < *this;
202     }
203     inline bool operator>=(const AvailableDevicesAddresses& _rhs) const {
204       return !(*this < _rhs);
205     }
206     inline bool operator<=(const AvailableDevicesAddresses& _rhs) const {
207       return !(_rhs < *this);
208     }
209 
210     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()211     inline std::string toString() const {
212       std::ostringstream _aidl_os;
213       _aidl_os << "AvailableDevicesAddresses{";
214       _aidl_os << "values: " << ::android::internal::ToString(values);
215       _aidl_os << ", logic: " << ::android::internal::ToString(logic);
216       _aidl_os << "}";
217       return _aidl_os.str();
218     }
219   };
220   enum class Tag : int32_t {
221     availableInputDevices = 0,
222     availableOutputDevices = 1,
223     availableInputDevicesAddresses = 2,
224     availableOutputDevicesAddresses = 3,
225     telephonyMode = 4,
226     forceConfigForUse = 5,
227   };
228 
229   // Expose tag symbols for legacy code
230   static const inline Tag availableInputDevices = Tag::availableInputDevices;
231   static const inline Tag availableOutputDevices = Tag::availableOutputDevices;
232   static const inline Tag availableInputDevicesAddresses = Tag::availableInputDevicesAddresses;
233   static const inline Tag availableOutputDevicesAddresses = Tag::availableOutputDevicesAddresses;
234   static const inline Tag telephonyMode = Tag::telephonyMode;
235   static const inline Tag forceConfigForUse = Tag::forceConfigForUse;
236 
237   template<typename _Tp>
238   static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, AudioHalCapCriterionV2>;
239 
AudioHalCapCriterionV2()240   AudioHalCapCriterionV2() : _value(std::in_place_index<static_cast<size_t>(availableInputDevices)>, ::aidl::android::media::audio::common::AudioHalCapCriterionV2::AvailableDevices()) { }
241 
242   template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
243   // NOLINTNEXTLINE(google-explicit-constructor)
AudioHalCapCriterionV2(_Tp && _arg)244   constexpr AudioHalCapCriterionV2(_Tp&& _arg)
245       : _value(std::forward<_Tp>(_arg)) {}
246 
247   template <size_t _Np, typename... _Tp>
AudioHalCapCriterionV2(std::in_place_index_t<_Np>,_Tp &&..._args)248   constexpr explicit AudioHalCapCriterionV2(std::in_place_index_t<_Np>, _Tp&&... _args)
249       : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
250 
251   template <Tag _tag, typename... _Tp>
make(_Tp &&..._args)252   static AudioHalCapCriterionV2 make(_Tp&&... _args) {
253     return AudioHalCapCriterionV2(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
254   }
255 
256   template <Tag _tag, typename _Tp, typename... _Up>
make(std::initializer_list<_Tp> _il,_Up &&..._args)257   static AudioHalCapCriterionV2 make(std::initializer_list<_Tp> _il, _Up&&... _args) {
258     return AudioHalCapCriterionV2(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
259   }
260 
getTag()261   Tag getTag() const {
262     return static_cast<Tag>(_value.index());
263   }
264 
265   template <Tag _tag>
get()266   const auto& get() const {
267     if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
268     return std::get<static_cast<size_t>(_tag)>(_value);
269   }
270 
271   template <Tag _tag>
get()272   auto& get() {
273     if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
274     return std::get<static_cast<size_t>(_tag)>(_value);
275   }
276 
277   template <Tag _tag, typename... _Tp>
set(_Tp &&..._args)278   void set(_Tp&&... _args) {
279     _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
280   }
281 
282   binder_status_t readFromParcel(const AParcel* _parcel);
283   binder_status_t writeToParcel(AParcel* _parcel) const;
284 
285   inline bool operator==(const AudioHalCapCriterionV2& _rhs) const {
286     return _value == _rhs._value;
287   }
288   inline bool operator<(const AudioHalCapCriterionV2& _rhs) const {
289     return _value < _rhs._value;
290   }
291   inline bool operator!=(const AudioHalCapCriterionV2& _rhs) const {
292     return !(*this == _rhs);
293   }
294   inline bool operator>(const AudioHalCapCriterionV2& _rhs) const {
295     return _rhs < *this;
296   }
297   inline bool operator>=(const AudioHalCapCriterionV2& _rhs) const {
298     return !(*this < _rhs);
299   }
300   inline bool operator<=(const AudioHalCapCriterionV2& _rhs) const {
301     return !(_rhs < *this);
302   }
303 
304   static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()305   inline std::string toString() const {
306     std::ostringstream os;
307     os << "AudioHalCapCriterionV2{";
308     switch (getTag()) {
309     case availableInputDevices: os << "availableInputDevices: " << ::android::internal::ToString(get<availableInputDevices>()); break;
310     case availableOutputDevices: os << "availableOutputDevices: " << ::android::internal::ToString(get<availableOutputDevices>()); break;
311     case availableInputDevicesAddresses: os << "availableInputDevicesAddresses: " << ::android::internal::ToString(get<availableInputDevicesAddresses>()); break;
312     case availableOutputDevicesAddresses: os << "availableOutputDevicesAddresses: " << ::android::internal::ToString(get<availableOutputDevicesAddresses>()); break;
313     case telephonyMode: os << "telephonyMode: " << ::android::internal::ToString(get<telephonyMode>()); break;
314     case forceConfigForUse: os << "forceConfigForUse: " << ::android::internal::ToString(get<forceConfigForUse>()); break;
315     }
316     os << "}";
317     return os.str();
318   }
319 private:
320   std::variant<::aidl::android::media::audio::common::AudioHalCapCriterionV2::AvailableDevices, ::aidl::android::media::audio::common::AudioHalCapCriterionV2::AvailableDevices, ::aidl::android::media::audio::common::AudioHalCapCriterionV2::AvailableDevicesAddresses, ::aidl::android::media::audio::common::AudioHalCapCriterionV2::AvailableDevicesAddresses, ::aidl::android::media::audio::common::AudioHalCapCriterionV2::TelephonyMode, ::aidl::android::media::audio::common::AudioHalCapCriterionV2::ForceConfigForUse> _value;
321 };
322 }  // namespace common
323 }  // namespace audio
324 }  // namespace media
325 }  // namespace android
326 }  // namespace aidl
327 namespace aidl {
328 namespace android {
329 namespace media {
330 namespace audio {
331 namespace common {
toString(AudioHalCapCriterionV2::LogicalDisjunction val)332 [[nodiscard]] static inline std::string toString(AudioHalCapCriterionV2::LogicalDisjunction val) {
333   switch(val) {
334   case AudioHalCapCriterionV2::LogicalDisjunction::EXCLUSIVE:
335     return "EXCLUSIVE";
336   case AudioHalCapCriterionV2::LogicalDisjunction::INCLUSIVE:
337     return "INCLUSIVE";
338   default:
339     return std::to_string(static_cast<int8_t>(val));
340   }
341 }
342 }  // namespace common
343 }  // namespace audio
344 }  // namespace media
345 }  // namespace android
346 }  // namespace aidl
347 namespace ndk {
348 namespace internal {
349 #pragma clang diagnostic push
350 #pragma clang diagnostic ignored "-Wc++17-extensions"
351 template <>
352 constexpr inline std::array<aidl::android::media::audio::common::AudioHalCapCriterionV2::LogicalDisjunction, 2> enum_values<aidl::android::media::audio::common::AudioHalCapCriterionV2::LogicalDisjunction> = {
353   aidl::android::media::audio::common::AudioHalCapCriterionV2::LogicalDisjunction::EXCLUSIVE,
354   aidl::android::media::audio::common::AudioHalCapCriterionV2::LogicalDisjunction::INCLUSIVE,
355 };
356 #pragma clang diagnostic pop
357 }  // namespace internal
358 }  // namespace ndk
359 namespace aidl {
360 namespace android {
361 namespace media {
362 namespace audio {
363 namespace common {
toString(AudioHalCapCriterionV2::Tag val)364 [[nodiscard]] static inline std::string toString(AudioHalCapCriterionV2::Tag val) {
365   switch(val) {
366   case AudioHalCapCriterionV2::Tag::availableInputDevices:
367     return "availableInputDevices";
368   case AudioHalCapCriterionV2::Tag::availableOutputDevices:
369     return "availableOutputDevices";
370   case AudioHalCapCriterionV2::Tag::availableInputDevicesAddresses:
371     return "availableInputDevicesAddresses";
372   case AudioHalCapCriterionV2::Tag::availableOutputDevicesAddresses:
373     return "availableOutputDevicesAddresses";
374   case AudioHalCapCriterionV2::Tag::telephonyMode:
375     return "telephonyMode";
376   case AudioHalCapCriterionV2::Tag::forceConfigForUse:
377     return "forceConfigForUse";
378   default:
379     return std::to_string(static_cast<int32_t>(val));
380   }
381 }
382 }  // namespace common
383 }  // namespace audio
384 }  // namespace media
385 }  // namespace android
386 }  // namespace aidl
387 namespace ndk {
388 namespace internal {
389 #pragma clang diagnostic push
390 #pragma clang diagnostic ignored "-Wc++17-extensions"
391 template <>
392 constexpr inline std::array<aidl::android::media::audio::common::AudioHalCapCriterionV2::Tag, 6> enum_values<aidl::android::media::audio::common::AudioHalCapCriterionV2::Tag> = {
393   aidl::android::media::audio::common::AudioHalCapCriterionV2::Tag::availableInputDevices,
394   aidl::android::media::audio::common::AudioHalCapCriterionV2::Tag::availableOutputDevices,
395   aidl::android::media::audio::common::AudioHalCapCriterionV2::Tag::availableInputDevicesAddresses,
396   aidl::android::media::audio::common::AudioHalCapCriterionV2::Tag::availableOutputDevicesAddresses,
397   aidl::android::media::audio::common::AudioHalCapCriterionV2::Tag::telephonyMode,
398   aidl::android::media::audio::common::AudioHalCapCriterionV2::Tag::forceConfigForUse,
399 };
400 #pragma clang diagnostic pop
401 }  // namespace internal
402 }  // namespace ndk
403