#include #include #include #include "VendorStorage.h" using ::aidl::rockchip::aidl::vendorstorage::impl::VendorStorage; int main() { // ABinderProcess_setThreadPoolMaxThreadCount(2); std::shared_ptr vendorstorage = ndk::SharedRefBase::make(); // 这个instance就是service name,SELinux配置时需要用 const std::string instance = std::string() + VendorStorage::descriptor + "/default"; // 通过NDK的方法注册 // 这样client在system和vendor都能够调用的到此service binder_status_t status = AServiceManager_registerLazyService(vendorstorage->asBinder().get(), instance.c_str()); CHECK(status == STATUS_OK) << "Failed to add VendorStorage AIDL, status = " << status; ABinderProcess_joinThreadPool(); return -1; // Should never be reached }