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

Commit d2dc3fc9 authored by Steven Moreland's avatar Steven Moreland Committed by android-build-merger
Browse files

Merge "Default to /dev/binder if binder node doesn't exist."

am: 1a49778e

Change-Id: Ic4855a17da31d159e4532081099dc2dcbdb5846b
parents b899c4c2 1a49778e
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -86,6 +86,12 @@ sp<ProcessState> ProcessState::initWithDriver(const char* driver)
        }
        LOG_ALWAYS_FATAL("ProcessState was already initialized.");
    }

    if (access(driver, R_OK) == -1) {
        ALOGE("Binder driver %s is unavailable. Using /dev/binder instead.", driver);
        driver = "/dev/binder";
    }

    gProcess = new ProcessState(driver);
    return gProcess;
}
@@ -420,7 +426,7 @@ ProcessState::ProcessState(const char *driver)
        mVMStart = mmap(0, BINDER_VM_SIZE, PROT_READ, MAP_PRIVATE | MAP_NORESERVE, mDriverFD, 0);
        if (mVMStart == MAP_FAILED) {
            // *sigh*
            ALOGE("Using /dev/binder failed: unable to mmap transaction memory.\n");
            ALOGE("Using %s failed: unable to mmap transaction memory.\n", mDriverName.c_str());
            close(mDriverFD);
            mDriverFD = -1;
            mDriverName.clear();