summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Iliyan Malchev <malchev@google.com> 2017-04-14 15:08:32 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-04-14 15:08:32 +0000
commit11c1acc33a7402153ab0e7308bc59921165819ab (patch)
treecafe2c6e7017f011d62ad5fd75e6eedce5e4fe5e
parentf18f8fe8cbc991ff2518e2a649325872e2d53aac (diff)
parented1ffe06f3efc791d57ed2709bb5177f3067ece8 (diff)
Merge "binder: allow repeated invocations of initWithDriver" into oc-dev
-rw-r--r--libs/binder/ProcessState.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp
index 9ccf07ca2a..add5e744db 100644
--- a/libs/binder/ProcessState.cpp
+++ b/libs/binder/ProcessState.cpp
@@ -79,6 +79,11 @@ sp<ProcessState> ProcessState::initWithDriver(const char* driver)
{
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);