summaryrefslogtreecommitdiff
path: root/libs/binder
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-03-10 10:15:24 -0700
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2025-03-10 10:15:24 -0700
commit608f3145525a0f5f6098de29416360d3219570da (patch)
treebe5796e7b3cc6383caf7987ab194e8d4a2ce9c20 /libs/binder
parentcadcf50fd804adb2765fd622c3d23589138d5a42 (diff)
parent67b445a490a71e01b870186315f54344b1f96466 (diff)
Merge "Remove log if cache is disabled." into main am: 67b445a490
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3505695 Change-Id: I80e619cb16d31d4c80e329bc8240501af1df3ffc Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'libs/binder')
-rw-r--r--libs/binder/BackendUnifiedServiceManager.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/binder/BackendUnifiedServiceManager.cpp b/libs/binder/BackendUnifiedServiceManager.cpp
index 7c0319aead..b1c8994b05 100644
--- a/libs/binder/BackendUnifiedServiceManager.cpp
+++ b/libs/binder/BackendUnifiedServiceManager.cpp
@@ -130,7 +130,13 @@ os::ServiceWithMetadata createServiceWithMetadata(const sp<IBinder>& service, bo
bool BinderCacheWithInvalidation::isClientSideCachingEnabled(const std::string& serviceName) {
sp<ProcessState> self = ProcessState::selfOrNull();
- if (!self || self->getThreadPoolMaxTotalThreadCount() <= 0) {
+ // Should not cache if process state could not be found, or if thread pool
+ // max could is not greater than zero.
+ if (!self) {
+ ALOGW("Service retrieved before binder threads started. If they are to be started, "
+ "consider starting binder threads earlier.");
+ return false;
+ } else if (self->getThreadPoolMaxTotalThreadCount() <= 0) {
ALOGW("Thread Pool max thread count is 0. Cannot cache binder as linkToDeath cannot be "
"implemented. serviceName: %s",
serviceName.c_str());