summaryrefslogtreecommitdiff
path: root/libs/binder/IServiceManager.cpp
diff options
context:
space:
mode:
author Parth Sane <parthsane@google.com> 2024-06-25 14:38:42 +0000
committer Parth Sane <parthsane@google.com> 2024-09-05 01:11:48 +0000
commitb6ed0eb38fd1ea22116b08eea8ee0fa418540965 (patch)
tree2e301342848ed34589b7401933705867bedd4fd8 /libs/binder/IServiceManager.cpp
parentd53d0744fcd1cf7354941ad231bb633fee308066 (diff)
Add a cache to getService with invalidation
Test: atest binderCacheUnitTest Bug: 333854840 Flag: LIBBINDER_CLIENT_CACHE Change-Id: I1b4e8482817c422850aed7359beaf7174b55445e
Diffstat (limited to 'libs/binder/IServiceManager.cpp')
-rw-r--r--libs/binder/IServiceManager.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/binder/IServiceManager.cpp b/libs/binder/IServiceManager.cpp
index cba21b2094..8a90ce2cab 100644
--- a/libs/binder/IServiceManager.cpp
+++ b/libs/binder/IServiceManager.cpp
@@ -18,6 +18,7 @@
#define LOG_TAG "ServiceManagerCppClient"
#include <binder/IServiceManager.h>
+#include <binder/IServiceManagerUnitTestHelper.h>
#include "BackendUnifiedServiceManager.h"
#include <inttypes.h>
@@ -311,6 +312,11 @@ void setDefaultServiceManager(const sp<IServiceManager>& sm) {
}
}
+sp<IServiceManager> getServiceManagerShimFromAidlServiceManagerForTests(
+ const sp<AidlServiceManager>& sm) {
+ return sp<CppBackendShim>::make(sp<BackendUnifiedServiceManager>::make(sm));
+}
+
std::weak_ptr<AccessorProvider> addAccessorProvider(RpcAccessorProvider&& providerCallback) {
std::lock_guard<std::mutex> lock(gAccessorProvidersMutex);
std::shared_ptr<AccessorProvider> provider =