Start NetdNativeService before CommandListener.
Starting CommandListener tells NetworkManagementService that netd
is ready to accept commands. Ensure that the binder service is
started (i.e., we have called startThreadPool) before we do this.
Bug: 27239233
Change-Id: Ica89e72f51eb4752cb5cea2e4096c6a9dc5776d7
diff --git a/server/NetdNativeService.cpp b/server/NetdNativeService.cpp
index 46f4315..678d19a 100644
--- a/server/NetdNativeService.cpp
+++ b/server/NetdNativeService.cpp
@@ -67,6 +67,18 @@
} // namespace
+status_t NetdNativeService::start() {
+ IPCThreadState::self()->disableBackgroundScheduling(true);
+ status_t ret = BinderService<NetdNativeService>::publish();
+ if (ret != android::OK) {
+ return ret;
+ }
+ sp<ProcessState> ps(ProcessState::self());
+ ps->startThreadPool();
+ ps->giveThreadPoolName();
+ return android::OK;
+}
+
binder::Status NetdNativeService::isAlive(bool *alive) {
NETD_BIG_LOCK_RPC(CONNECTIVITY_INTERNAL);