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