-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservice.cpp
More file actions
27 lines (19 loc) · 834 Bytes
/
Copy pathservice.cpp
File metadata and controls
27 lines (19 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "OemLock.h"
#include <android-base/logging.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
using aidl::android::hardware::oemlock::OemLock;
int main() {
ABinderProcess_setThreadPoolMaxThreadCount(0);
// Create OemLock service
std::shared_ptr<OemLock> oemlock = ndk::SharedRefBase::make<OemLock>();
const std::string instance = std::string() + OemLock::descriptor + "/default";
binder_status_t status = AServiceManager_addService(oemlock->asBinder().get(), instance.c_str());
if (status != STATUS_OK) {
LOG(ERROR) << "Failed to register OemLock HAL service";
return EXIT_FAILURE;
}
LOG(INFO) << "OPTEE OemLock HAL service started";
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // Should never reach here
}