You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
919 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#include <android-base/logging.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
#include "VendorStorage.h"
using ::aidl::rockchip::aidl::vendorstorage::impl::VendorStorage;
int main() {
// ABinderProcess_setThreadPoolMaxThreadCount(2);
std::shared_ptr<VendorStorage> vendorstorage = ndk::SharedRefBase::make<VendorStorage>();
// 这个instance就是service nameSELinux配置时需要用
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
}