diff options
Diffstat (limited to 'rebootescrow/aidl/default/service.cpp')
-rw-r--r-- | rebootescrow/aidl/default/service.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/rebootescrow/aidl/default/service.cpp b/rebootescrow/aidl/default/service.cpp index bd2378e513..8a8086b498 100644 --- a/rebootescrow/aidl/default/service.cpp +++ b/rebootescrow/aidl/default/service.cpp @@ -17,15 +17,21 @@ #include "rebootescrow-impl/RebootEscrow.h" #include <android-base/logging.h> +#include <android-base/properties.h> #include <android/binder_manager.h> #include <android/binder_process.h> using aidl::android::hardware::rebootescrow::RebootEscrow; +constexpr auto kRebootEscrowDeviceProperty = "ro.rebootescrow.device"; +constexpr auto kRebootEscrowDeviceDefault = "/dev/access-kregistry"; + int main() { ABinderProcess_setThreadPoolMaxThreadCount(0); - auto re = ndk::SharedRefBase::make<RebootEscrow>(); + auto rebootEscrowDevicePath = + android::base::GetProperty(kRebootEscrowDeviceProperty, kRebootEscrowDeviceDefault); + auto re = ndk::SharedRefBase::make<RebootEscrow>(rebootEscrowDevicePath); const std::string instance = std::string() + RebootEscrow::descriptor + "/default"; binder_status_t status = AServiceManager_addService(re->asBinder().get(), instance.c_str()); CHECK(status == STATUS_OK); |