diff options
Diffstat (limited to 'libs/binder/BackendUnifiedServiceManager.cpp')
| -rw-r--r-- | libs/binder/BackendUnifiedServiceManager.cpp | 23 | 
1 files changed, 21 insertions, 2 deletions
diff --git a/libs/binder/BackendUnifiedServiceManager.cpp b/libs/binder/BackendUnifiedServiceManager.cpp index 1f8e8eba4c..98a7555a4c 100644 --- a/libs/binder/BackendUnifiedServiceManager.cpp +++ b/libs/binder/BackendUnifiedServiceManager.cpp @@ -123,11 +123,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();  |