Init ProcessState w/ initWithDriver.

vndservicemanager was calling 'self' before 'initWithDriver':
ProcessState::self()->initWithDriver(...);

However, 'self' inits the driver. On devices with the VNDK, this caused
no problem because libbinder automatically inits to the correct driver
node. However, on legacy devices, vndservicemanager tried to use
/dev/binder unsuccessfully.

Bug: 137216568
Test: TH
Change-Id: I8dc9dac0592784a16ae0abd270718ae353aa81c3
diff --git a/cmds/servicemanager/main.cpp b/cmds/servicemanager/main.cpp
index c8ceb42..9f6193b 100644
--- a/cmds/servicemanager/main.cpp
+++ b/cmds/servicemanager/main.cpp
@@ -38,14 +38,13 @@
 
     android::base::InitLogging(nullptr, &android::base::KernelLogger);
 
-    ProcessState::self()->initWithDriver(driver);
-    ProcessState::self()->setThreadPoolMaxThreadCount(0);
-    ProcessState::self()->setCallRestriction(
-        ProcessState::CallRestriction::FATAL_IF_NOT_ONEWAY);
+    sp<ProcessState> ps = ProcessState::initWithDriver(driver);
+    ps->setThreadPoolMaxThreadCount(0);
+    ps->setCallRestriction(ProcessState::CallRestriction::FATAL_IF_NOT_ONEWAY);
 
     sp<ServiceManager> manager = new ServiceManager(std::make_unique<Access>());
     IPCThreadState::self()->setTheContextObject(manager);
-    ProcessState::self()->becomeContextManager(nullptr, nullptr);
+    ps->becomeContextManager(nullptr, nullptr);
 
     IPCThreadState::self()->joinThreadPool();