Skip to content

Commit db04923

Browse files
committed
Remove log if cache is disabled.
Change-Id: I8d419df56e22b7a334f419a58724d4144efc86f3 Flag: Bugfix Bug: 399202756 Test: N/A
1 parent 4a4e0dd commit db04923

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)