1 #ifndef HIDL_GENERATED_ANDROID_HARDWARE_AUDIO_V7_1_ISTREAMOUTLATENCYMODECALLBACK_H
2 #define HIDL_GENERATED_ANDROID_HARDWARE_AUDIO_V7_1_ISTREAMOUTLATENCYMODECALLBACK_H
3 
4 #include <android/hardware/audio/7.1/types.h>
5 #include <android/hidl/base/1.0/IBase.h>
6 
7 #include <android/hidl/manager/1.0/IServiceNotification.h>
8 
9 #include <hidl/HidlSupport.h>
10 #include <hidl/MQDescriptor.h>
11 #include <hidl/Status.h>
12 #include <utils/NativeHandle.h>
13 #include <utils/misc.h>
14 
15 namespace android {
16 namespace hardware {
17 namespace audio {
18 namespace V7_1 {
19 
20 /**
21  * Callback interface for output stream variable latency mode feature.
22  */
23 struct IStreamOutLatencyModeCallback : public ::android::hidl::base::V1_0::IBase {
24     /**
25      * Type tag for use in template logic that indicates this is a 'pure' class.
26      */
27     typedef ::android::hardware::details::i_tag _hidl_tag;
28 
29     /**
30      * Fully qualified interface name: "[email protected]::IStreamOutLatencyModeCallback"
31      */
32     static const char* descriptor;
33 
34     /**
35      * Returns whether this object's implementation is outside of the current process.
36      */
isRemoteIStreamOutLatencyModeCallback37     virtual bool isRemote() const override { return false; }
38 
39     /**
40      * Called with the new list of supported latency modes when a change occurs.
41      */
42     virtual ::android::hardware::Return<void> onRecommendedLatencyModeChanged(const ::android::hardware::hidl_vec<::android::hardware::audio::V7_1::LatencyMode>& modes) = 0;
43 
44     /**
45      * Return callback for interfaceChain
46      */
47     using interfaceChain_cb = std::function<void(const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& descriptors)>;
48     /*
49      * Provides run-time type information for this object.
50      * For example, for the following interface definition:
51      *     package [email protected];
52      *     interface IParent {};
53      *     interface IChild extends IParent {};
54      * Calling interfaceChain on an IChild object must yield the following:
55      *     ["[email protected]::IChild",
56      *      "[email protected]::IParent"
57      *      "[email protected]::IBase"]
58      *
59      * @return descriptors a vector of descriptors of the run-time type of the
60      *         object.
61      */
62     virtual ::android::hardware::Return<void> interfaceChain(interfaceChain_cb _hidl_cb) override;
63 
64     /*
65      * Emit diagnostic information to the given file.
66      *
67      * Optionally overriden.
68      *
69      * @param fd      File descriptor to dump data to.
70      *                Must only be used for the duration of this call.
71      * @param options Arguments for debugging.
72      *                Must support empty for default debug information.
73      */
74     virtual ::android::hardware::Return<void> debug(const ::android::hardware::hidl_handle& fd, const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& options) override;
75 
76     /**
77      * Return callback for interfaceDescriptor
78      */
79     using interfaceDescriptor_cb = std::function<void(const ::android::hardware::hidl_string& descriptor)>;
80     /*
81      * Provides run-time type information for this object.
82      * For example, for the following interface definition:
83      *     package [email protected];
84      *     interface IParent {};
85      *     interface IChild extends IParent {};
86      * Calling interfaceDescriptor on an IChild object must yield
87      *     "[email protected]::IChild"
88      *
89      * @return descriptor a descriptor of the run-time type of the
90      *         object (the first element of the vector returned by
91      *         interfaceChain())
92      */
93     virtual ::android::hardware::Return<void> interfaceDescriptor(interfaceDescriptor_cb _hidl_cb) override;
94 
95     /**
96      * Return callback for getHashChain
97      */
98     using getHashChain_cb = std::function<void(const ::android::hardware::hidl_vec<::android::hardware::hidl_array<uint8_t, 32>>& hashchain)>;
99     /*
100      * Returns hashes of the source HAL files that define the interfaces of the
101      * runtime type information on the object.
102      * For example, for the following interface definition:
103      *     package [email protected];
104      *     interface IParent {};
105      *     interface IChild extends IParent {};
106      * Calling interfaceChain on an IChild object must yield the following:
107      *     [(hash of IChild.hal),
108      *      (hash of IParent.hal)
109      *      (hash of IBase.hal)].
110      *
111      * SHA-256 is used as the hashing algorithm. Each hash has 32 bytes
112      * according to SHA-256 standard.
113      *
114      * @return hashchain a vector of SHA-1 digests
115      */
116     virtual ::android::hardware::Return<void> getHashChain(getHashChain_cb _hidl_cb) override;
117 
118     /*
119      * This method trigger the interface to enable/disable instrumentation based
120      * on system property hal.instrumentation.enable.
121      */
122     virtual ::android::hardware::Return<void> setHALInstrumentation() override;
123 
124     /*
125      * Registers a death recipient, to be called when the process hosting this
126      * interface dies.
127      *
128      * @param recipient a hidl_death_recipient callback object
129      * @param cookie a cookie that must be returned with the callback
130      * @return success whether the death recipient was registered successfully.
131      */
132     virtual ::android::hardware::Return<bool> linkToDeath(const ::android::sp<::android::hardware::hidl_death_recipient>& recipient, uint64_t cookie) override;
133 
134     /*
135      * Provides way to determine if interface is running without requesting
136      * any functionality.
137      */
138     virtual ::android::hardware::Return<void> ping() override;
139 
140     /**
141      * Return callback for getDebugInfo
142      */
143     using getDebugInfo_cb = std::function<void(const ::android::hidl::base::V1_0::DebugInfo& info)>;
144     /*
145      * Get debug information on references on this interface.
146      * @return info debugging information. See comments of DebugInfo.
147      */
148     virtual ::android::hardware::Return<void> getDebugInfo(getDebugInfo_cb _hidl_cb) override;
149 
150     /*
151      * This method notifies the interface that one or more system properties
152      * have changed. The default implementation calls
153      * (C++)  report_sysprop_change() in libcutils or
154      * (Java) android.os.SystemProperties.reportSyspropChanged,
155      * which in turn calls a set of registered callbacks (eg to update trace
156      * tags).
157      */
158     virtual ::android::hardware::Return<void> notifySyspropsChanged() override;
159 
160     /*
161      * Unregisters the registered death recipient. If this service was registered
162      * multiple times with the same exact death recipient, this unlinks the most
163      * recently registered one.
164      *
165      * @param recipient a previously registered hidl_death_recipient callback
166      * @return success whether the death recipient was unregistered successfully.
167      */
168     virtual ::android::hardware::Return<bool> unlinkToDeath(const ::android::sp<::android::hardware::hidl_death_recipient>& recipient) override;
169 
170     // cast static functions
171     /**
172      * This performs a checked cast based on what the underlying implementation actually is.
173      */
174     static ::android::hardware::Return<::android::sp<::android::hardware::audio::V7_1::IStreamOutLatencyModeCallback>> castFrom(const ::android::sp<::android::hardware::audio::V7_1::IStreamOutLatencyModeCallback>& parent, bool emitError = false);
175     /**
176      * This performs a checked cast based on what the underlying implementation actually is.
177      */
178     static ::android::hardware::Return<::android::sp<::android::hardware::audio::V7_1::IStreamOutLatencyModeCallback>> castFrom(const ::android::sp<::android::hidl::base::V1_0::IBase>& parent, bool emitError = false);
179 
180     // helper methods for interactions with the hwservicemanager
181     /**
182      * This gets the service of this type with the specified instance name. If the
183      * service is currently not available or not in the VINTF manifest on a Trebilized
184      * device, this will return nullptr. This is useful when you don't want to block
185      * during device boot. If getStub is true, this will try to return an unwrapped
186      * passthrough implementation in the same process. This is useful when getting an
187      * implementation from the same partition/compilation group.
188      *
189      * In general, prefer getService(std::string,bool)
190      */
191     static ::android::sp<IStreamOutLatencyModeCallback> tryGetService(const std::string &serviceName="default", bool getStub=false);
192     /**
193      * Deprecated. See tryGetService(std::string, bool)
194      */
195     static ::android::sp<IStreamOutLatencyModeCallback> tryGetService(const char serviceName[], bool getStub=false)  { std::string str(serviceName ? serviceName : "");      return tryGetService(str, getStub); }
196     /**
197      * Deprecated. See tryGetService(std::string, bool)
198      */
199     static ::android::sp<IStreamOutLatencyModeCallback> tryGetService(const ::android::hardware::hidl_string& serviceName, bool getStub=false)  { std::string str(serviceName.c_str());      return tryGetService(str, getStub); }
200     /**
201      * Calls tryGetService("default", bool). This is the recommended instance name for singleton services.
202      */
tryGetServiceIStreamOutLatencyModeCallback203     static ::android::sp<IStreamOutLatencyModeCallback> tryGetService(bool getStub) { return tryGetService("default", getStub); }
204     /**
205      * This gets the service of this type with the specified instance name. If the
206      * service is not in the VINTF manifest on a Trebilized device, this will return
207      * nullptr. If the service is not available, this will wait for the service to
208      * become available. If the service is a lazy service, this will start the service
209      * and return when it becomes available. If getStub is true, this will try to
210      * return an unwrapped passthrough implementation in the same process. This is
211      * useful when getting an implementation from the same partition/compilation group.
212      */
213     static ::android::sp<IStreamOutLatencyModeCallback> getService(const std::string &serviceName="default", bool getStub=false);
214     /**
215      * Deprecated. See getService(std::string, bool)
216      */
217     static ::android::sp<IStreamOutLatencyModeCallback> getService(const char serviceName[], bool getStub=false)  { std::string str(serviceName ? serviceName : "");      return getService(str, getStub); }
218     /**
219      * Deprecated. See getService(std::string, bool)
220      */
221     static ::android::sp<IStreamOutLatencyModeCallback> getService(const ::android::hardware::hidl_string& serviceName, bool getStub=false)  { std::string str(serviceName.c_str());      return getService(str, getStub); }
222     /**
223      * Calls getService("default", bool). This is the recommended instance name for singleton services.
224      */
getServiceIStreamOutLatencyModeCallback225     static ::android::sp<IStreamOutLatencyModeCallback> getService(bool getStub) { return getService("default", getStub); }
226     /**
227      * Registers a service with the service manager. For Trebilized devices, the service
228      * must also be in the VINTF manifest.
229      */
230     __attribute__ ((warn_unused_result))::android::status_t registerAsService(const std::string &serviceName="default");
231     /**
232      * Registers for notifications for when a service is registered.
233      */
234     static bool registerForNotifications(
235             const std::string &serviceName,
236             const ::android::sp<::android::hidl::manager::V1_0::IServiceNotification> &notification);
237 };
238 
239 //
240 // type declarations for package
241 //
242 
243 static inline std::string toString(const ::android::sp<::android::hardware::audio::V7_1::IStreamOutLatencyModeCallback>& o);
244 
245 //
246 // type header definitions for package
247 //
248 
toString(const::android::sp<::android::hardware::audio::V7_1::IStreamOutLatencyModeCallback> & o)249 static inline std::string toString(const ::android::sp<::android::hardware::audio::V7_1::IStreamOutLatencyModeCallback>& o) {
250     std::string os = "[class or subclass of ";
251     os += ::android::hardware::audio::V7_1::IStreamOutLatencyModeCallback::descriptor;
252     os += "]";
253     os += o->isRemote() ? "@remote" : "@local";
254     return os;
255 }
256 
257 
258 }  // namespace V7_1
259 }  // namespace audio
260 }  // namespace hardware
261 }  // namespace android
262 
263 //
264 // global type declarations for package
265 //
266 
267 
268 #endif  // HIDL_GENERATED_ANDROID_HARDWARE_AUDIO_V7_1_ISTREAMOUTLATENCYMODECALLBACK_H
269