| #include <android/binder_parcel_utils.h> |
| #include <aidl/android/hardware/identity/BpWritableIdentityCredential.h> |
| #include <aidl/android/hardware/identity/BnWritableIdentityCredential.h> |
| #include <aidl/android/hardware/identity/IWritableIdentityCredential.h> |
| |
| namespace aidl { |
| namespace android { |
| namespace hardware { |
| namespace identity { |
| static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) { |
| (void)_aidl_in; |
| (void)_aidl_out; |
| binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION; |
| std::shared_ptr<BnWritableIdentityCredential> _aidl_impl = std::static_pointer_cast<BnWritableIdentityCredential>(::ndk::ICInterface::asInterface(_aidl_binder)); |
| switch (_aidl_code) { |
| case (FIRST_CALL_TRANSACTION + 0 /*getAttestationCertificate*/): { |
| std::vector<uint8_t> in_attestationApplicationId; |
| std::vector<uint8_t> in_attestationChallenge; |
| std::vector<::aidl::android::hardware::identity::Certificate> _aidl_return; |
| |
| _aidl_ret_status = ::ndk::AParcel_readVector(_aidl_in, &in_attestationApplicationId); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| _aidl_ret_status = ::ndk::AParcel_readVector(_aidl_in, &in_attestationChallenge); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getAttestationCertificate(in_attestationApplicationId, in_attestationChallenge, &_aidl_return); |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| if (!AStatus_isOk(_aidl_status.get())) break; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeVector(_aidl_out, _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| break; |
| } |
| case (FIRST_CALL_TRANSACTION + 1 /*startPersonalization*/): { |
| int32_t in_accessControlProfileCount; |
| std::vector<int32_t> in_entryCounts; |
| |
| _aidl_ret_status = AParcel_readInt32(_aidl_in, &in_accessControlProfileCount); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| _aidl_ret_status = ::ndk::AParcel_readVector(_aidl_in, &in_entryCounts); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->startPersonalization(in_accessControlProfileCount, in_entryCounts); |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| if (!AStatus_isOk(_aidl_status.get())) break; |
| |
| break; |
| } |
| case (FIRST_CALL_TRANSACTION + 2 /*addAccessControlProfile*/): { |
| int32_t in_id; |
| ::aidl::android::hardware::identity::Certificate in_readerCertificate; |
| bool in_userAuthenticationRequired; |
| int64_t in_timeoutMillis; |
| int64_t in_secureUserId; |
| ::aidl::android::hardware::identity::SecureAccessControlProfile _aidl_return; |
| |
| _aidl_ret_status = AParcel_readInt32(_aidl_in, &in_id); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| _aidl_ret_status = ::ndk::AParcel_readParcelable(_aidl_in, &in_readerCertificate); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| _aidl_ret_status = AParcel_readBool(_aidl_in, &in_userAuthenticationRequired); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| _aidl_ret_status = AParcel_readInt64(_aidl_in, &in_timeoutMillis); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| _aidl_ret_status = AParcel_readInt64(_aidl_in, &in_secureUserId); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->addAccessControlProfile(in_id, in_readerCertificate, in_userAuthenticationRequired, in_timeoutMillis, in_secureUserId, &_aidl_return); |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| if (!AStatus_isOk(_aidl_status.get())) break; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeParcelable(_aidl_out, _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| break; |
| } |
| case (FIRST_CALL_TRANSACTION + 3 /*beginAddEntry*/): { |
| std::vector<int32_t> in_accessControlProfileIds; |
| std::string in_nameSpace; |
| std::string in_name; |
| int32_t in_entrySize; |
| |
| _aidl_ret_status = ::ndk::AParcel_readVector(_aidl_in, &in_accessControlProfileIds); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| _aidl_ret_status = ::ndk::AParcel_readString(_aidl_in, &in_nameSpace); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| _aidl_ret_status = ::ndk::AParcel_readString(_aidl_in, &in_name); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| _aidl_ret_status = AParcel_readInt32(_aidl_in, &in_entrySize); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->beginAddEntry(in_accessControlProfileIds, in_nameSpace, in_name, in_entrySize); |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| if (!AStatus_isOk(_aidl_status.get())) break; |
| |
| break; |
| } |
| case (FIRST_CALL_TRANSACTION + 4 /*addEntryValue*/): { |
| std::vector<uint8_t> in_content; |
| std::vector<uint8_t> _aidl_return; |
| |
| _aidl_ret_status = ::ndk::AParcel_readVector(_aidl_in, &in_content); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->addEntryValue(in_content, &_aidl_return); |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| if (!AStatus_isOk(_aidl_status.get())) break; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeVector(_aidl_out, _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| break; |
| } |
| case (FIRST_CALL_TRANSACTION + 5 /*finishAddingEntries*/): { |
| std::vector<uint8_t> out_credentialData; |
| std::vector<uint8_t> out_proofOfProvisioningSignature; |
| |
| _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_credentialData); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_proofOfProvisioningSignature); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->finishAddingEntries(&out_credentialData, &out_proofOfProvisioningSignature); |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| if (!AStatus_isOk(_aidl_status.get())) break; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeVector(_aidl_out, out_credentialData); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeVector(_aidl_out, out_proofOfProvisioningSignature); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| break; |
| } |
| case (FIRST_CALL_TRANSACTION + 6 /*setExpectedProofOfProvisioningSize*/): { |
| int32_t in_expectedProofOfProvisioningSize; |
| |
| _aidl_ret_status = AParcel_readInt32(_aidl_in, &in_expectedProofOfProvisioningSize); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->setExpectedProofOfProvisioningSize(in_expectedProofOfProvisioningSize); |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| if (!AStatus_isOk(_aidl_status.get())) break; |
| |
| break; |
| } |
| case (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/): { |
| int32_t _aidl_return; |
| |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceVersion(&_aidl_return); |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| if (!AStatus_isOk(_aidl_status.get())) break; |
| |
| _aidl_ret_status = AParcel_writeInt32(_aidl_out, _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| break; |
| } |
| case (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/): { |
| std::string _aidl_return; |
| |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceHash(&_aidl_return); |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| if (!AStatus_isOk(_aidl_status.get())) break; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeString(_aidl_out, _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| break; |
| } |
| } |
| return _aidl_ret_status; |
| } |
| |
| static AIBinder_Class* _g_aidl_clazz = ::ndk::ICInterface::defineClass(IWritableIdentityCredential::descriptor, _aidl_onTransact); |
| |
| BpWritableIdentityCredential::BpWritableIdentityCredential(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {} |
| BpWritableIdentityCredential::~BpWritableIdentityCredential() {} |
| |
| ::ndk::ScopedAStatus BpWritableIdentityCredential::getAttestationCertificate(const std::vector<uint8_t>& in_attestationApplicationId, const std::vector<uint8_t>& in_attestationChallenge, std::vector<::aidl::android::hardware::identity::Certificate>* _aidl_return) { |
| binder_status_t _aidl_ret_status = STATUS_OK; |
| ::ndk::ScopedAStatus _aidl_status; |
| ::ndk::ScopedAParcel _aidl_in; |
| ::ndk::ScopedAParcel _aidl_out; |
| |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeVector(_aidl_in.get(), in_attestationApplicationId); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeVector(_aidl_in.get(), in_attestationChallenge); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AIBinder_transact( |
| asBinder().get(), |
| (FIRST_CALL_TRANSACTION + 0 /*getAttestationCertificate*/), |
| _aidl_in.getR(), |
| _aidl_out.getR(), |
| 0 |
| #ifdef BINDER_STABILITY_SUPPORT |
| | FLAG_PRIVATE_LOCAL |
| #endif // BINDER_STABILITY_SUPPORT |
| ); |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IWritableIdentityCredential::getDefaultImpl()) { |
| _aidl_status = IWritableIdentityCredential::getDefaultImpl()->getAttestationCertificate(in_attestationApplicationId, in_attestationChallenge, _aidl_return); |
| goto _aidl_status_return; |
| } |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; |
| _aidl_ret_status = ::ndk::AParcel_readVector(_aidl_out.get(), _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_error: |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| _aidl_status_return: |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus BpWritableIdentityCredential::startPersonalization(int32_t in_accessControlProfileCount, const std::vector<int32_t>& in_entryCounts) { |
| binder_status_t _aidl_ret_status = STATUS_OK; |
| ::ndk::ScopedAStatus _aidl_status; |
| ::ndk::ScopedAParcel _aidl_in; |
| ::ndk::ScopedAParcel _aidl_out; |
| |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_writeInt32(_aidl_in.get(), in_accessControlProfileCount); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeVector(_aidl_in.get(), in_entryCounts); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AIBinder_transact( |
| asBinder().get(), |
| (FIRST_CALL_TRANSACTION + 1 /*startPersonalization*/), |
| _aidl_in.getR(), |
| _aidl_out.getR(), |
| 0 |
| #ifdef BINDER_STABILITY_SUPPORT |
| | FLAG_PRIVATE_LOCAL |
| #endif // BINDER_STABILITY_SUPPORT |
| ); |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IWritableIdentityCredential::getDefaultImpl()) { |
| _aidl_status = IWritableIdentityCredential::getDefaultImpl()->startPersonalization(in_accessControlProfileCount, in_entryCounts); |
| goto _aidl_status_return; |
| } |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; |
| _aidl_error: |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| _aidl_status_return: |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus BpWritableIdentityCredential::addAccessControlProfile(int32_t in_id, const ::aidl::android::hardware::identity::Certificate& in_readerCertificate, bool in_userAuthenticationRequired, int64_t in_timeoutMillis, int64_t in_secureUserId, ::aidl::android::hardware::identity::SecureAccessControlProfile* _aidl_return) { |
| binder_status_t _aidl_ret_status = STATUS_OK; |
| ::ndk::ScopedAStatus _aidl_status; |
| ::ndk::ScopedAParcel _aidl_in; |
| ::ndk::ScopedAParcel _aidl_out; |
| |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_writeInt32(_aidl_in.get(), in_id); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeParcelable(_aidl_in.get(), in_readerCertificate); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_writeBool(_aidl_in.get(), in_userAuthenticationRequired); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_writeInt64(_aidl_in.get(), in_timeoutMillis); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_writeInt64(_aidl_in.get(), in_secureUserId); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AIBinder_transact( |
| asBinder().get(), |
| (FIRST_CALL_TRANSACTION + 2 /*addAccessControlProfile*/), |
| _aidl_in.getR(), |
| _aidl_out.getR(), |
| 0 |
| #ifdef BINDER_STABILITY_SUPPORT |
| | FLAG_PRIVATE_LOCAL |
| #endif // BINDER_STABILITY_SUPPORT |
| ); |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IWritableIdentityCredential::getDefaultImpl()) { |
| _aidl_status = IWritableIdentityCredential::getDefaultImpl()->addAccessControlProfile(in_id, in_readerCertificate, in_userAuthenticationRequired, in_timeoutMillis, in_secureUserId, _aidl_return); |
| goto _aidl_status_return; |
| } |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; |
| _aidl_ret_status = ::ndk::AParcel_readParcelable(_aidl_out.get(), _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_error: |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| _aidl_status_return: |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus BpWritableIdentityCredential::beginAddEntry(const std::vector<int32_t>& in_accessControlProfileIds, const std::string& in_nameSpace, const std::string& in_name, int32_t in_entrySize) { |
| binder_status_t _aidl_ret_status = STATUS_OK; |
| ::ndk::ScopedAStatus _aidl_status; |
| ::ndk::ScopedAParcel _aidl_in; |
| ::ndk::ScopedAParcel _aidl_out; |
| |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeVector(_aidl_in.get(), in_accessControlProfileIds); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeString(_aidl_in.get(), in_nameSpace); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeString(_aidl_in.get(), in_name); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_writeInt32(_aidl_in.get(), in_entrySize); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AIBinder_transact( |
| asBinder().get(), |
| (FIRST_CALL_TRANSACTION + 3 /*beginAddEntry*/), |
| _aidl_in.getR(), |
| _aidl_out.getR(), |
| 0 |
| #ifdef BINDER_STABILITY_SUPPORT |
| | FLAG_PRIVATE_LOCAL |
| #endif // BINDER_STABILITY_SUPPORT |
| ); |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IWritableIdentityCredential::getDefaultImpl()) { |
| _aidl_status = IWritableIdentityCredential::getDefaultImpl()->beginAddEntry(in_accessControlProfileIds, in_nameSpace, in_name, in_entrySize); |
| goto _aidl_status_return; |
| } |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; |
| _aidl_error: |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| _aidl_status_return: |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus BpWritableIdentityCredential::addEntryValue(const std::vector<uint8_t>& in_content, std::vector<uint8_t>* _aidl_return) { |
| binder_status_t _aidl_ret_status = STATUS_OK; |
| ::ndk::ScopedAStatus _aidl_status; |
| ::ndk::ScopedAParcel _aidl_in; |
| ::ndk::ScopedAParcel _aidl_out; |
| |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeVector(_aidl_in.get(), in_content); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AIBinder_transact( |
| asBinder().get(), |
| (FIRST_CALL_TRANSACTION + 4 /*addEntryValue*/), |
| _aidl_in.getR(), |
| _aidl_out.getR(), |
| 0 |
| #ifdef BINDER_STABILITY_SUPPORT |
| | FLAG_PRIVATE_LOCAL |
| #endif // BINDER_STABILITY_SUPPORT |
| ); |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IWritableIdentityCredential::getDefaultImpl()) { |
| _aidl_status = IWritableIdentityCredential::getDefaultImpl()->addEntryValue(in_content, _aidl_return); |
| goto _aidl_status_return; |
| } |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; |
| _aidl_ret_status = ::ndk::AParcel_readVector(_aidl_out.get(), _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_error: |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| _aidl_status_return: |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus BpWritableIdentityCredential::finishAddingEntries(std::vector<uint8_t>* out_credentialData, std::vector<uint8_t>* out_proofOfProvisioningSignature) { |
| binder_status_t _aidl_ret_status = STATUS_OK; |
| ::ndk::ScopedAStatus _aidl_status; |
| ::ndk::ScopedAParcel _aidl_in; |
| ::ndk::ScopedAParcel _aidl_out; |
| |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_credentialData); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_proofOfProvisioningSignature); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AIBinder_transact( |
| asBinder().get(), |
| (FIRST_CALL_TRANSACTION + 5 /*finishAddingEntries*/), |
| _aidl_in.getR(), |
| _aidl_out.getR(), |
| 0 |
| #ifdef BINDER_STABILITY_SUPPORT |
| | FLAG_PRIVATE_LOCAL |
| #endif // BINDER_STABILITY_SUPPORT |
| ); |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IWritableIdentityCredential::getDefaultImpl()) { |
| _aidl_status = IWritableIdentityCredential::getDefaultImpl()->finishAddingEntries(out_credentialData, out_proofOfProvisioningSignature); |
| goto _aidl_status_return; |
| } |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; |
| _aidl_ret_status = ::ndk::AParcel_readVector(_aidl_out.get(), out_credentialData); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = ::ndk::AParcel_readVector(_aidl_out.get(), out_proofOfProvisioningSignature); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_error: |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| _aidl_status_return: |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus BpWritableIdentityCredential::setExpectedProofOfProvisioningSize(int32_t in_expectedProofOfProvisioningSize) { |
| binder_status_t _aidl_ret_status = STATUS_OK; |
| ::ndk::ScopedAStatus _aidl_status; |
| ::ndk::ScopedAParcel _aidl_in; |
| ::ndk::ScopedAParcel _aidl_out; |
| |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_writeInt32(_aidl_in.get(), in_expectedProofOfProvisioningSize); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AIBinder_transact( |
| asBinder().get(), |
| (FIRST_CALL_TRANSACTION + 6 /*setExpectedProofOfProvisioningSize*/), |
| _aidl_in.getR(), |
| _aidl_out.getR(), |
| 0 |
| #ifdef BINDER_STABILITY_SUPPORT |
| | FLAG_PRIVATE_LOCAL |
| #endif // BINDER_STABILITY_SUPPORT |
| ); |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IWritableIdentityCredential::getDefaultImpl()) { |
| _aidl_status = IWritableIdentityCredential::getDefaultImpl()->setExpectedProofOfProvisioningSize(in_expectedProofOfProvisioningSize); |
| goto _aidl_status_return; |
| } |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; |
| _aidl_error: |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| _aidl_status_return: |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus BpWritableIdentityCredential::getInterfaceVersion(int32_t* _aidl_return) { |
| binder_status_t _aidl_ret_status = STATUS_OK; |
| ::ndk::ScopedAStatus _aidl_status; |
| if (_aidl_cached_version != -1) { |
| *_aidl_return = _aidl_cached_version; |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| return _aidl_status; |
| } |
| ::ndk::ScopedAParcel _aidl_in; |
| ::ndk::ScopedAParcel _aidl_out; |
| |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AIBinder_transact( |
| asBinder().get(), |
| (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/), |
| _aidl_in.getR(), |
| _aidl_out.getR(), |
| 0 |
| #ifdef BINDER_STABILITY_SUPPORT |
| | FLAG_PRIVATE_LOCAL |
| #endif // BINDER_STABILITY_SUPPORT |
| ); |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IWritableIdentityCredential::getDefaultImpl()) { |
| _aidl_status = IWritableIdentityCredential::getDefaultImpl()->getInterfaceVersion(_aidl_return); |
| goto _aidl_status_return; |
| } |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; |
| _aidl_ret_status = AParcel_readInt32(_aidl_out.get(), _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_cached_version = *_aidl_return; |
| _aidl_error: |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| _aidl_status_return: |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus BpWritableIdentityCredential::getInterfaceHash(std::string* _aidl_return) { |
| binder_status_t _aidl_ret_status = STATUS_OK; |
| ::ndk::ScopedAStatus _aidl_status; |
| const std::lock_guard<std::mutex> lock(_aidl_cached_hash_mutex); |
| if (_aidl_cached_hash != "-1") { |
| *_aidl_return = _aidl_cached_hash; |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| return _aidl_status; |
| } |
| ::ndk::ScopedAParcel _aidl_in; |
| ::ndk::ScopedAParcel _aidl_out; |
| |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AIBinder_transact( |
| asBinder().get(), |
| (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/), |
| _aidl_in.getR(), |
| _aidl_out.getR(), |
| 0 |
| #ifdef BINDER_STABILITY_SUPPORT |
| | FLAG_PRIVATE_LOCAL |
| #endif // BINDER_STABILITY_SUPPORT |
| ); |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IWritableIdentityCredential::getDefaultImpl()) { |
| _aidl_status = IWritableIdentityCredential::getDefaultImpl()->getInterfaceHash(_aidl_return); |
| goto _aidl_status_return; |
| } |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; |
| _aidl_ret_status = ::ndk::AParcel_readString(_aidl_out.get(), _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_cached_hash = *_aidl_return; |
| _aidl_error: |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| _aidl_status_return: |
| return _aidl_status; |
| } |
| // Source for BnWritableIdentityCredential |
| BnWritableIdentityCredential::BnWritableIdentityCredential() {} |
| BnWritableIdentityCredential::~BnWritableIdentityCredential() {} |
| ::ndk::SpAIBinder BnWritableIdentityCredential::createBinder() { |
| AIBinder* binder = AIBinder_new(_g_aidl_clazz, static_cast<void*>(this)); |
| #ifdef BINDER_STABILITY_SUPPORT |
| AIBinder_markVintfStability(binder); |
| #endif // BINDER_STABILITY_SUPPORT |
| return ::ndk::SpAIBinder(binder); |
| } |
| ::ndk::ScopedAStatus BnWritableIdentityCredential::getInterfaceVersion(int32_t* _aidl_return) { |
| *_aidl_return = IWritableIdentityCredential::version; |
| return ::ndk::ScopedAStatus(AStatus_newOk()); |
| } |
| ::ndk::ScopedAStatus BnWritableIdentityCredential::getInterfaceHash(std::string* _aidl_return) { |
| *_aidl_return = IWritableIdentityCredential::hash; |
| return ::ndk::ScopedAStatus(AStatus_newOk()); |
| } |
| // Source for IWritableIdentityCredential |
| const char* IWritableIdentityCredential::descriptor = "android.hardware.identity.IWritableIdentityCredential"; |
| IWritableIdentityCredential::IWritableIdentityCredential() {} |
| IWritableIdentityCredential::~IWritableIdentityCredential() {} |
| |
| |
| std::shared_ptr<IWritableIdentityCredential> IWritableIdentityCredential::fromBinder(const ::ndk::SpAIBinder& binder) { |
| if (!AIBinder_associateClass(binder.get(), _g_aidl_clazz)) { return nullptr; } |
| std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get()); |
| if (interface) { |
| return std::static_pointer_cast<IWritableIdentityCredential>(interface); |
| } |
| return ::ndk::SharedRefBase::make<BpWritableIdentityCredential>(binder); |
| } |
| |
| binder_status_t IWritableIdentityCredential::writeToParcel(AParcel* parcel, const std::shared_ptr<IWritableIdentityCredential>& instance) { |
| return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr); |
| } |
| binder_status_t IWritableIdentityCredential::readFromParcel(const AParcel* parcel, std::shared_ptr<IWritableIdentityCredential>* instance) { |
| ::ndk::SpAIBinder binder; |
| binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR()); |
| if (status != STATUS_OK) return status; |
| *instance = IWritableIdentityCredential::fromBinder(binder); |
| return STATUS_OK; |
| } |
| bool IWritableIdentityCredential::setDefaultImpl(const std::shared_ptr<IWritableIdentityCredential>& impl) { |
| // Only one user of this interface can use this function |
| // at a time. This is a heuristic to detect if two different |
| // users in the same process use this function. |
| assert(!IWritableIdentityCredential::default_impl); |
| if (impl) { |
| IWritableIdentityCredential::default_impl = impl; |
| return true; |
| } |
| return false; |
| } |
| const std::shared_ptr<IWritableIdentityCredential>& IWritableIdentityCredential::getDefaultImpl() { |
| return IWritableIdentityCredential::default_impl; |
| } |
| std::shared_ptr<IWritableIdentityCredential> IWritableIdentityCredential::default_impl = nullptr; |
| ::ndk::ScopedAStatus IWritableIdentityCredentialDefault::getAttestationCertificate(const std::vector<uint8_t>& /*in_attestationApplicationId*/, const std::vector<uint8_t>& /*in_attestationChallenge*/, std::vector<::aidl::android::hardware::identity::Certificate>* /*_aidl_return*/) { |
| ::ndk::ScopedAStatus _aidl_status; |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus IWritableIdentityCredentialDefault::startPersonalization(int32_t /*in_accessControlProfileCount*/, const std::vector<int32_t>& /*in_entryCounts*/) { |
| ::ndk::ScopedAStatus _aidl_status; |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus IWritableIdentityCredentialDefault::addAccessControlProfile(int32_t /*in_id*/, const ::aidl::android::hardware::identity::Certificate& /*in_readerCertificate*/, bool /*in_userAuthenticationRequired*/, int64_t /*in_timeoutMillis*/, int64_t /*in_secureUserId*/, ::aidl::android::hardware::identity::SecureAccessControlProfile* /*_aidl_return*/) { |
| ::ndk::ScopedAStatus _aidl_status; |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus IWritableIdentityCredentialDefault::beginAddEntry(const std::vector<int32_t>& /*in_accessControlProfileIds*/, const std::string& /*in_nameSpace*/, const std::string& /*in_name*/, int32_t /*in_entrySize*/) { |
| ::ndk::ScopedAStatus _aidl_status; |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus IWritableIdentityCredentialDefault::addEntryValue(const std::vector<uint8_t>& /*in_content*/, std::vector<uint8_t>* /*_aidl_return*/) { |
| ::ndk::ScopedAStatus _aidl_status; |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus IWritableIdentityCredentialDefault::finishAddingEntries(std::vector<uint8_t>* /*out_credentialData*/, std::vector<uint8_t>* /*out_proofOfProvisioningSignature*/) { |
| ::ndk::ScopedAStatus _aidl_status; |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus IWritableIdentityCredentialDefault::setExpectedProofOfProvisioningSize(int32_t /*in_expectedProofOfProvisioningSize*/) { |
| ::ndk::ScopedAStatus _aidl_status; |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus IWritableIdentityCredentialDefault::getInterfaceVersion(int32_t* _aidl_return) { |
| *_aidl_return = 0; |
| return ::ndk::ScopedAStatus(AStatus_newOk()); |
| } |
| ::ndk::ScopedAStatus IWritableIdentityCredentialDefault::getInterfaceHash(std::string* _aidl_return) { |
| *_aidl_return = ""; |
| return ::ndk::ScopedAStatus(AStatus_newOk()); |
| } |
| ::ndk::SpAIBinder IWritableIdentityCredentialDefault::asBinder() { |
| return ::ndk::SpAIBinder(); |
| } |
| bool IWritableIdentityCredentialDefault::isRemote() { |
| return false; |
| } |
| } // namespace identity |
| } // namespace hardware |
| } // namespace android |
| } // namespace aidl |