/* * This file is auto-generated. DO NOT MODIFY. * Using: /home/iscle/Android/Sdk/build-tools/35.0.1/aidl --lang=ndk -o generated -h generated/include --structured --stability=vintf --min_sdk_version=31 -I hardware_interfaces/common/aidl/aidl_api/android.hardware.common/current/ -I hardware_interfaces/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/ -I hardware_interfaces/audio/aidl/aidl_api/android.hardware.audio.common/current/ -I hardware_interfaces/audio/aidl/aidl_api/android.hardware.audio.effect/current/ -I system_hardware_interfaces/media/aidl_api/android.media.audio.common.types/current/ -I system_hardware_interfaces/media/aidl_api/android.media.audio.eraser.types/current/ hardware_interfaces/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/IFactory.aidl */ #include "aidl/android/hardware/audio/effect/IFactory.h" #include #include #include #include #include #include #include #include #include namespace aidl { namespace android { namespace hardware { namespace audio { namespace effect { static binder_status_t _aidl_android_hardware_audio_effect_IFactory_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 _aidl_impl = std::static_pointer_cast(::ndk::ICInterface::asInterface(_aidl_binder)); switch (_aidl_code) { case (FIRST_CALL_TRANSACTION + 0 /*queryEffects*/): { std::optional<::aidl::android::media::audio::common::AudioUuid> in_type; std::optional<::aidl::android::media::audio::common::AudioUuid> in_implementation; std::optional<::aidl::android::media::audio::common::AudioUuid> in_proxy; std::vector<::aidl::android::hardware::audio::effect::Descriptor> _aidl_return; _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_type); if (_aidl_ret_status != STATUS_OK) break; _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_implementation); if (_aidl_ret_status != STATUS_OK) break; _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_proxy); if (_aidl_ret_status != STATUS_OK) break; ::ndk::ScopedAStatus _aidl_status = _aidl_impl->queryEffects(in_type, in_implementation, in_proxy, &_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_writeData(_aidl_out, _aidl_return); if (_aidl_ret_status != STATUS_OK) break; break; } case (FIRST_CALL_TRANSACTION + 1 /*queryProcessing*/): { std::optional<::aidl::android::hardware::audio::effect::Processing::Type> in_type; std::vector<::aidl::android::hardware::audio::effect::Processing> _aidl_return; _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_type); if (_aidl_ret_status != STATUS_OK) break; ::ndk::ScopedAStatus _aidl_status = _aidl_impl->queryProcessing(in_type, &_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_writeData(_aidl_out, _aidl_return); if (_aidl_ret_status != STATUS_OK) break; break; } case (FIRST_CALL_TRANSACTION + 2 /*createEffect*/): { ::aidl::android::media::audio::common::AudioUuid in_implUuid; std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect> _aidl_return; _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_implUuid); if (_aidl_ret_status != STATUS_OK) break; ::ndk::ScopedAStatus _aidl_status = _aidl_impl->createEffect(in_implUuid, &_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_writeData(_aidl_out, _aidl_return); if (_aidl_ret_status != STATUS_OK) break; break; } case (FIRST_CALL_TRANSACTION + 3 /*destroyEffect*/): { std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect> in_handle; _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_handle); if (_aidl_ret_status != STATUS_OK) break; ::ndk::ScopedAStatus _aidl_status = _aidl_impl->destroyEffect(in_handle); _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; } } return _aidl_ret_status; } static AIBinder_Class* _g_aidl_android_hardware_audio_effect_IFactory_clazz = ::ndk::ICInterface::defineClass(IFactory::descriptor, _aidl_android_hardware_audio_effect_IFactory_onTransact); BpFactory::BpFactory(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {} BpFactory::~BpFactory() {} ::ndk::ScopedAStatus BpFactory::queryEffects(const std::optional<::aidl::android::media::audio::common::AudioUuid>& in_type, const std::optional<::aidl::android::media::audio::common::AudioUuid>& in_implementation, const std::optional<::aidl::android::media::audio::common::AudioUuid>& in_proxy, std::vector<::aidl::android::hardware::audio::effect::Descriptor>* _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_writeNullableData(_aidl_in.get(), in_type); if (_aidl_ret_status != STATUS_OK) goto _aidl_error; _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_implementation); if (_aidl_ret_status != STATUS_OK) goto _aidl_error; _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_proxy); if (_aidl_ret_status != STATUS_OK) goto _aidl_error; _aidl_ret_status = AIBinder_transact( asBinder().get(), (FIRST_CALL_TRANSACTION + 0 /*queryEffects*/), _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 && IFactory::getDefaultImpl()) { _aidl_status = IFactory::getDefaultImpl()->queryEffects(in_type, in_implementation, in_proxy, _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_readData(_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 BpFactory::queryProcessing(const std::optional<::aidl::android::hardware::audio::effect::Processing::Type>& in_type, std::vector<::aidl::android::hardware::audio::effect::Processing>* _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_writeNullableData(_aidl_in.get(), in_type); if (_aidl_ret_status != STATUS_OK) goto _aidl_error; _aidl_ret_status = AIBinder_transact( asBinder().get(), (FIRST_CALL_TRANSACTION + 1 /*queryProcessing*/), _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 && IFactory::getDefaultImpl()) { _aidl_status = IFactory::getDefaultImpl()->queryProcessing(in_type, _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_readData(_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 BpFactory::createEffect(const ::aidl::android::media::audio::common::AudioUuid& in_implUuid, std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect>* _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_writeData(_aidl_in.get(), in_implUuid); if (_aidl_ret_status != STATUS_OK) goto _aidl_error; _aidl_ret_status = AIBinder_transact( asBinder().get(), (FIRST_CALL_TRANSACTION + 2 /*createEffect*/), _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 && IFactory::getDefaultImpl()) { _aidl_status = IFactory::getDefaultImpl()->createEffect(in_implUuid, _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_readData(_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 BpFactory::destroyEffect(const std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect>& in_handle) { 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_writeData(_aidl_in.get(), in_handle); if (_aidl_ret_status != STATUS_OK) goto _aidl_error; _aidl_ret_status = AIBinder_transact( asBinder().get(), (FIRST_CALL_TRANSACTION + 3 /*destroyEffect*/), _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 && IFactory::getDefaultImpl()) { _aidl_status = IFactory::getDefaultImpl()->destroyEffect(in_handle); 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; } // Source for BnFactory BnFactory::BnFactory() {} BnFactory::~BnFactory() {} ::ndk::SpAIBinder BnFactory::createBinder() { AIBinder* binder = AIBinder_new(_g_aidl_android_hardware_audio_effect_IFactory_clazz, static_cast(this)); #ifdef BINDER_STABILITY_SUPPORT AIBinder_markVintfStability(binder); #endif // BINDER_STABILITY_SUPPORT return ::ndk::SpAIBinder(binder); } // Source for IFactory const char* IFactory::descriptor = "android.hardware.audio.effect.IFactory"; IFactory::IFactory() {} IFactory::~IFactory() {} std::shared_ptr IFactory::fromBinder(const ::ndk::SpAIBinder& binder) { if (!AIBinder_associateClass(binder.get(), _g_aidl_android_hardware_audio_effect_IFactory_clazz)) { #if __ANDROID_API__ >= 31 const AIBinder_Class* originalClass = AIBinder_getClass(binder.get()); if (originalClass == nullptr) return nullptr; if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) { return ::ndk::SharedRefBase::make(binder); } #endif return nullptr; } std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get()); if (interface) { return std::static_pointer_cast(interface); } return ::ndk::SharedRefBase::make(binder); } binder_status_t IFactory::writeToParcel(AParcel* parcel, const std::shared_ptr& instance) { return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr); } binder_status_t IFactory::readFromParcel(const AParcel* parcel, std::shared_ptr* instance) { ::ndk::SpAIBinder binder; binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR()); if (status != STATUS_OK) return status; *instance = IFactory::fromBinder(binder); return STATUS_OK; } bool IFactory::setDefaultImpl(const std::shared_ptr& 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(!IFactory::default_impl); if (impl) { IFactory::default_impl = impl; return true; } return false; } const std::shared_ptr& IFactory::getDefaultImpl() { return IFactory::default_impl; } std::shared_ptr IFactory::default_impl = nullptr; ::ndk::ScopedAStatus IFactoryDefault::queryEffects(const std::optional<::aidl::android::media::audio::common::AudioUuid>& /*in_type*/, const std::optional<::aidl::android::media::audio::common::AudioUuid>& /*in_implementation*/, const std::optional<::aidl::android::media::audio::common::AudioUuid>& /*in_proxy*/, std::vector<::aidl::android::hardware::audio::effect::Descriptor>* /*_aidl_return*/) { ::ndk::ScopedAStatus _aidl_status; _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); return _aidl_status; } ::ndk::ScopedAStatus IFactoryDefault::queryProcessing(const std::optional<::aidl::android::hardware::audio::effect::Processing::Type>& /*in_type*/, std::vector<::aidl::android::hardware::audio::effect::Processing>* /*_aidl_return*/) { ::ndk::ScopedAStatus _aidl_status; _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); return _aidl_status; } ::ndk::ScopedAStatus IFactoryDefault::createEffect(const ::aidl::android::media::audio::common::AudioUuid& /*in_implUuid*/, std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect>* /*_aidl_return*/) { ::ndk::ScopedAStatus _aidl_status; _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); return _aidl_status; } ::ndk::ScopedAStatus IFactoryDefault::destroyEffect(const std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect>& /*in_handle*/) { ::ndk::ScopedAStatus _aidl_status; _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); return _aidl_status; } ::ndk::SpAIBinder IFactoryDefault::asBinder() { return ::ndk::SpAIBinder(); } bool IFactoryDefault::isRemote() { return false; } } // namespace effect } // namespace audio } // namespace hardware } // namespace android } // namespace aidl