diff options
author | 2021-04-21 00:27:29 +0000 | |
---|---|---|
committer | 2021-04-21 01:16:09 +0000 | |
commit | edd4e07d463b2fa59e9a5312a0626e3d9b6339a3 (patch) | |
tree | 09dc7592e369d61d6485d6b201938cfd3a18d250 /libs/binder/IServiceManager.cpp | |
parent | 7e4fb7ca278407136a2caf31bcbead87631e79a6 (diff) |
servicemanager: expose updatable-via-apex
Service manager is already reading VINTF, so processes that need this
information can access this information w/o needing more permissions.
Bug: 185832616
Test: two added tests + manually specifying updatable-via-apex on a
service and checking the result
Change-Id: Id86a72d49466048a3e2173e40526981abb6f3123
Diffstat (limited to 'libs/binder/IServiceManager.cpp')
-rw-r--r-- | libs/binder/IServiceManager.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/binder/IServiceManager.cpp b/libs/binder/IServiceManager.cpp index 61f4581df3..f684cf672f 100644 --- a/libs/binder/IServiceManager.cpp +++ b/libs/binder/IServiceManager.cpp @@ -75,6 +75,7 @@ public: sp<IBinder> waitForService(const String16& name16) override; bool isDeclared(const String16& name) override; Vector<String16> getDeclaredInstances(const String16& interface) override; + std::optional<String16> updatableViaApex(const String16& name) override; // for legacy ABI const String16& getInterfaceDescriptor() const override { @@ -388,4 +389,12 @@ Vector<String16> ServiceManagerShim::getDeclaredInstances(const String16& interf return res; } +std::optional<String16> ServiceManagerShim::updatableViaApex(const String16& name) { + std::optional<std::string> declared; + if (!mTheRealServiceManager->updatableViaApex(String8(name).c_str(), &declared).isOk()) { + return std::nullopt; + } + return declared ? std::optional<String16>(String16(declared.value().c_str())) : std::nullopt; +} + } // namespace android |