Skip to content

Commit bbc7c9b

Browse files
Treehugger Robotandroid-build-merge-worker-robot
authored andcommitted
Merge "Remove log if cache is disabled." into main am: 67b445a am: 608f314
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3505695 Change-Id: Ib7c3aee6f36ad2a077c4b862412fe6ac8490288e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2 parents cb144c7 + 608f314 commit bbc7c9b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

libs/binder/BackendUnifiedServiceManager.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,13 @@ os::ServiceWithMetadata createServiceWithMetadata(const sp<IBinder>& service, bo
130130

131131
bool BinderCacheWithInvalidation::isClientSideCachingEnabled(const std::string& serviceName) {
132132
sp<ProcessState> self = ProcessState::selfOrNull();
133-
if (!self || self->getThreadPoolMaxTotalThreadCount() <= 0) {
133+
// Should not cache if process state could not be found, or if thread pool
134+
// max could is not greater than zero.
135+
if (!self) {
136+
ALOGW("Service retrieved before binder threads started. If they are to be started, "
137+
"consider starting binder threads earlier.");
138+
return false;
139+
} else if (self->getThreadPoolMaxTotalThreadCount() <= 0) {
134140
ALOGW("Thread Pool max thread count is 0. Cannot cache binder as linkToDeath cannot be "
135141
"implemented. serviceName: %s",
136142
serviceName.c_str());

0 commit comments

Comments
 (0)