From 5ac42e7a88f71a999166d523d1e5b7a05c524909 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Fri, 21 Oct 2016 12:40:38 -0700 Subject: [PATCH] boot: use defaultPassthroughServiceImplementation Bug: 32282345 Test: make Change-Id: Ifb479c665aa4e37881c86152d43f4f1f88983133 --- boot/1.0/default/service.cpp | 39 +++--------------------------------- 1 file changed, 3 insertions(+), 36 deletions(-) diff --git a/boot/1.0/default/service.cpp b/boot/1.0/default/service.cpp index b059f9a24b..a594db6e1e 100644 --- a/boot/1.0/default/service.cpp +++ b/boot/1.0/default/service.cpp @@ -1,44 +1,11 @@ #define LOG_TAG "android.hardware.boot@1.0-service" -#include - -#include -#include #include - -#include -#include -#include -#include -#include - -using android::sp; - -using android::hardware::IPCThreadState; -using android::hardware::ProcessState; +#include using ::android::hardware::boot::V1_0::IBootControl; +using android::hardware::defaultPassthroughServiceImplementation; int main (int /* argc */, char * /* argv */ []) { - ALOGI("Service is starting."); - const char instance[] = "bootctrl"; - ALOGI("Retrieving default implementation of instance %s.", - instance); - - sp service = IBootControl::getService(instance, true /* getStub */); - - if (service.get() == nullptr) { - ALOGE("IBootControl::getService returned NULL, exiting"); - return -1; - } - - LOG_FATAL_IF(service->isRemote(), "Implementation is REMOTE!"); - - ALOGI("Registering instance %s.", instance); - service->registerAsService(instance); - ALOGI("Ready."); - - ProcessState::self()->setThreadPoolMaxThreadCount(0); - ProcessState::self()->startThreadPool(); - IPCThreadState::self()->joinThreadPool(); + return defaultPassthroughServiceImplementation("bootctrl"); }