summaryrefslogtreecommitdiff
path: root/libs/binder/IServiceManager.cpp
diff options
context:
space:
mode:
author Devin Moore <devinmoore@google.com> 2025-01-06 10:39:55 -0800
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2025-01-06 10:39:55 -0800
commit6c0cd2764f3d4ccea813a95750420232c0ca3a31 (patch)
treeb52e76e3536f2e9471de8cee1f7d219bbae088ae /libs/binder/IServiceManager.cpp
parent085e85466b45bbb1be55cf5757588877b309bab2 (diff)
parent03cb1fd21d43cc4ab0fef2eaaa3ddf4bb8042d96 (diff)
Merge changes from topic "no_sm_proc" into main am: 03cb1fd21d
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3365276 Change-Id: I084bd3aa6c44c2dd72f52e454bf89a1c2059f1fd Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'libs/binder/IServiceManager.cpp')
-rw-r--r--libs/binder/IServiceManager.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/binder/IServiceManager.cpp b/libs/binder/IServiceManager.cpp
index 53435c357b..5c72ed3197 100644
--- a/libs/binder/IServiceManager.cpp
+++ b/libs/binder/IServiceManager.cpp
@@ -304,6 +304,25 @@ android::binder::Status getInjectedAccessor(const std::string& name,
return android::binder::Status::ok();
}
+void appendInjectedAccessorServices(std::vector<std::string>* list) {
+ LOG_ALWAYS_FATAL_IF(list == nullptr,
+ "Attempted to get list of services from Accessors with nullptr");
+ std::lock_guard<std::mutex> lock(gAccessorProvidersMutex);
+ for (const auto& entry : gAccessorProviders) {
+ list->insert(list->end(), entry.mProvider->instances().begin(),
+ entry.mProvider->instances().end());
+ }
+}
+
+void forEachInjectedAccessorService(const std::function<void(const std::string&)>& f) {
+ std::lock_guard<std::mutex> lock(gAccessorProvidersMutex);
+ for (const auto& entry : gAccessorProviders) {
+ for (const auto& instance : entry.mProvider->instances()) {
+ f(instance);
+ }
+ }
+}
+
sp<IServiceManager> defaultServiceManager()
{
std::call_once(gSmOnce, []() {