summaryrefslogtreecommitdiff
path: root/libs/binder/IServiceManager.cpp
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2019-10-29 15:45:43 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2019-10-29 15:45:43 +0000
commitc9c2f0c8589fba44cd8f4fb589f7fe44e97c5218 (patch)
tree4a843b2614c81ac6b9e1477721800f0261b1fe2e /libs/binder/IServiceManager.cpp
parent1aed8b369dd977fba69134fc03bf3762c26c560c (diff)
parentb82b8f84b48616c124e1d1421a985328c1df53dc (diff)
Merge "ServiceManager: add isDeclared"
Diffstat (limited to 'libs/binder/IServiceManager.cpp')
-rw-r--r--libs/binder/IServiceManager.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/binder/IServiceManager.cpp b/libs/binder/IServiceManager.cpp
index a30df14bd6..4f47db199e 100644
--- a/libs/binder/IServiceManager.cpp
+++ b/libs/binder/IServiceManager.cpp
@@ -72,6 +72,7 @@ public:
bool allowIsolated, int dumpsysPriority) override;
Vector<String16> listServices(int dumpsysPriority) override;
sp<IBinder> waitForService(const String16& name16) override;
+ bool isDeclared(const String16& name) override;
// for legacy ABI
const String16& getInterfaceDescriptor() const override {
@@ -321,4 +322,12 @@ sp<IBinder> ServiceManagerShim::waitForService(const String16& name16)
}
}
+bool ServiceManagerShim::isDeclared(const String16& name) {
+ bool declared;
+ if (!mTheRealServiceManager->isDeclared(String8(name).c_str(), &declared).isOk()) {
+ return false;
+ }
+ return declared;
+}
+
} // namespace android