summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2017-12-19 15:42:16 -0800
committerSteven Moreland <smoreland@google.com>2017-12-20 00:32:52 +0000
commit376a55973530cb26a3f15a0ccf9f5ad269580466 (patch)
tree6552cc11af0b661f7aff1534fe9c6f480ddf901b /libs
parenta9c7e6d15201dbb701dc1f535689910a581912b0 (diff)
downloadnative-376a55973530cb26a3f15a0ccf9f5ad269580466.tar.gz
Default to /dev/binder if binder node doesn't exist.
Some devices don't have vndbinder yet. Bug: 67975337 Test: media cas doesn't crash loop on bullhead Change-Id: I381771ff971fadeae75a78b5d45d6d067adced44
Diffstat (limited to 'libs')
-rw-r--r--libs/binder/ProcessState.cpp8
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();