diff options
Diffstat (limited to 'dumpstate/1.0/default/service.cpp')
-rw-r--r-- | dumpstate/1.0/default/service.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/dumpstate/1.0/default/service.cpp b/dumpstate/1.0/default/service.cpp index 4f276b7d40..76c72b5b25 100644 --- a/dumpstate/1.0/default/service.cpp +++ b/dumpstate/1.0/default/service.cpp @@ -15,22 +15,26 @@ */ #define LOG_TAG "android.hardware.dumpstate@1.0-service" +#include <hidl/HidlLazyUtils.h> #include <hidl/HidlSupport.h> #include <hidl/HidlTransportSupport.h> #include "DumpstateDevice.h" +using ::android::OK; +using ::android::sp; using ::android::hardware::configureRpcThreadpool; +using ::android::hardware::joinRpcThreadpool; +using ::android::hardware::LazyServiceRegistrar; using ::android::hardware::dumpstate::V1_0::IDumpstateDevice; using ::android::hardware::dumpstate::V1_0::implementation::DumpstateDevice; -using ::android::hardware::joinRpcThreadpool; -using ::android::OK; -using ::android::sp; int main(int /* argc */, char* /* argv */ []) { sp<IDumpstateDevice> dumpstate = new DumpstateDevice; configureRpcThreadpool(1, true /* will join */); - if (dumpstate->registerAsService() != OK) { + + auto registrar = LazyServiceRegistrar::getInstance(); + if (registrar.registerService(dumpstate) != OK) { ALOGE("Could not register service."); return 1; } |