diff options
| author | 2017-04-14 15:08:32 +0000 | |
|---|---|---|
| committer | 2017-04-14 15:08:32 +0000 | |
| commit | 11c1acc33a7402153ab0e7308bc59921165819ab (patch) | |
| tree | cafe2c6e7017f011d62ad5fd75e6eedce5e4fe5e | |
| parent | f18f8fe8cbc991ff2518e2a649325872e2d53aac (diff) | |
| parent | ed1ffe06f3efc791d57ed2709bb5177f3067ece8 (diff) | |
Merge "binder: allow repeated invocations of initWithDriver" into oc-dev
| -rw-r--r-- | libs/binder/ProcessState.cpp | 5 |
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); |