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 3 --hash notfrozen -t --stability vintf --min_sdk_version current -pout/soong/.intermediates/system/hardware/interfaces/media/android.media.audio.common.types_interface/4/preprocessed.aidl --previous_api_dir=hardware/interfaces/audio/aidl/aidl_api/android.hardware.audio.core.sounddose/2 --previous_hash daed2ce165b383deb25a388fb04396a6b53746f3 --ninja -d out/soong/.intermediates/hardware/interfaces/audio/aidl/android.hardware.audio.core.sounddose-V3-ndk-source/gen/staging/android/hardware/audio/core/sounddose/ISoundDose.cpp.d -h out/soong/.intermediates/hardware/interfaces/audio/aidl/android.hardware.audio.core.sounddose-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/hardware/interfaces/audio/aidl/android.hardware.audio.core.sounddose-V3-ndk-source/gen/staging -Nhardware/interfaces/audio/aidl hardware/interfaces/audio/aidl/android/hardware/audio/core/sounddose/ISoundDose.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 <cstdint>
12 #include <memory>
13 #include <optional>
14 #include <string>
15 #include <vector>
16 #include <android/binder_ibinder.h>
17 #include <android/binder_interface_utils.h>
18 #include <android/binder_parcelable_utils.h>
19 #include <android/binder_to_string.h>
20 #include <aidl/android/hardware/audio/core/sounddose/ISoundDose.h>
21 #include <aidl/android/media/audio/common/AudioDevice.h>
22 #ifdef BINDER_STABILITY_SUPPORT
23 #include <android/binder_stability.h>
24 #endif  // BINDER_STABILITY_SUPPORT
25 
26 namespace aidl::android::media::audio::common {
27 class AudioDevice;
28 }  // namespace aidl::android::media::audio::common
29 namespace aidl {
30 namespace android {
31 namespace hardware {
32 namespace audio {
33 namespace core {
34 namespace sounddose {
35 class ISoundDoseDelegator;
36 
37 class ISoundDose : public ::ndk::ICInterface {
38 public:
39   typedef ISoundDoseDelegator DefaultDelegator;
40   static const char* descriptor;
41   ISoundDose();
42   virtual ~ISoundDose();
43 
44   class IHalSoundDoseCallbackDelegator;
45 
46   class IHalSoundDoseCallback : public ::ndk::ICInterface {
47   public:
48     typedef IHalSoundDoseCallbackDelegator DefaultDelegator;
49     static const char* descriptor;
50     IHalSoundDoseCallback();
51     virtual ~IHalSoundDoseCallback();
52 
53     class MelRecord {
54     public:
55       typedef std::false_type fixed_size;
56       static const char* descriptor;
57 
58       std::vector<float> melValues;
59       int64_t timestamp = 0L;
60 
61       binder_status_t readFromParcel(const AParcel* parcel);
62       binder_status_t writeToParcel(AParcel* parcel) const;
63 
64       inline bool operator==(const MelRecord& _rhs) const {
65         return std::tie(melValues, timestamp) == std::tie(_rhs.melValues, _rhs.timestamp);
66       }
67       inline bool operator<(const MelRecord& _rhs) const {
68         return std::tie(melValues, timestamp) < std::tie(_rhs.melValues, _rhs.timestamp);
69       }
70       inline bool operator!=(const MelRecord& _rhs) const {
71         return !(*this == _rhs);
72       }
73       inline bool operator>(const MelRecord& _rhs) const {
74         return _rhs < *this;
75       }
76       inline bool operator>=(const MelRecord& _rhs) const {
77         return !(*this < _rhs);
78       }
79       inline bool operator<=(const MelRecord& _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 << "MelRecord{";
87         _aidl_os << "melValues: " << ::android::internal::ToString(melValues);
88         _aidl_os << ", timestamp: " << ::android::internal::ToString(timestamp);
89         _aidl_os << "}";
90         return _aidl_os.str();
91       }
92     };
93     static inline const int32_t version = true ? 2 : 3;
94     static inline const std::string hash = true ? "daed2ce165b383deb25a388fb04396a6b53746f3" : "notfrozen";
95     static constexpr uint32_t TRANSACTION_onMomentaryExposureWarning = FIRST_CALL_TRANSACTION + 0;
96     static constexpr uint32_t TRANSACTION_onNewMelValues = FIRST_CALL_TRANSACTION + 1;
97 
98     static std::shared_ptr<IHalSoundDoseCallback> fromBinder(const ::ndk::SpAIBinder& binder);
99     static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IHalSoundDoseCallback>& instance);
100     static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IHalSoundDoseCallback>* instance);
101     static bool setDefaultImpl(const std::shared_ptr<IHalSoundDoseCallback>& impl);
102     static const std::shared_ptr<IHalSoundDoseCallback>& getDefaultImpl();
103     virtual ::ndk::ScopedAStatus onMomentaryExposureWarning(float in_currentDbA, const ::aidl::android::media::audio::common::AudioDevice& in_audioDevice) = 0;
104     virtual ::ndk::ScopedAStatus onNewMelValues(const ::aidl::android::hardware::audio::core::sounddose::ISoundDose::IHalSoundDoseCallback::MelRecord& in_melRecord, const ::aidl::android::media::audio::common::AudioDevice& in_audioDevice) = 0;
105     virtual ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) = 0;
106     virtual ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) = 0;
107   private:
108     static std::shared_ptr<IHalSoundDoseCallback> default_impl;
109   };
110   class IHalSoundDoseCallbackDefault : public IHalSoundDoseCallback {
111   public:
112     ::ndk::ScopedAStatus onMomentaryExposureWarning(float in_currentDbA, const ::aidl::android::media::audio::common::AudioDevice& in_audioDevice) override;
113     ::ndk::ScopedAStatus onNewMelValues(const ::aidl::android::hardware::audio::core::sounddose::ISoundDose::IHalSoundDoseCallback::MelRecord& in_melRecord, const ::aidl::android::media::audio::common::AudioDevice& in_audioDevice) override;
114     ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
115     ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
116     ::ndk::SpAIBinder asBinder() override;
117     bool isRemote() override;
118   };
119   class BpHalSoundDoseCallback : public ::ndk::BpCInterface<IHalSoundDoseCallback> {
120   public:
121     explicit BpHalSoundDoseCallback(const ::ndk::SpAIBinder& binder);
122     virtual ~BpHalSoundDoseCallback();
123 
124     ::ndk::ScopedAStatus onMomentaryExposureWarning(float in_currentDbA, const ::aidl::android::media::audio::common::AudioDevice& in_audioDevice) override;
125     ::ndk::ScopedAStatus onNewMelValues(const ::aidl::android::hardware::audio::core::sounddose::ISoundDose::IHalSoundDoseCallback::MelRecord& in_melRecord, const ::aidl::android::media::audio::common::AudioDevice& in_audioDevice) override;
126     ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
127     ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
128     int32_t _aidl_cached_version = -1;
129     std::string _aidl_cached_hash = "-1";
130     std::mutex _aidl_cached_hash_mutex;
131   };
132   class BnHalSoundDoseCallback : public ::ndk::BnCInterface<IHalSoundDoseCallback> {
133   public:
134     BnHalSoundDoseCallback();
135     virtual ~BnHalSoundDoseCallback();
136     ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) final;
137     ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) final;
138   protected:
139     ::ndk::SpAIBinder createBinder() override;
140   private:
141   };
142   enum : int32_t { DEFAULT_MAX_RS2 = 100 };
143   enum : int32_t { MIN_RS2 = 80 };
144   static inline const int32_t version = true ? 2 : 3;
145   static inline const std::string hash = true ? "daed2ce165b383deb25a388fb04396a6b53746f3" : "notfrozen";
146   static constexpr uint32_t TRANSACTION_setOutputRs2UpperBound = FIRST_CALL_TRANSACTION + 0;
147   static constexpr uint32_t TRANSACTION_getOutputRs2UpperBound = FIRST_CALL_TRANSACTION + 1;
148   static constexpr uint32_t TRANSACTION_registerSoundDoseCallback = FIRST_CALL_TRANSACTION + 2;
149 
150   static std::shared_ptr<ISoundDose> fromBinder(const ::ndk::SpAIBinder& binder);
151   static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<ISoundDose>& instance);
152   static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<ISoundDose>* instance);
153   static bool setDefaultImpl(const std::shared_ptr<ISoundDose>& impl);
154   static const std::shared_ptr<ISoundDose>& getDefaultImpl();
155   virtual ::ndk::ScopedAStatus setOutputRs2UpperBound(float in_rs2ValueDbA) = 0;
156   virtual ::ndk::ScopedAStatus getOutputRs2UpperBound(float* _aidl_return) = 0;
157   virtual ::ndk::ScopedAStatus registerSoundDoseCallback(const std::shared_ptr<::aidl::android::hardware::audio::core::sounddose::ISoundDose::IHalSoundDoseCallback>& in_callback) = 0;
158   virtual ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) = 0;
159   virtual ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) = 0;
160 private:
161   static std::shared_ptr<ISoundDose> default_impl;
162 };
163 class ISoundDoseDefault : public ISoundDose {
164 public:
165   ::ndk::ScopedAStatus setOutputRs2UpperBound(float in_rs2ValueDbA) override;
166   ::ndk::ScopedAStatus getOutputRs2UpperBound(float* _aidl_return) override;
167   ::ndk::ScopedAStatus registerSoundDoseCallback(const std::shared_ptr<::aidl::android::hardware::audio::core::sounddose::ISoundDose::IHalSoundDoseCallback>& in_callback) override;
168   ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
169   ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
170   ::ndk::SpAIBinder asBinder() override;
171   bool isRemote() override;
172 };
173 }  // namespace sounddose
174 }  // namespace core
175 }  // namespace audio
176 }  // namespace hardware
177 }  // namespace android
178 }  // namespace aidl
179