summaryrefslogtreecommitdiff
path: root/libs/binder/BackendUnifiedServiceManager.cpp
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-10-25 23:06:09 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-10-25 23:06:09 +0000
commitd3e05e7fd18329c3e0be4297d6d68de8f98a38dd (patch)
treeff3c9dcb1117737a7dbf1177e1db26b1a6cfea3a /libs/binder/BackendUnifiedServiceManager.cpp
parent365596b10e807daaf92499e0c82e874f4e16aec8 (diff)
parent74bc589a226cf790a7d600dbe32a3a5861a5b265 (diff)
Merge "Use ProcessState::selfOrNull in ServiceManager APIs" into main
Diffstat (limited to 'libs/binder/BackendUnifiedServiceManager.cpp')
-rw-r--r--libs/binder/BackendUnifiedServiceManager.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/binder/BackendUnifiedServiceManager.cpp b/libs/binder/BackendUnifiedServiceManager.cpp
index 654cc0d74a..d32eecdc60 100644
--- a/libs/binder/BackendUnifiedServiceManager.cpp
+++ b/libs/binder/BackendUnifiedServiceManager.cpp
@@ -105,7 +105,8 @@ static const char* kStaticCachableList[] = {
};
bool BinderCacheWithInvalidation::isClientSideCachingEnabled(const std::string& serviceName) {
- if (ProcessState::self()->getThreadPoolMaxTotalThreadCount() <= 0) {
+ sp<ProcessState> self = ProcessState::selfOrNull();
+ if (!self || self->getThreadPoolMaxTotalThreadCount() <= 0) {
ALOGW("Thread Pool max thread count is 0. Cannot cache binder as linkToDeath cannot be "
"implemented. serviceName: %s",
serviceName.c_str());