summaryrefslogtreecommitdiff
path: root/libs/binder/ProcessState.cpp
diff options
context:
space:
mode:
author Yifan Hong <elsk@google.com> 2021-04-21 21:37:17 -0700
committer Yifan Hong <elsk@google.com> 2021-05-20 15:29:42 -0700
commit84bedebfdb26982b9297df99abca155e3af48211 (patch)
tree631f8eaa3df458b95230093580f79ae09f9171e2 /libs/binder/ProcessState.cpp
parentbb2cca75efdf69152fc417b75f19a0d3c072f126 (diff)
Add IBinder::setRpcClient
This function allows a certain service to handle RPC calls from a given socket fd, with a given thread pool size. Test: binderRpcTest Test: binderLibTest Bug: 182914638 Change-Id: Idee3eb004af15d57a701800a103f6f0c337e49f5
Diffstat (limited to 'libs/binder/ProcessState.cpp')
-rw-r--r--libs/binder/ProcessState.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp
index f7ca1e68cb..3095607594 100644
--- a/libs/binder/ProcessState.cpp
+++ b/libs/binder/ProcessState.cpp
@@ -359,6 +359,14 @@ status_t ProcessState::setThreadPoolMaxThreadCount(size_t maxThreads) {
return result;
}
+size_t ProcessState::getThreadPoolMaxThreadCount() const {
+ // may actually be one more than this, if join is called
+ if (mThreadPoolStarted) return mMaxThreads;
+ // must not be initialized or maybe has poll thread setup, we
+ // currently don't track this in libbinder
+ return 0;
+}
+
status_t ProcessState::enableOnewaySpamDetection(bool enable) {
uint32_t enableDetection = enable ? 1 : 0;
if (ioctl(mDriverFD, BINDER_ENABLE_ONEWAY_SPAM_DETECTION, &enableDetection) == -1) {