| #ifndef HIDL_GENERATED_ANDROID_HIDL_MANAGER_V1_2_BSSERVICEMANAGER_H |
| #define HIDL_GENERATED_ANDROID_HIDL_MANAGER_V1_2_BSSERVICEMANAGER_H |
| |
| #include <android-base/macros.h> |
| #include <cutils/trace.h> |
| #include <future> |
| #include <android/hidl/manager/1.2/IServiceManager.h> |
| |
| #include <hidl/HidlPassthroughSupport.h> |
| #include <hidl/TaskRunner.h> |
| namespace android { |
| namespace hidl { |
| namespace manager { |
| namespace V1_2 { |
| |
| struct BsServiceManager : IServiceManager, ::android::hardware::details::HidlInstrumentor { |
| explicit BsServiceManager(const ::android::sp<IServiceManager> impl); |
| |
| /** |
| * The pure class is what this class wraps. |
| */ |
| typedef IServiceManager Pure; |
| |
| typedef ::android::hardware::details::bs_tag _hidl_tag; |
| |
| // Methods from ::android::hidl::manager::V1_0::IServiceManager follow. |
| ::android::hardware::Return<::android::sp<::android::hidl::base::V1_0::IBase>> get(const ::android::hardware::hidl_string& fqName, const ::android::hardware::hidl_string& name) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::IServiceManager::get::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&fqName); |
| _hidl_args.push_back((void *)&name); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.manager", "1.0", "IServiceManager", "get", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->get(fqName, name); |
| |
| ::android::sp<::android::hidl::base::V1_0::IBase> _hidl_out_service = _hidl_return; |
| (void) _hidl_out_service; |
| ::android::sp<::android::hidl::base::V1_0::IBase> _hidl_wrapped__hidl_out_service; |
| if (_hidl_out_service != nullptr && !_hidl_out_service->isRemote()) { |
| _hidl_wrapped__hidl_out_service = ::android::hardware::details::wrapPassthrough(_hidl_out_service); |
| if (_hidl_wrapped__hidl_out_service == nullptr) { |
| _hidl_error = ::android::hardware::Status::fromExceptionCode( |
| ::android::hardware::Status::EX_TRANSACTION_FAILED, |
| "Cannot wrap passthrough interface."); |
| } |
| } else { |
| _hidl_wrapped__hidl_out_service = _hidl_out_service; |
| } |
| |
| _hidl_out_service = _hidl_wrapped__hidl_out_service; |
| |
| _hidl_return = _hidl_out_service |
| ;atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_service); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hidl.manager", "1.0", "IServiceManager", "get", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<bool> add(const ::android::hardware::hidl_string& name, const ::android::sp<::android::hidl::base::V1_0::IBase>& service) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::IServiceManager::add::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&name); |
| _hidl_args.push_back((void *)&service); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.manager", "1.0", "IServiceManager", "add", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::sp<::android::hidl::base::V1_0::IBase> _hidl_wrapped_service; |
| if (service != nullptr && !service->isRemote()) { |
| _hidl_wrapped_service = ::android::hardware::details::wrapPassthrough(service); |
| if (_hidl_wrapped_service == nullptr) { |
| return ::android::hardware::Status::fromExceptionCode( |
| ::android::hardware::Status::EX_TRANSACTION_FAILED, |
| "Cannot wrap passthrough interface."); |
| } |
| } else { |
| _hidl_wrapped_service = service; |
| } |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->add(name, _hidl_wrapped_service); |
| |
| 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.manager", "1.0", "IServiceManager", "add", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<::android::hidl::manager::V1_0::IServiceManager::Transport> getTransport(const ::android::hardware::hidl_string& fqName, const ::android::hardware::hidl_string& name) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::IServiceManager::getTransport::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&fqName); |
| _hidl_args.push_back((void *)&name); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.manager", "1.0", "IServiceManager", "getTransport", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->getTransport(fqName, name); |
| |
| ::android::hidl::manager::V1_0::IServiceManager::Transport _hidl_out_transport = _hidl_return; |
| (void) _hidl_out_transport; |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_transport); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hidl.manager", "1.0", "IServiceManager", "getTransport", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<void> list(list_cb _hidl_cb) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::IServiceManager::list::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.manager", "1.0", "IServiceManager", "list", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->list([&](const auto &_hidl_out_fqInstanceNames) { |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_fqInstanceNames); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hidl.manager", "1.0", "IServiceManager", "list", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| _hidl_cb(_hidl_out_fqInstanceNames); |
| }); |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<void> listByInterface(const ::android::hardware::hidl_string& fqName, listByInterface_cb _hidl_cb) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::IServiceManager::listByInterface::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&fqName); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.manager", "1.0", "IServiceManager", "listByInterface", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->listByInterface(fqName, [&](const auto &_hidl_out_instanceNames) { |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_instanceNames); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hidl.manager", "1.0", "IServiceManager", "listByInterface", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| _hidl_cb(_hidl_out_instanceNames); |
| }); |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<bool> registerForNotifications(const ::android::hardware::hidl_string& fqName, const ::android::hardware::hidl_string& name, const ::android::sp<::android::hidl::manager::V1_0::IServiceNotification>& callback) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::IServiceManager::registerForNotifications::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&fqName); |
| _hidl_args.push_back((void *)&name); |
| _hidl_args.push_back((void *)&callback); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.manager", "1.0", "IServiceManager", "registerForNotifications", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::sp<::android::hidl::manager::V1_0::IServiceNotification> _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->registerForNotifications(fqName, name, _hidl_wrapped_callback); |
| |
| 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.manager", "1.0", "IServiceManager", "registerForNotifications", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<void> debugDump(debugDump_cb _hidl_cb) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::IServiceManager::debugDump::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.manager", "1.0", "IServiceManager", "debugDump", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->debugDump([&](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.manager", "1.0", "IServiceManager", "debugDump", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| _hidl_cb(_hidl_out_info); |
| }); |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<void> registerPassthroughClient(const ::android::hardware::hidl_string& fqName, const ::android::hardware::hidl_string& name) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::IServiceManager::registerPassthroughClient::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&fqName); |
| _hidl_args.push_back((void *)&name); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.manager", "1.0", "IServiceManager", "registerPassthroughClient", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->registerPassthroughClient(fqName, name); |
| |
| 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.manager", "1.0", "IServiceManager", "registerPassthroughClient", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| |
| // Methods from ::android::hidl::manager::V1_1::IServiceManager follow. |
| ::android::hardware::Return<bool> unregisterForNotifications(const ::android::hardware::hidl_string& fqName, const ::android::hardware::hidl_string& name, const ::android::sp<::android::hidl::manager::V1_0::IServiceNotification>& callback) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::IServiceManager::unregisterForNotifications::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&fqName); |
| _hidl_args.push_back((void *)&name); |
| _hidl_args.push_back((void *)&callback); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.manager", "1.1", "IServiceManager", "unregisterForNotifications", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::sp<::android::hidl::manager::V1_0::IServiceNotification> _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->unregisterForNotifications(fqName, name, _hidl_wrapped_callback); |
| |
| 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.manager", "1.1", "IServiceManager", "unregisterForNotifications", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| |
| // Methods from ::android::hidl::manager::V1_2::IServiceManager follow. |
| ::android::hardware::Return<bool> registerClientCallback(const ::android::hardware::hidl_string& fqName, const ::android::hardware::hidl_string& name, const ::android::sp<::android::hidl::base::V1_0::IBase>& server, const ::android::sp<::android::hidl::manager::V1_2::IClientCallback>& cb) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::IServiceManager::registerClientCallback::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&fqName); |
| _hidl_args.push_back((void *)&name); |
| _hidl_args.push_back((void *)&server); |
| _hidl_args.push_back((void *)&cb); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.manager", "1.2", "IServiceManager", "registerClientCallback", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::sp<::android::hidl::base::V1_0::IBase> _hidl_wrapped_server; |
| if (server != nullptr && !server->isRemote()) { |
| _hidl_wrapped_server = ::android::hardware::details::wrapPassthrough(server); |
| if (_hidl_wrapped_server == nullptr) { |
| return ::android::hardware::Status::fromExceptionCode( |
| ::android::hardware::Status::EX_TRANSACTION_FAILED, |
| "Cannot wrap passthrough interface."); |
| } |
| } else { |
| _hidl_wrapped_server = server; |
| } |
| |
| ::android::sp<::android::hidl::manager::V1_2::IClientCallback> _hidl_wrapped_cb; |
| if (cb != nullptr && !cb->isRemote()) { |
| _hidl_wrapped_cb = ::android::hardware::details::wrapPassthrough(cb); |
| if (_hidl_wrapped_cb == nullptr) { |
| return ::android::hardware::Status::fromExceptionCode( |
| ::android::hardware::Status::EX_TRANSACTION_FAILED, |
| "Cannot wrap passthrough interface."); |
| } |
| } else { |
| _hidl_wrapped_cb = cb; |
| } |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->registerClientCallback(fqName, name, _hidl_wrapped_server, _hidl_wrapped_cb); |
| |
| 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.manager", "1.2", "IServiceManager", "registerClientCallback", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<bool> unregisterClientCallback(const ::android::sp<::android::hidl::base::V1_0::IBase>& server, const ::android::sp<::android::hidl::manager::V1_2::IClientCallback>& cb) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::IServiceManager::unregisterClientCallback::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&server); |
| _hidl_args.push_back((void *)&cb); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.manager", "1.2", "IServiceManager", "unregisterClientCallback", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::sp<::android::hidl::base::V1_0::IBase> _hidl_wrapped_server; |
| if (server != nullptr && !server->isRemote()) { |
| _hidl_wrapped_server = ::android::hardware::details::wrapPassthrough(server); |
| if (_hidl_wrapped_server == nullptr) { |
| return ::android::hardware::Status::fromExceptionCode( |
| ::android::hardware::Status::EX_TRANSACTION_FAILED, |
| "Cannot wrap passthrough interface."); |
| } |
| } else { |
| _hidl_wrapped_server = server; |
| } |
| |
| ::android::sp<::android::hidl::manager::V1_2::IClientCallback> _hidl_wrapped_cb; |
| if (cb != nullptr && !cb->isRemote()) { |
| _hidl_wrapped_cb = ::android::hardware::details::wrapPassthrough(cb); |
| if (_hidl_wrapped_cb == nullptr) { |
| return ::android::hardware::Status::fromExceptionCode( |
| ::android::hardware::Status::EX_TRANSACTION_FAILED, |
| "Cannot wrap passthrough interface."); |
| } |
| } else { |
| _hidl_wrapped_cb = cb; |
| } |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->unregisterClientCallback(_hidl_wrapped_server, _hidl_wrapped_cb); |
| |
| 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.manager", "1.2", "IServiceManager", "unregisterClientCallback", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<bool> addWithChain(const ::android::hardware::hidl_string& name, const ::android::sp<::android::hidl::base::V1_0::IBase>& service, const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& chain) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::IServiceManager::addWithChain::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&name); |
| _hidl_args.push_back((void *)&service); |
| _hidl_args.push_back((void *)&chain); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.manager", "1.2", "IServiceManager", "addWithChain", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::sp<::android::hidl::base::V1_0::IBase> _hidl_wrapped_service; |
| if (service != nullptr && !service->isRemote()) { |
| _hidl_wrapped_service = ::android::hardware::details::wrapPassthrough(service); |
| if (_hidl_wrapped_service == nullptr) { |
| return ::android::hardware::Status::fromExceptionCode( |
| ::android::hardware::Status::EX_TRANSACTION_FAILED, |
| "Cannot wrap passthrough interface."); |
| } |
| } else { |
| _hidl_wrapped_service = service; |
| } |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->addWithChain(name, _hidl_wrapped_service, chain); |
| |
| 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.manager", "1.2", "IServiceManager", "addWithChain", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<void> listManifestByInterface(const ::android::hardware::hidl_string& fqName, listManifestByInterface_cb _hidl_cb) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::IServiceManager::listManifestByInterface::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&fqName); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.manager", "1.2", "IServiceManager", "listManifestByInterface", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->listManifestByInterface(fqName, [&](const auto &_hidl_out_instanceNames) { |
| atrace_end(ATRACE_TAG_HAL); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&_hidl_out_instanceNames); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_EXIT, "android.hidl.manager", "1.2", "IServiceManager", "listManifestByInterface", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| _hidl_cb(_hidl_out_instanceNames); |
| }); |
| |
| if (!_hidl_error.isOk()) return _hidl_error; |
| return _hidl_return; |
| } |
| ::android::hardware::Return<bool> tryUnregister(const ::android::hardware::hidl_string& fqName, const ::android::hardware::hidl_string& name, const ::android::sp<::android::hidl::base::V1_0::IBase>& service) override { |
| atrace_begin(ATRACE_TAG_HAL, "HIDL::IServiceManager::tryUnregister::passthrough"); |
| #ifdef __ANDROID_DEBUGGABLE__ |
| if (UNLIKELY(mEnableInstrumentation)) { |
| std::vector<void *> _hidl_args; |
| _hidl_args.push_back((void *)&fqName); |
| _hidl_args.push_back((void *)&name); |
| _hidl_args.push_back((void *)&service); |
| for (const auto &callback: mInstrumentationCallbacks) { |
| callback(InstrumentationEvent::PASSTHROUGH_ENTRY, "android.hidl.manager", "1.2", "IServiceManager", "tryUnregister", &_hidl_args); |
| } |
| } |
| #endif // __ANDROID_DEBUGGABLE__ |
| |
| ::android::sp<::android::hidl::base::V1_0::IBase> _hidl_wrapped_service; |
| if (service != nullptr && !service->isRemote()) { |
| _hidl_wrapped_service = ::android::hardware::details::wrapPassthrough(service); |
| if (_hidl_wrapped_service == nullptr) { |
| return ::android::hardware::Status::fromExceptionCode( |
| ::android::hardware::Status::EX_TRANSACTION_FAILED, |
| "Cannot wrap passthrough interface."); |
| } |
| } else { |
| _hidl_wrapped_service = service; |
| } |
| |
| ::android::hardware::Status _hidl_error = ::android::hardware::Status::ok(); |
| auto _hidl_return = mImpl->tryUnregister(fqName, name, _hidl_wrapped_service); |
| |
| 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.manager", "1.2", "IServiceManager", "tryUnregister", &_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::IServiceManager::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::IServiceManager::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::IServiceManager::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::IServiceManager::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::IServiceManager::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::IServiceManager::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::IServiceManager::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::IServiceManager::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::IServiceManager::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<IServiceManager> mImpl; |
| ::android::hardware::details::TaskRunner mOnewayQueue; |
| |
| ::android::hardware::Return<void> addOnewayTask(std::function<void(void)>); |
| |
| }; |
| |
| } // namespace V1_2 |
| } // namespace manager |
| } // namespace hidl |
| } // namespace android |
| |
| #endif // HIDL_GENERATED_ANDROID_HIDL_MANAGER_V1_2_BSSERVICEMANAGER_H |