summaryrefslogtreecommitdiffstats
path: root/include/binder
diff options
context:
space:
mode:
Diffstat (limited to 'include/binder')
-rw-r--r--include/binder/BinderService.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/include/binder/BinderService.h b/include/binder/BinderService.h
index 5ac36d9..ef703bd 100644
--- a/include/binder/BinderService.h
+++ b/include/binder/BinderService.h
@@ -42,19 +42,20 @@ public:
}
static void publishAndJoinThreadPool(bool allowIsolated = false) {
- sp<IServiceManager> sm(defaultServiceManager());
- sm->addService(
- String16(SERVICE::getServiceName()),
- new SERVICE(), allowIsolated);
- ProcessState::self()->startThreadPool();
- ProcessState::self()->giveThreadPoolName();
- IPCThreadState::self()->joinThreadPool();
+ publish(allowIsolated);
+ joinThreadPool();
}
static void instantiate() { publish(); }
- static status_t shutdown() {
- return NO_ERROR;
+ static status_t shutdown() { return NO_ERROR; }
+
+private:
+ static void joinThreadPool() {
+ sp<ProcessState> ps(ProcessState::self());
+ ps->startThreadPool();
+ ps->giveThreadPoolName();
+ IPCThreadState::self()->joinThreadPool();
}
};