Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed1ffe06 authored by Iliyan Malchev's avatar Iliyan Malchev
Browse files

binder: allow repeated invocations of initWithDriver



As long as the driver name is the same, calls to
ProcessState::initWithDriver() will succeed, returning the
already-created object.

Test: marlin

Change-Id: I87d5ca2a105becd8d4fa6fa85c00b879360229b3
Signed-off-by: default avatarIliyan Malchev <malchev@google.com>
parent 0556d79e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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);