Merge "binder: allow repeated invocations of initWithDriver" into oc-dev
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp
index 9ccf07c..add5e74 100644
--- a/libs/binder/ProcessState.cpp
+++ b/libs/binder/ProcessState.cpp
@@ -79,6 +79,11 @@
 {
     Mutex::Autolock _l(gProcessMutex);
     if (gProcess != NULL) {
+        // Allow for initWithDriver to be called repeatedly with the same
+        // driver.
+        if (!strcmp(gProcess->getDriverName().c_str(), driver)) {
+            return gProcess;
+        }
         LOG_ALWAYS_FATAL("ProcessState was already initialized.");
     }
     gProcess = new ProcessState(driver);