1 #define LOG_TAG "castkey-main" 2 3 #include <android-base/logging.h> 4 #include <android/binder_manager.h> 5 #include <android/binder_process.h> 6 #include "CreatePluginFactories.h" 7 8 using ::android::base::InitLogging; 9 using ::android::base::LogdLogger; 10 using ::aidl::android::hardware::drm::castkey::createDrmFactory; 11 using ::aidl::android::hardware::drm::castkey::DrmFactory; 12 main(int,char * argv[])13int main(int /*argc*/, char* argv[]) { 14 InitLogging(argv, LogdLogger()); 15 ABinderProcess_setThreadPoolMaxThreadCount(8); 16 std::shared_ptr<DrmFactory> drmFactory = createDrmFactory(); 17 const std::string drmInstance = std::string() + DrmFactory::descriptor + "/castkey"; 18 binder_status_t status = 19 AServiceManager_addService(drmFactory->asBinder().get(), drmInstance.c_str()); 20 CHECK(status == STATUS_OK); 21 ABinderProcess_joinThreadPool(); 22 return EXIT_FAILURE; 23 }