diff options
| author | 2017-12-20 18:37:13 +0000 | |
|---|---|---|
| committer | 2017-12-20 18:37:13 +0000 | |
| commit | 1a49778eccfeea3614465e83c53b66f786ecad32 (patch) | |
| tree | e2fe83b9e867fc43e1b34cb0b1d86185e021c990 | |
| parent | bfdea369b7369f29768929b4574125b18a63d836 (diff) | |
| parent | 376a55973530cb26a3f15a0ccf9f5ad269580466 (diff) | |
Merge "Default to /dev/binder if binder node doesn't exist."
| -rw-r--r-- | libs/binder/ProcessState.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp index 11dd5258a7..da806aa25d 100644 --- a/libs/binder/ProcessState.cpp +++ b/libs/binder/ProcessState.cpp @@ -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(); |