summaryrefslogtreecommitdiff
path: root/libs/binder/BackendUnifiedServiceManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/binder/BackendUnifiedServiceManager.cpp')
-rw-r--r--libs/binder/BackendUnifiedServiceManager.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/libs/binder/BackendUnifiedServiceManager.cpp b/libs/binder/BackendUnifiedServiceManager.cpp
index 52b485a6f6..37aaaf388e 100644
--- a/libs/binder/BackendUnifiedServiceManager.cpp
+++ b/libs/binder/BackendUnifiedServiceManager.cpp
@@ -114,11 +114,30 @@ binder::Status BackendUnifiedServiceManager::updateCache(const std::string& serv
if (!kUseCache) {
return binder::Status::ok();
}
+ std::string traceStr;
+ if (atrace_is_tag_enabled(ATRACE_TAG_AIDL)) {
+ traceStr = "BinderCacheWithInvalidation::updateCache : " + serviceName;
+ }
+ binder::ScopedTrace aidlTrace(ATRACE_TAG_AIDL, traceStr.c_str());
+
if (service.getTag() == os::Service::Tag::binder) {
sp<IBinder> binder = service.get<os::Service::Tag::binder>();
- if (binder && mCacheForGetService->isClientSideCachingEnabled(serviceName) &&
- binder->isBinderAlive()) {
+ if (!binder) {
+ binder::ScopedTrace
+ aidlTrace(ATRACE_TAG_AIDL,
+ "BinderCacheWithInvalidation::updateCache failed: binder_null");
+ } else if (!binder->isBinderAlive()) {
+ binder::ScopedTrace aidlTrace(ATRACE_TAG_AIDL,
+ "BinderCacheWithInvalidation::updateCache failed: "
+ "isBinderAlive_false");
+ } else if (mCacheForGetService->isClientSideCachingEnabled(serviceName)) {
+ binder::ScopedTrace aidlTrace(ATRACE_TAG_AIDL,
+ "BinderCacheWithInvalidation::updateCache successful");
return mCacheForGetService->setItem(serviceName, binder);
+ } else {
+ binder::ScopedTrace aidlTrace(ATRACE_TAG_AIDL,
+ "BinderCacheWithInvalidation::updateCache failed: "
+ "caching_not_enabled");
}
}
return binder::Status::ok();