| #ifndef HIDL_GENERATED_ANDROID_HARDWARE_SOUNDTRIGGER_V2_1_BSSOUNDTRIGGERHW_H |
| #define HIDL_GENERATED_ANDROID_HARDWARE_SOUNDTRIGGER_V2_1_BSSOUNDTRIGGERHW_H |
| |
| #include <android-base/macros.h> |
| #include <cutils/trace.h> |
| #include <future> |
| #include <android/hardware/soundtrigger/2.1/ISoundTriggerHw.h> |
| |
| #include <hidl/HidlPassthroughSupport.h> |
| #include <hidl/TaskRunner.h> |
| namespace android { |
| namespace hardware { |
| namespace soundtrigger { |
| namespace V2_1 { |
| |
| struct BsSoundTriggerHw : ISoundTriggerHw, ::android::hardware::details::HidlInstrumentor { |
| explicit BsSoundTriggerHw(const ::android::sp<ISoundTriggerHw> impl); |
| |
| /** |
| * The pure class is what this class wraps. |
| */ |
| typedef ISoundTriggerHw Pure; |
| |
| typedef ::android::hardware::details::bs_tag _hidl_tag; |
| |
| // Methods from ::android::hardware::soundtrigger::V2_0::ISoundTriggerHw follow. |
| ::android::hardware::Return<void> getProperties(getProperties_cb _hidl_cb) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::ISoundTriggerHw::getProperties::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hardware.soundtrigger", "2.0", "ISoundTriggerHw", "getProperties", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->getProperties([&](const auto &_hidl_out_retval, const auto &_hidl_out_properties) { |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_retval); |
| _hidl_args.push_back((void *)&_hidl_out_properties); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hardware.soundtrigger", "2.0", "ISoundTriggerHw", "getProperties", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| _hidl_cb(_hidl_out_retval, _hidl_out_properties); |
| }); |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<void> loadSoundModel(const ::android::hardware::soundtrigger::V2_0::ISoundTriggerHw::SoundModel& soundModel, const ::android::sp<::android::hardware::soundtrigger::V2_0::ISoundTriggerHwCallback>& callback, int32_t cookie, loadSoundModel_cb _hidl_cb) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::ISoundTriggerHw::loadSoundModel::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&soundModel); |
| _hidl_args.push_back((void *)&callback); |
| _hidl_args.push_back((void *)&cookie); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hardware.soundtrigger", "2.0", "ISoundTriggerHw", "loadSoundModel", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::sp<::android::hardware::soundtrigger::V2_0::ISoundTriggerHwCallback> _hidl_wrapped_callback; |
| if (callback != nullptr && !callback->isRemote()) { |
| _hidl_wrapped_callback = ::android::hardware::details::wrapPassthrough(callback); |
| if (_hidl_wrapped_callback == nullptr) { |
| return ::android::hardware::Status::fromExceptionCode( |
| ::android::hardware::Status::EX_TRANSACTION_FAILED, |
| "Cannot wrap passthrough interface."); |
| } |
| } else { |
| _hidl_wrapped_callback = callback; |
| } |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->loadSoundModel(soundModel, _hidl_wrapped_callback, cookie, [&](const auto &_hidl_out_retval, const auto &_hidl_out_modelHandle) { |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_retval); |
| _hidl_args.push_back((void *)&_hidl_out_modelHandle); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hardware.soundtrigger", "2.0", "ISoundTriggerHw", "loadSoundModel", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| _hidl_cb(_hidl_out_retval, _hidl_out_modelHandle); |
| }); |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<void> loadPhraseSoundModel(const ::android::hardware::soundtrigger::V2_0::ISoundTriggerHw::PhraseSoundModel& soundModel, const ::android::sp<::android::hardware::soundtrigger::V2_0::ISoundTriggerHwCallback>& callback, int32_t cookie, loadPhraseSoundModel_cb _hidl_cb) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::ISoundTriggerHw::loadPhraseSoundModel::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&soundModel); |
| _hidl_args.push_back((void *)&callback); |
| _hidl_args.push_back((void *)&cookie); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hardware.soundtrigger", "2.0", "ISoundTriggerHw", "loadPhraseSoundModel", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::sp<::android::hardware::soundtrigger::V2_0::ISoundTriggerHwCallback> _hidl_wrapped_callback; |
| if (callback != nullptr && !callback->isRemote()) { |
| _hidl_wrapped_callback = ::android::hardware::details::wrapPassthrough(callback); |
| if (_hidl_wrapped_callback == nullptr) { |
| return ::android::hardware::Status::fromExceptionCode( |
| ::android::hardware::Status::EX_TRANSACTION_FAILED, |
| "Cannot wrap passthrough interface."); |
| } |
| } else { |
| _hidl_wrapped_callback = callback; |
| } |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->loadPhraseSoundModel(soundModel, _hidl_wrapped_callback, cookie, [&](const auto &_hidl_out_retval, const auto &_hidl_out_modelHandle) { |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_retval); |
| _hidl_args.push_back((void *)&_hidl_out_modelHandle); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hardware.soundtrigger", "2.0", "ISoundTriggerHw", "loadPhraseSoundModel", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| _hidl_cb(_hidl_out_retval, _hidl_out_modelHandle); |
| }); |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<int32_t> unloadSoundModel(int32_t modelHandle) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::ISoundTriggerHw::unloadSoundModel::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&modelHandle); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hardware.soundtrigger", "2.0", "ISoundTriggerHw", "unloadSoundModel", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->unloadSoundModel(modelHandle); |
| |
| int32_t _hidl_out_retval = _hidl_return; |
| (void) _hidl_out_retval; |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_retval); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hardware.soundtrigger", "2.0", "ISoundTriggerHw", "unloadSoundModel", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<int32_t> startRecognition(int32_t modelHandle, const ::android::hardware::soundtrigger::V2_0::ISoundTriggerHw::RecognitionConfig& config, const ::android::sp<::android::hardware::soundtrigger::V2_0::ISoundTriggerHwCallback>& callback, int32_t cookie) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::ISoundTriggerHw::startRecognition::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&modelHandle); |
| _hidl_args.push_back((void *)&config); |
| _hidl_args.push_back((void *)&callback); |
| _hidl_args.push_back((void *)&cookie); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hardware.soundtrigger", "2.0", "ISoundTriggerHw", "startRecognition", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::sp<::android::hardware::soundtrigger::V2_0::ISoundTriggerHwCallback> _hidl_wrapped_callback; |
| if (callback != nullptr && !callback->isRemote()) { |
| _hidl_wrapped_callback = ::android::hardware::details::wrapPassthrough(callback); |
| if (_hidl_wrapped_callback == nullptr) { |
| return ::android::hardware::Status::fromExceptionCode( |
| ::android::hardware::Status::EX_TRANSACTION_FAILED, |
| "Cannot wrap passthrough interface."); |
| } |
| } else { |
| _hidl_wrapped_callback = callback; |
| } |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->startRecognition(modelHandle, config, _hidl_wrapped_callback, cookie); |
| |
| int32_t _hidl_out_retval = _hidl_return; |
| (void) _hidl_out_retval; |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_retval); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hardware.soundtrigger", "2.0", "ISoundTriggerHw", "startRecognition", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<int32_t> stopRecognition(int32_t modelHandle) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::ISoundTriggerHw::stopRecognition::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&modelHandle); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hardware.soundtrigger", "2.0", "ISoundTriggerHw", "stopRecognition", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->stopRecognition(modelHandle); |
| |
| int32_t _hidl_out_retval = _hidl_return; |
| (void) _hidl_out_retval; |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_retval); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hardware.soundtrigger", "2.0", "ISoundTriggerHw", "stopRecognition", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<int32_t> stopAllRecognitions() override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::ISoundTriggerHw::stopAllRecognitions::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hardware.soundtrigger", "2.0", "ISoundTriggerHw", "stopAllRecognitions", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->stopAllRecognitions(); |
| |
| int32_t _hidl_out_retval = _hidl_return; |
| (void) _hidl_out_retval; |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_retval); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hardware.soundtrigger", "2.0", "ISoundTriggerHw", "stopAllRecognitions", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| |
| // Methods from ::android::hardware::soundtrigger::V2_1::ISoundTriggerHw follow. |
| ::android::hardware::Return<void> loadSoundModel_2_1(const ::android::hardware::soundtrigger::V2_1::ISoundTriggerHw::SoundModel& soundModel, const ::android::sp<::android::hardware::soundtrigger::V2_1::ISoundTriggerHwCallback>& callback, int32_t cookie, loadSoundModel_2_1_cb _hidl_cb) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::ISoundTriggerHw::loadSoundModel_2_1::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&soundModel); |
| _hidl_args.push_back((void *)&callback); |
| _hidl_args.push_back((void *)&cookie); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hardware.soundtrigger", "2.1", "ISoundTriggerHw", "loadSoundModel_2_1", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::sp<::android::hardware::soundtrigger::V2_1::ISoundTriggerHwCallback> _hidl_wrapped_callback; |
| if (callback != nullptr && !callback->isRemote()) { |
| _hidl_wrapped_callback = ::android::hardware::details::wrapPassthrough(callback); |
| if (_hidl_wrapped_callback == nullptr) { |
| return ::android::hardware::Status::fromExceptionCode( |
| ::android::hardware::Status::EX_TRANSACTION_FAILED, |
| "Cannot wrap passthrough interface."); |
| } |
| } else { |
| _hidl_wrapped_callback = callback; |
| } |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->loadSoundModel_2_1(soundModel, _hidl_wrapped_callback, cookie, [&](const auto &_hidl_out_retval, const auto &_hidl_out_modelHandle) { |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_retval); |
| _hidl_args.push_back((void *)&_hidl_out_modelHandle); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hardware.soundtrigger", "2.1", "ISoundTriggerHw", "loadSoundModel_2_1", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| _hidl_cb(_hidl_out_retval, _hidl_out_modelHandle); |
| }); |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<void> loadPhraseSoundModel_2_1(const ::android::hardware::soundtrigger::V2_1::ISoundTriggerHw::PhraseSoundModel& soundModel, const ::android::sp<::android::hardware::soundtrigger::V2_1::ISoundTriggerHwCallback>& callback, int32_t cookie, loadPhraseSoundModel_2_1_cb _hidl_cb) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::ISoundTriggerHw::loadPhraseSoundModel_2_1::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&soundModel); |
| _hidl_args.push_back((void *)&callback); |
| _hidl_args.push_back((void *)&cookie); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hardware.soundtrigger", "2.1", "ISoundTriggerHw", "loadPhraseSoundModel_2_1", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::sp<::android::hardware::soundtrigger::V2_1::ISoundTriggerHwCallback> _hidl_wrapped_callback; |
| if (callback != nullptr && !callback->isRemote()) { |
| _hidl_wrapped_callback = ::android::hardware::details::wrapPassthrough(callback); |
| if (_hidl_wrapped_callback == nullptr) { |
| return ::android::hardware::Status::fromExceptionCode( |
| ::android::hardware::Status::EX_TRANSACTION_FAILED, |
| "Cannot wrap passthrough interface."); |
| } |
| } else { |
| _hidl_wrapped_callback = callback; |
| } |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->loadPhraseSoundModel_2_1(soundModel, _hidl_wrapped_callback, cookie, [&](const auto &_hidl_out_retval, const auto &_hidl_out_modelHandle) { |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_retval); |
| _hidl_args.push_back((void *)&_hidl_out_modelHandle); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hardware.soundtrigger", "2.1", "ISoundTriggerHw", "loadPhraseSoundModel_2_1", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| _hidl_cb(_hidl_out_retval, _hidl_out_modelHandle); |
| }); |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<int32_t> startRecognition_2_1(int32_t modelHandle, const ::android::hardware::soundtrigger::V2_1::ISoundTriggerHw::RecognitionConfig& config, const ::android::sp<::android::hardware::soundtrigger::V2_1::ISoundTriggerHwCallback>& callback, int32_t cookie) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::ISoundTriggerHw::startRecognition_2_1::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&modelHandle); |
| _hidl_args.push_back((void *)&config); |
| _hidl_args.push_back((void *)&callback); |
| _hidl_args.push_back((void *)&cookie); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hardware.soundtrigger", "2.1", "ISoundTriggerHw", "startRecognition_2_1", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::sp<::android::hardware::soundtrigger::V2_1::ISoundTriggerHwCallback> _hidl_wrapped_callback; |
| if (callback != nullptr && !callback->isRemote()) { |
| _hidl_wrapped_callback = ::android::hardware::details::wrapPassthrough(callback); |
| if (_hidl_wrapped_callback == nullptr) { |
| return ::android::hardware::Status::fromExceptionCode( |
| ::android::hardware::Status::EX_TRANSACTION_FAILED, |
| "Cannot wrap passthrough interface."); |
| } |
| } else { |
| _hidl_wrapped_callback = callback; |
| } |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->startRecognition_2_1(modelHandle, config, _hidl_wrapped_callback, cookie); |
| |
| int32_t _hidl_out_retval = _hidl_return; |
| (void) _hidl_out_retval; |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_retval); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hardware.soundtrigger", "2.1", "ISoundTriggerHw", "startRecognition_2_1", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| |
| // Methods from ::android::hidl::base::V1_0::IBase follow. |
| ::android::hardware::Return<void> interfaceChain(interfaceChain_cb _hidl_cb) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::ISoundTriggerHw::interfaceChain::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.base", "1.0", "IBase", "interfaceChain", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->interfaceChain([&](const auto &_hidl_out_descriptors) { |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_descriptors); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hidl.base", "1.0", "IBase", "interfaceChain", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| _hidl_cb(_hidl_out_descriptors); |
| }); |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<void> debug(const ::android::hardware::hidl_handle& fd, const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& options) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::ISoundTriggerHw::debug::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&fd); |
| _hidl_args.push_back((void *)&options); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.base", "1.0", "IBase", "debug", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->debug(fd, options); |
| |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hidl.base", "1.0", "IBase", "debug", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<void> interfaceDescriptor(interfaceDescriptor_cb _hidl_cb) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::ISoundTriggerHw::interfaceDescriptor::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.base", "1.0", "IBase", "interfaceDescriptor", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->interfaceDescriptor([&](const auto &_hidl_out_descriptor) { |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_descriptor); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hidl.base", "1.0", "IBase", "interfaceDescriptor", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| _hidl_cb(_hidl_out_descriptor); |
| }); |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<void> getHashChain(getHashChain_cb _hidl_cb) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::ISoundTriggerHw::getHashChain::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.base", "1.0", "IBase", "getHashChain", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->getHashChain([&](const auto &_hidl_out_hashchain) { |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_hashchain); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hidl.base", "1.0", "IBase", "getHashChain", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| _hidl_cb(_hidl_out_hashchain); |
| }); |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<void> setHALInstrumentation() override { |
| configureInstrumentation(); |
| return ::android::hardware::Void(); |
| } |
| |
| ::android::hardware::Return<bool> linkToDeath(const ::android::sp<::android::hardware::hidl_death_recipient>& recipient, uint64_t cookie) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::ISoundTriggerHw::linkToDeath::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&recipient); |
| _hidl_args.push_back((void *)&cookie); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.base", "1.0", "IBase", "linkToDeath", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->linkToDeath(recipient, cookie); |
| |
| bool _hidl_out_success = _hidl_return; |
| (void) _hidl_out_success; |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_success); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hidl.base", "1.0", "IBase", "linkToDeath", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<void> ping() override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::ISoundTriggerHw::ping::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.base", "1.0", "IBase", "ping", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->ping(); |
| |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hidl.base", "1.0", "IBase", "ping", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<void> getDebugInfo(getDebugInfo_cb _hidl_cb) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::ISoundTriggerHw::getDebugInfo::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.base", "1.0", "IBase", "getDebugInfo", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->getDebugInfo([&](const auto &_hidl_out_info) { |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_info); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hidl.base", "1.0", "IBase", "getDebugInfo", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| _hidl_cb(_hidl_out_info); |
| }); |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<void> notifySyspropsChanged() override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::ISoundTriggerHw::notifySyspropsChanged::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.base", "1.0", "IBase", "notifySyspropsChanged", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = addOnewayTask([mImpl = this->mImpl |
| #ifdef __ANDROID_DEBUGGABLE__ |
| , mEnableInstrumentation = this->mEnableInstrumentation, mInstrumentationCallbacks = this->mInstrumentationCallbacks |
| #endif // __ANDROID_DEBUGGABLE__ |
| ] { |
| mImpl->notifySyspropsChanged(); |
| |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hidl.base", "1.0", "IBase", "notifySyspropsChanged", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| }); |
| return _hidl_return; |
| } |
| ::android::hardware::Return<bool> unlinkToDeath(const ::android::sp<::android::hardware::hidl_death_recipient>& recipient) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::ISoundTriggerHw::unlinkToDeath::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&recipient); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.base", "1.0", "IBase", "unlinkToDeath", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->unlinkToDeath(recipient); |
| |
| bool _hidl_out_success = _hidl_return; |
| (void) _hidl_out_success; |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_success); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hidl.base", "1.0", "IBase", "unlinkToDeath", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| |
| private: |
| const ::android::sp<ISoundTriggerHw> mImpl; |
| ::android::hardware::details::TaskRunner mOnewayQueue; |
| |
| ::android::hardware::Return<void> addOnewayTask(std::function<void(void)>); |
| |
| }; |
| |
| } // namespace V2_1 |
| } // namespace soundtrigger |
| } // namespace hardware |
| } // namespace android |
| |
| #endif // HIDL_GENERATED_ANDROID_HARDWARE_SOUNDTRIGGER_V2_1_BSSOUNDTRIGGERHW_H |