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 -pout/soong/.intermediates/hardware/interfaces/audio/aidl/android.hardware.audio.effect_interface/3/preprocessed.aidl -pout/soong/.intermediates/hardware/interfaces/audio/aidl/android.hardware.audio.core.sounddose_interface/3/preprocessed.aidl -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/audio/aidl/aidl_api/android.hardware.audio.core/2 --previous_hash 003735b3fd3c94c53b02a6eb5e099731f7062610 --ninja -d out/soong/.intermediates/hardware/interfaces/audio/aidl/android.hardware.audio.core-V3-ndk-source/gen/staging/android/hardware/audio/core/IStreamCommon.cpp.d -h out/soong/.intermediates/hardware/interfaces/audio/aidl/android.hardware.audio.core-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/hardware/interfaces/audio/aidl/android.hardware.audio.core-V3-ndk-source/gen/staging -Nhardware/interfaces/audio/aidl hardware/interfaces/audio/aidl/android/hardware/audio/core/IStreamCommon.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 #include "aidl/android/hardware/audio/core/IStreamCommon.h"
10
11 #include <android/binder_parcel_utils.h>
12 #include <aidl/android/hardware/audio/core/BnStreamCommon.h>
13 #include <aidl/android/hardware/audio/core/BpStreamCommon.h>
14 #include <aidl/android/hardware/audio/core/sounddose/BnSoundDose.h>
15 #include <aidl/android/hardware/audio/core/sounddose/BpSoundDose.h>
16 #include <aidl/android/hardware/audio/core/sounddose/ISoundDose.h>
17 #include <aidl/android/hardware/audio/effect/BnEffect.h>
18 #include <aidl/android/hardware/audio/effect/BnFactory.h>
19 #include <aidl/android/hardware/audio/effect/BpEffect.h>
20 #include <aidl/android/hardware/audio/effect/BpFactory.h>
21 #include <aidl/android/hardware/audio/effect/IEffect.h>
22 #include <aidl/android/hardware/audio/effect/IFactory.h>
23
24 namespace aidl {
25 namespace android {
26 namespace hardware {
27 namespace audio {
28 namespace core {
_aidl_android_hardware_audio_core_IStreamCommon_onTransact(AIBinder * _aidl_binder,transaction_code_t _aidl_code,const AParcel * _aidl_in,AParcel * _aidl_out)29 static binder_status_t _aidl_android_hardware_audio_core_IStreamCommon_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
30 (void)_aidl_in;
31 (void)_aidl_out;
32 binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
33 std::shared_ptr<BnStreamCommon> _aidl_impl = std::static_pointer_cast<BnStreamCommon>(::ndk::ICInterface::asInterface(_aidl_binder));
34 switch (_aidl_code) {
35 case (FIRST_CALL_TRANSACTION + 0 /*close*/): {
36
37 ::ndk::ScopedAStatus _aidl_status = _aidl_impl->close();
38 _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
39 if (_aidl_ret_status != STATUS_OK) break;
40
41 if (!AStatus_isOk(_aidl_status.get())) break;
42
43 break;
44 }
45 case (FIRST_CALL_TRANSACTION + 1 /*prepareToClose*/): {
46
47 ::ndk::ScopedAStatus _aidl_status = _aidl_impl->prepareToClose();
48 _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
49 if (_aidl_ret_status != STATUS_OK) break;
50
51 if (!AStatus_isOk(_aidl_status.get())) break;
52
53 break;
54 }
55 case (FIRST_CALL_TRANSACTION + 2 /*updateHwAvSyncId*/): {
56 int32_t in_hwAvSyncId;
57
58 _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_hwAvSyncId);
59 if (_aidl_ret_status != STATUS_OK) break;
60
61 ::ndk::ScopedAStatus _aidl_status = _aidl_impl->updateHwAvSyncId(in_hwAvSyncId);
62 _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
63 if (_aidl_ret_status != STATUS_OK) break;
64
65 if (!AStatus_isOk(_aidl_status.get())) break;
66
67 break;
68 }
69 case (FIRST_CALL_TRANSACTION + 3 /*getVendorParameters*/): {
70 std::vector<std::string> in_ids;
71 std::vector<::aidl::android::hardware::audio::core::VendorParameter> _aidl_return;
72
73 _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_ids);
74 if (_aidl_ret_status != STATUS_OK) break;
75
76 ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getVendorParameters(in_ids, &_aidl_return);
77 _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
78 if (_aidl_ret_status != STATUS_OK) break;
79
80 if (!AStatus_isOk(_aidl_status.get())) break;
81
82 _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
83 if (_aidl_ret_status != STATUS_OK) break;
84
85 break;
86 }
87 case (FIRST_CALL_TRANSACTION + 4 /*setVendorParameters*/): {
88 std::vector<::aidl::android::hardware::audio::core::VendorParameter> in_parameters;
89 bool in_async;
90
91 _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_parameters);
92 if (_aidl_ret_status != STATUS_OK) break;
93
94 _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_async);
95 if (_aidl_ret_status != STATUS_OK) break;
96
97 ::ndk::ScopedAStatus _aidl_status = _aidl_impl->setVendorParameters(in_parameters, in_async);
98 _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
99 if (_aidl_ret_status != STATUS_OK) break;
100
101 if (!AStatus_isOk(_aidl_status.get())) break;
102
103 break;
104 }
105 case (FIRST_CALL_TRANSACTION + 5 /*addEffect*/): {
106 std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect> in_effect;
107
108 _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_effect);
109 if (_aidl_ret_status != STATUS_OK) break;
110
111 ::ndk::ScopedAStatus _aidl_status = _aidl_impl->addEffect(in_effect);
112 _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
113 if (_aidl_ret_status != STATUS_OK) break;
114
115 if (!AStatus_isOk(_aidl_status.get())) break;
116
117 break;
118 }
119 case (FIRST_CALL_TRANSACTION + 6 /*removeEffect*/): {
120 std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect> in_effect;
121
122 _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_effect);
123 if (_aidl_ret_status != STATUS_OK) break;
124
125 ::ndk::ScopedAStatus _aidl_status = _aidl_impl->removeEffect(in_effect);
126 _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
127 if (_aidl_ret_status != STATUS_OK) break;
128
129 if (!AStatus_isOk(_aidl_status.get())) break;
130
131 break;
132 }
133 case (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/): {
134 int32_t _aidl_return;
135
136 ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceVersion(&_aidl_return);
137 _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
138 if (_aidl_ret_status != STATUS_OK) break;
139
140 if (!AStatus_isOk(_aidl_status.get())) break;
141
142 _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
143 if (_aidl_ret_status != STATUS_OK) break;
144
145 break;
146 }
147 case (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/): {
148 std::string _aidl_return;
149
150 ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceHash(&_aidl_return);
151 _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
152 if (_aidl_ret_status != STATUS_OK) break;
153
154 if (!AStatus_isOk(_aidl_status.get())) break;
155
156 _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
157 if (_aidl_ret_status != STATUS_OK) break;
158
159 break;
160 }
161 }
162 return _aidl_ret_status;
163 }
164
165 static const char* _g_aidl_android_hardware_audio_core_IStreamCommon_clazz_code_to_function[] = { "close","prepareToClose","updateHwAvSyncId","getVendorParameters","setVendorParameters","addEffect","removeEffect",};
166 static AIBinder_Class* _g_aidl_android_hardware_audio_core_IStreamCommon_clazz = ::ndk::ICInterface::defineClass(IStreamCommon::descriptor, _aidl_android_hardware_audio_core_IStreamCommon_onTransact, _g_aidl_android_hardware_audio_core_IStreamCommon_clazz_code_to_function, 7);
167
BpStreamCommon(const::ndk::SpAIBinder & binder)168 BpStreamCommon::BpStreamCommon(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
~BpStreamCommon()169 BpStreamCommon::~BpStreamCommon() {}
170
close()171 ::ndk::ScopedAStatus BpStreamCommon::close() {
172 binder_status_t _aidl_ret_status = STATUS_OK;
173 ::ndk::ScopedAStatus _aidl_status;
174 ::ndk::ScopedAParcel _aidl_in;
175 ::ndk::ScopedAParcel _aidl_out;
176
177 _aidl_ret_status = AIBinder_prepareTransaction(asBinderReference().get(), _aidl_in.getR());
178 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
179
180 _aidl_ret_status = AIBinder_transact(
181 asBinderReference().get(),
182 (FIRST_CALL_TRANSACTION + 0 /*close*/),
183 _aidl_in.getR(),
184 _aidl_out.getR(),
185 0
186 #ifdef BINDER_STABILITY_SUPPORT
187 | static_cast<int>(FLAG_PRIVATE_LOCAL)
188 #endif // BINDER_STABILITY_SUPPORT
189 );
190 if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IStreamCommon::getDefaultImpl()) {
191 _aidl_status = IStreamCommon::getDefaultImpl()->close();
192 goto _aidl_status_return;
193 }
194 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
195
196 _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
197 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
198
199 if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
200 _aidl_error:
201 _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
202 _aidl_status_return:
203 return _aidl_status;
204 }
prepareToClose()205 ::ndk::ScopedAStatus BpStreamCommon::prepareToClose() {
206 binder_status_t _aidl_ret_status = STATUS_OK;
207 ::ndk::ScopedAStatus _aidl_status;
208 ::ndk::ScopedAParcel _aidl_in;
209 ::ndk::ScopedAParcel _aidl_out;
210
211 _aidl_ret_status = AIBinder_prepareTransaction(asBinderReference().get(), _aidl_in.getR());
212 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
213
214 _aidl_ret_status = AIBinder_transact(
215 asBinderReference().get(),
216 (FIRST_CALL_TRANSACTION + 1 /*prepareToClose*/),
217 _aidl_in.getR(),
218 _aidl_out.getR(),
219 0
220 #ifdef BINDER_STABILITY_SUPPORT
221 | static_cast<int>(FLAG_PRIVATE_LOCAL)
222 #endif // BINDER_STABILITY_SUPPORT
223 );
224 if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IStreamCommon::getDefaultImpl()) {
225 _aidl_status = IStreamCommon::getDefaultImpl()->prepareToClose();
226 goto _aidl_status_return;
227 }
228 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
229
230 _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
231 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
232
233 if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
234 _aidl_error:
235 _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
236 _aidl_status_return:
237 return _aidl_status;
238 }
updateHwAvSyncId(int32_t in_hwAvSyncId)239 ::ndk::ScopedAStatus BpStreamCommon::updateHwAvSyncId(int32_t in_hwAvSyncId) {
240 binder_status_t _aidl_ret_status = STATUS_OK;
241 ::ndk::ScopedAStatus _aidl_status;
242 ::ndk::ScopedAParcel _aidl_in;
243 ::ndk::ScopedAParcel _aidl_out;
244
245 _aidl_ret_status = AIBinder_prepareTransaction(asBinderReference().get(), _aidl_in.getR());
246 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
247
248 _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_hwAvSyncId);
249 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
250
251 _aidl_ret_status = AIBinder_transact(
252 asBinderReference().get(),
253 (FIRST_CALL_TRANSACTION + 2 /*updateHwAvSyncId*/),
254 _aidl_in.getR(),
255 _aidl_out.getR(),
256 0
257 #ifdef BINDER_STABILITY_SUPPORT
258 | static_cast<int>(FLAG_PRIVATE_LOCAL)
259 #endif // BINDER_STABILITY_SUPPORT
260 );
261 if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IStreamCommon::getDefaultImpl()) {
262 _aidl_status = IStreamCommon::getDefaultImpl()->updateHwAvSyncId(in_hwAvSyncId);
263 goto _aidl_status_return;
264 }
265 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
266
267 _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
268 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
269
270 if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
271 _aidl_error:
272 _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
273 _aidl_status_return:
274 return _aidl_status;
275 }
getVendorParameters(const std::vector<std::string> & in_ids,std::vector<::aidl::android::hardware::audio::core::VendorParameter> * _aidl_return)276 ::ndk::ScopedAStatus BpStreamCommon::getVendorParameters(const std::vector<std::string>& in_ids, std::vector<::aidl::android::hardware::audio::core::VendorParameter>* _aidl_return) {
277 binder_status_t _aidl_ret_status = STATUS_OK;
278 ::ndk::ScopedAStatus _aidl_status;
279 ::ndk::ScopedAParcel _aidl_in;
280 ::ndk::ScopedAParcel _aidl_out;
281
282 _aidl_ret_status = AIBinder_prepareTransaction(asBinderReference().get(), _aidl_in.getR());
283 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
284
285 _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_ids);
286 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
287
288 _aidl_ret_status = AIBinder_transact(
289 asBinderReference().get(),
290 (FIRST_CALL_TRANSACTION + 3 /*getVendorParameters*/),
291 _aidl_in.getR(),
292 _aidl_out.getR(),
293 0
294 #ifdef BINDER_STABILITY_SUPPORT
295 | static_cast<int>(FLAG_PRIVATE_LOCAL)
296 #endif // BINDER_STABILITY_SUPPORT
297 );
298 if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IStreamCommon::getDefaultImpl()) {
299 _aidl_status = IStreamCommon::getDefaultImpl()->getVendorParameters(in_ids, _aidl_return);
300 goto _aidl_status_return;
301 }
302 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
303
304 _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
305 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
306
307 if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
308 _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
309 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
310
311 _aidl_error:
312 _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
313 _aidl_status_return:
314 return _aidl_status;
315 }
setVendorParameters(const std::vector<::aidl::android::hardware::audio::core::VendorParameter> & in_parameters,bool in_async)316 ::ndk::ScopedAStatus BpStreamCommon::setVendorParameters(const std::vector<::aidl::android::hardware::audio::core::VendorParameter>& in_parameters, bool in_async) {
317 binder_status_t _aidl_ret_status = STATUS_OK;
318 ::ndk::ScopedAStatus _aidl_status;
319 ::ndk::ScopedAParcel _aidl_in;
320 ::ndk::ScopedAParcel _aidl_out;
321
322 _aidl_ret_status = AIBinder_prepareTransaction(asBinderReference().get(), _aidl_in.getR());
323 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
324
325 _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_parameters);
326 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
327
328 _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_async);
329 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
330
331 _aidl_ret_status = AIBinder_transact(
332 asBinderReference().get(),
333 (FIRST_CALL_TRANSACTION + 4 /*setVendorParameters*/),
334 _aidl_in.getR(),
335 _aidl_out.getR(),
336 0
337 #ifdef BINDER_STABILITY_SUPPORT
338 | static_cast<int>(FLAG_PRIVATE_LOCAL)
339 #endif // BINDER_STABILITY_SUPPORT
340 );
341 if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IStreamCommon::getDefaultImpl()) {
342 _aidl_status = IStreamCommon::getDefaultImpl()->setVendorParameters(in_parameters, in_async);
343 goto _aidl_status_return;
344 }
345 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
346
347 _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
348 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
349
350 if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
351 _aidl_error:
352 _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
353 _aidl_status_return:
354 return _aidl_status;
355 }
addEffect(const std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect> & in_effect)356 ::ndk::ScopedAStatus BpStreamCommon::addEffect(const std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect>& in_effect) {
357 binder_status_t _aidl_ret_status = STATUS_OK;
358 ::ndk::ScopedAStatus _aidl_status;
359 ::ndk::ScopedAParcel _aidl_in;
360 ::ndk::ScopedAParcel _aidl_out;
361
362 _aidl_ret_status = AIBinder_prepareTransaction(asBinderReference().get(), _aidl_in.getR());
363 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
364
365 _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_effect);
366 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
367
368 _aidl_ret_status = AIBinder_transact(
369 asBinderReference().get(),
370 (FIRST_CALL_TRANSACTION + 5 /*addEffect*/),
371 _aidl_in.getR(),
372 _aidl_out.getR(),
373 0
374 #ifdef BINDER_STABILITY_SUPPORT
375 | static_cast<int>(FLAG_PRIVATE_LOCAL)
376 #endif // BINDER_STABILITY_SUPPORT
377 );
378 if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IStreamCommon::getDefaultImpl()) {
379 _aidl_status = IStreamCommon::getDefaultImpl()->addEffect(in_effect);
380 goto _aidl_status_return;
381 }
382 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
383
384 _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
385 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
386
387 if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
388 _aidl_error:
389 _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
390 _aidl_status_return:
391 return _aidl_status;
392 }
removeEffect(const std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect> & in_effect)393 ::ndk::ScopedAStatus BpStreamCommon::removeEffect(const std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect>& in_effect) {
394 binder_status_t _aidl_ret_status = STATUS_OK;
395 ::ndk::ScopedAStatus _aidl_status;
396 ::ndk::ScopedAParcel _aidl_in;
397 ::ndk::ScopedAParcel _aidl_out;
398
399 _aidl_ret_status = AIBinder_prepareTransaction(asBinderReference().get(), _aidl_in.getR());
400 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
401
402 _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_effect);
403 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
404
405 _aidl_ret_status = AIBinder_transact(
406 asBinderReference().get(),
407 (FIRST_CALL_TRANSACTION + 6 /*removeEffect*/),
408 _aidl_in.getR(),
409 _aidl_out.getR(),
410 0
411 #ifdef BINDER_STABILITY_SUPPORT
412 | static_cast<int>(FLAG_PRIVATE_LOCAL)
413 #endif // BINDER_STABILITY_SUPPORT
414 );
415 if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IStreamCommon::getDefaultImpl()) {
416 _aidl_status = IStreamCommon::getDefaultImpl()->removeEffect(in_effect);
417 goto _aidl_status_return;
418 }
419 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
420
421 _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
422 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
423
424 if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
425 _aidl_error:
426 _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
427 _aidl_status_return:
428 return _aidl_status;
429 }
getInterfaceVersion(int32_t * _aidl_return)430 ::ndk::ScopedAStatus BpStreamCommon::getInterfaceVersion(int32_t* _aidl_return) {
431 binder_status_t _aidl_ret_status = STATUS_OK;
432 ::ndk::ScopedAStatus _aidl_status;
433 if (_aidl_cached_version != -1) {
434 *_aidl_return = _aidl_cached_version;
435 _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
436 return _aidl_status;
437 }
438 ::ndk::ScopedAParcel _aidl_in;
439 ::ndk::ScopedAParcel _aidl_out;
440
441 _aidl_ret_status = AIBinder_prepareTransaction(asBinderReference().get(), _aidl_in.getR());
442 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
443
444 _aidl_ret_status = AIBinder_transact(
445 asBinderReference().get(),
446 (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/),
447 _aidl_in.getR(),
448 _aidl_out.getR(),
449 0
450 #ifdef BINDER_STABILITY_SUPPORT
451 | static_cast<int>(FLAG_PRIVATE_LOCAL)
452 #endif // BINDER_STABILITY_SUPPORT
453 );
454 if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IStreamCommon::getDefaultImpl()) {
455 _aidl_status = IStreamCommon::getDefaultImpl()->getInterfaceVersion(_aidl_return);
456 goto _aidl_status_return;
457 }
458 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
459
460 _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
461 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
462
463 if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
464 _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
465 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
466
467 _aidl_cached_version = *_aidl_return;
468 _aidl_error:
469 _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
470 _aidl_status_return:
471 return _aidl_status;
472 }
getInterfaceHash(std::string * _aidl_return)473 ::ndk::ScopedAStatus BpStreamCommon::getInterfaceHash(std::string* _aidl_return) {
474 binder_status_t _aidl_ret_status = STATUS_OK;
475 ::ndk::ScopedAStatus _aidl_status;
476 const std::lock_guard<std::mutex> lock(_aidl_cached_hash_mutex);
477 if (_aidl_cached_hash != "-1") {
478 *_aidl_return = _aidl_cached_hash;
479 _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
480 return _aidl_status;
481 }
482 ::ndk::ScopedAParcel _aidl_in;
483 ::ndk::ScopedAParcel _aidl_out;
484
485 _aidl_ret_status = AIBinder_prepareTransaction(asBinderReference().get(), _aidl_in.getR());
486 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
487
488 _aidl_ret_status = AIBinder_transact(
489 asBinderReference().get(),
490 (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/),
491 _aidl_in.getR(),
492 _aidl_out.getR(),
493 0
494 #ifdef BINDER_STABILITY_SUPPORT
495 | static_cast<int>(FLAG_PRIVATE_LOCAL)
496 #endif // BINDER_STABILITY_SUPPORT
497 );
498 if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IStreamCommon::getDefaultImpl()) {
499 _aidl_status = IStreamCommon::getDefaultImpl()->getInterfaceHash(_aidl_return);
500 goto _aidl_status_return;
501 }
502 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
503
504 _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
505 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
506
507 if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
508 _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
509 if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
510
511 _aidl_cached_hash = *_aidl_return;
512 _aidl_error:
513 _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
514 _aidl_status_return:
515 return _aidl_status;
516 }
517 // Source for BnStreamCommon
BnStreamCommon()518 BnStreamCommon::BnStreamCommon() {}
~BnStreamCommon()519 BnStreamCommon::~BnStreamCommon() {}
createBinder()520 ::ndk::SpAIBinder BnStreamCommon::createBinder() {
521 AIBinder* binder = AIBinder_new(_g_aidl_android_hardware_audio_core_IStreamCommon_clazz, static_cast<void*>(this));
522 #ifdef BINDER_STABILITY_SUPPORT
523 AIBinder_markVintfStability(binder);
524 #endif // BINDER_STABILITY_SUPPORT
525 return ::ndk::SpAIBinder(binder);
526 }
getInterfaceVersion(int32_t * _aidl_return)527 ::ndk::ScopedAStatus BnStreamCommon::getInterfaceVersion(int32_t* _aidl_return) {
528 *_aidl_return = IStreamCommon::version;
529 return ::ndk::ScopedAStatus(AStatus_newOk());
530 }
getInterfaceHash(std::string * _aidl_return)531 ::ndk::ScopedAStatus BnStreamCommon::getInterfaceHash(std::string* _aidl_return) {
532 *_aidl_return = IStreamCommon::hash;
533 return ::ndk::ScopedAStatus(AStatus_newOk());
534 }
535 // Source for IStreamCommon
536 const char* IStreamCommon::descriptor = "android.hardware.audio.core.IStreamCommon";
IStreamCommon()537 IStreamCommon::IStreamCommon() {}
~IStreamCommon()538 IStreamCommon::~IStreamCommon() {}
539
540
fromBinder(const::ndk::SpAIBinder & binder)541 std::shared_ptr<IStreamCommon> IStreamCommon::fromBinder(const ::ndk::SpAIBinder& binder) {
542 if (!AIBinder_associateClass(binder.get(), _g_aidl_android_hardware_audio_core_IStreamCommon_clazz)) {
543 #if __ANDROID_API__ >= 31
544 const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
545 if (originalClass == nullptr) return nullptr;
546 if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
547 return ::ndk::SharedRefBase::make<BpStreamCommon>(binder);
548 }
549 #endif
550 return nullptr;
551 }
552 std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
553 if (interface) {
554 return std::static_pointer_cast<IStreamCommon>(interface);
555 }
556 return ::ndk::SharedRefBase::make<BpStreamCommon>(binder);
557 }
558
writeToParcel(AParcel * parcel,const std::shared_ptr<IStreamCommon> & instance)559 binder_status_t IStreamCommon::writeToParcel(AParcel* parcel, const std::shared_ptr<IStreamCommon>& instance) {
560 return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
561 }
readFromParcel(const AParcel * parcel,std::shared_ptr<IStreamCommon> * instance)562 binder_status_t IStreamCommon::readFromParcel(const AParcel* parcel, std::shared_ptr<IStreamCommon>* instance) {
563 ::ndk::SpAIBinder binder;
564 binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
565 if (status != STATUS_OK) return status;
566 *instance = IStreamCommon::fromBinder(binder);
567 return STATUS_OK;
568 }
setDefaultImpl(const std::shared_ptr<IStreamCommon> & impl)569 bool IStreamCommon::setDefaultImpl(const std::shared_ptr<IStreamCommon>& impl) {
570 // Only one user of this interface can use this function
571 // at a time. This is a heuristic to detect if two different
572 // users in the same process use this function.
573 assert(!IStreamCommon::default_impl);
574 if (impl) {
575 IStreamCommon::default_impl = impl;
576 return true;
577 }
578 return false;
579 }
getDefaultImpl()580 const std::shared_ptr<IStreamCommon>& IStreamCommon::getDefaultImpl() {
581 return IStreamCommon::default_impl;
582 }
583 std::shared_ptr<IStreamCommon> IStreamCommon::default_impl = nullptr;
close()584 ::ndk::ScopedAStatus IStreamCommonDefault::close() {
585 ::ndk::ScopedAStatus _aidl_status;
586 _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
587 return _aidl_status;
588 }
prepareToClose()589 ::ndk::ScopedAStatus IStreamCommonDefault::prepareToClose() {
590 ::ndk::ScopedAStatus _aidl_status;
591 _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
592 return _aidl_status;
593 }
updateHwAvSyncId(int32_t)594 ::ndk::ScopedAStatus IStreamCommonDefault::updateHwAvSyncId(int32_t /*in_hwAvSyncId*/) {
595 ::ndk::ScopedAStatus _aidl_status;
596 _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
597 return _aidl_status;
598 }
getVendorParameters(const std::vector<std::string> &,std::vector<::aidl::android::hardware::audio::core::VendorParameter> *)599 ::ndk::ScopedAStatus IStreamCommonDefault::getVendorParameters(const std::vector<std::string>& /*in_ids*/, std::vector<::aidl::android::hardware::audio::core::VendorParameter>* /*_aidl_return*/) {
600 ::ndk::ScopedAStatus _aidl_status;
601 _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
602 return _aidl_status;
603 }
setVendorParameters(const std::vector<::aidl::android::hardware::audio::core::VendorParameter> &,bool)604 ::ndk::ScopedAStatus IStreamCommonDefault::setVendorParameters(const std::vector<::aidl::android::hardware::audio::core::VendorParameter>& /*in_parameters*/, bool /*in_async*/) {
605 ::ndk::ScopedAStatus _aidl_status;
606 _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
607 return _aidl_status;
608 }
addEffect(const std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect> &)609 ::ndk::ScopedAStatus IStreamCommonDefault::addEffect(const std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect>& /*in_effect*/) {
610 ::ndk::ScopedAStatus _aidl_status;
611 _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
612 return _aidl_status;
613 }
removeEffect(const std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect> &)614 ::ndk::ScopedAStatus IStreamCommonDefault::removeEffect(const std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect>& /*in_effect*/) {
615 ::ndk::ScopedAStatus _aidl_status;
616 _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
617 return _aidl_status;
618 }
getInterfaceVersion(int32_t * _aidl_return)619 ::ndk::ScopedAStatus IStreamCommonDefault::getInterfaceVersion(int32_t* _aidl_return) {
620 *_aidl_return = 0;
621 return ::ndk::ScopedAStatus(AStatus_newOk());
622 }
getInterfaceHash(std::string * _aidl_return)623 ::ndk::ScopedAStatus IStreamCommonDefault::getInterfaceHash(std::string* _aidl_return) {
624 *_aidl_return = "";
625 return ::ndk::ScopedAStatus(AStatus_newOk());
626 }
asBinder()627 ::ndk::SpAIBinder IStreamCommonDefault::asBinder() {
628 return ::ndk::SpAIBinder();
629 }
isRemote()630 bool IStreamCommonDefault::isRemote() {
631 return false;
632 }
633 } // namespace core
634 } // namespace audio
635 } // namespace hardware
636 } // namespace android
637 } // namespace aidl
638