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