Skip to content

Commit 608f314

Browse files
Treehugger Robotandroid-build-merge-worker-robot
authored andcommitted
Merge "Remove log if cache is disabled." into main am: 67b445a
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>
2 parents cadcf50 + 67b445a commit 608f314

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)