summaryrefslogtreecommitdiff
path: root/libs/binder
diff options
context:
space:
mode:
author Parth Sane <parthsane@google.com> 2025-03-10 06:58:45 -0800
committer Parth Sane <parthsane@google.com> 2025-03-10 06:58:45 -0800
commitdb049236e411740fae925f0353ab11e72a99e1ea (patch)
treeae62fdf4aef14e87a758a6037623295f6a44676e /libs/binder
parent4a4e0dded08e75e39344d1a602afa36a96a449d2 (diff)
Remove log if cache is disabled.
Change-Id: I8d419df56e22b7a334f419a58724d4144efc86f3 Flag: Bugfix Bug: 399202756 Test: N/A
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());