Loading libs/binder/BackendUnifiedServiceManager.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -135,7 +135,7 @@ os::ServiceWithMetadata createServiceWithMetadata(const sp<IBinder>& service, bo return out; } bool BinderCacheWithInvalidation::isClientSideCachingEnabled(const std::string& serviceName) { bool BinderCacheWithInvalidation::isClientSideCachingEnabled(const std::string& serviceName) const { sp<ProcessState> self = ProcessState::selfOrNull(); // Should not cache if process state could not be found, or if thread pool // max could is not greater than zero. Loading libs/binder/BackendUnifiedServiceManager.h +5 −5 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ class BinderCacheWithInvalidation class BinderInvalidation : public IBinder::DeathRecipient { public: BinderInvalidation(std::weak_ptr<BinderCacheWithInvalidation> cache, const std::string& key) : mCache(cache), mKey(key) {} : mCache(std::move(cache)), mKey(key) {} void binderDied(const wp<IBinder>& who) override { sp<IBinder> binder = who.promote(); Loading Loading @@ -73,7 +73,7 @@ public: if (result != DEAD_OBJECT) { ALOGW("Unlinking to dead binder resulted in: %d", result); } mCache.erase(key); mCache.erase(it); return true; } } Loading Loading @@ -105,14 +105,14 @@ public: binder::ScopedTrace aidlTrace(ATRACE_TAG_AIDL, "BinderCacheWithInvalidation::setItem Successfully Cached"); std::lock_guard<std::mutex> lock(mCacheMutex); mCache[key] = {.service = item, .deathRecipient = deathRecipient}; mCache[key] = {.service = item, .deathRecipient = std::move(deathRecipient)}; return binder::Status::ok(); } bool isClientSideCachingEnabled(const std::string& serviceName); bool isClientSideCachingEnabled(const std::string& serviceName) const; private: std::map<std::string, Entry> mCache; std::map<std::string, Entry, std::less<>> mCache; mutable std::mutex mCacheMutex; }; Loading Loading
libs/binder/BackendUnifiedServiceManager.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -135,7 +135,7 @@ os::ServiceWithMetadata createServiceWithMetadata(const sp<IBinder>& service, bo return out; } bool BinderCacheWithInvalidation::isClientSideCachingEnabled(const std::string& serviceName) { bool BinderCacheWithInvalidation::isClientSideCachingEnabled(const std::string& serviceName) const { sp<ProcessState> self = ProcessState::selfOrNull(); // Should not cache if process state could not be found, or if thread pool // max could is not greater than zero. Loading
libs/binder/BackendUnifiedServiceManager.h +5 −5 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ class BinderCacheWithInvalidation class BinderInvalidation : public IBinder::DeathRecipient { public: BinderInvalidation(std::weak_ptr<BinderCacheWithInvalidation> cache, const std::string& key) : mCache(cache), mKey(key) {} : mCache(std::move(cache)), mKey(key) {} void binderDied(const wp<IBinder>& who) override { sp<IBinder> binder = who.promote(); Loading Loading @@ -73,7 +73,7 @@ public: if (result != DEAD_OBJECT) { ALOGW("Unlinking to dead binder resulted in: %d", result); } mCache.erase(key); mCache.erase(it); return true; } } Loading Loading @@ -105,14 +105,14 @@ public: binder::ScopedTrace aidlTrace(ATRACE_TAG_AIDL, "BinderCacheWithInvalidation::setItem Successfully Cached"); std::lock_guard<std::mutex> lock(mCacheMutex); mCache[key] = {.service = item, .deathRecipient = deathRecipient}; mCache[key] = {.service = item, .deathRecipient = std::move(deathRecipient)}; return binder::Status::ok(); } bool isClientSideCachingEnabled(const std::string& serviceName); bool isClientSideCachingEnabled(const std::string& serviceName) const; private: std::map<std::string, Entry> mCache; std::map<std::string, Entry, std::less<>> mCache; mutable std::mutex mCacheMutex; }; Loading