summaryrefslogtreecommitdiff
path: root/libs/binder/ProcessState.cpp
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2023-02-16 02:12:57 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2023-02-16 02:12:57 +0000
commitc847b392159c3efb887908aaa6ed3615fdb17efd (patch)
tree01683b5119cad72b7f2eca5896c13f0f88e13f87 /libs/binder/ProcessState.cpp
parent968b998ac37b8389b69ee5c500476140eef1969c (diff)
parent9a4278ece240f0c4a511f77a62d86aa15b755a05 (diff)
Merge "libbinder: warn when vndbinder use is wasted"
Diffstat (limited to 'libs/binder/ProcessState.cpp')
-rw-r--r--libs/binder/ProcessState.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp
index 254dda81a6..5f1f50672a 100644
--- a/libs/binder/ProcessState.cpp
+++ b/libs/binder/ProcessState.cpp
@@ -100,6 +100,10 @@ static void verifyNotForked(bool forked) {
LOG_ALWAYS_FATAL_IF(forked, "libbinder ProcessState can not be used after fork");
}
+bool ProcessState::isVndservicemanagerEnabled() {
+ return access("/vendor/bin/vndservicemanager", R_OK) == 0;
+}
+
sp<ProcessState> ProcessState::init(const char *driver, bool requireDefault)
{
#ifdef BINDER_IPC_32BIT
@@ -123,6 +127,11 @@ sp<ProcessState> ProcessState::init(const char *driver, bool requireDefault)
driver = "/dev/binder";
}
+ if (0 == strcmp(driver, "/dev/vndbinder") && !isVndservicemanagerEnabled()) {
+ ALOGE("vndservicemanager is not started on this device, you can save resources/threads "
+ "by not initializing ProcessState with /dev/vndbinder.");
+ }
+
// we must install these before instantiating the gProcess object,
// otherwise this would race with creating it, and there could be the
// possibility of an invalid gProcess object forked by another thread