Update for IServiceManager service retrieval APIs.
This will allow other services to query for information on what sort of
services are currently registered with the service manager. Note, this
is different from the VINTF manifest which is a static entity.
Test: hidl_test, hidl_test_java, nfc works
Bug: 30804608
Change-Id: I796348b6e5677b98d0f383bf4cf0bfe4b320492a
diff --git a/ServiceManager.h b/ServiceManager.h
index 0fc856e..f358cfe 100644
--- a/ServiceManager.h
+++ b/ServiceManager.h
@@ -31,29 +31,39 @@
const hidl_string& name,
const sp<IBinder>& service) override;
+ Return<void> list(list_cb _hidl_cb) override;
+ Return<void> listByInterface(const hidl_string& fqName,
+ listByInterface_cb _hidl_cb) override;
+
struct HidlService {
- HidlService(const std::string &iface,
+ HidlService(const std::string &package,
+ const std::string &interface,
const std::string &name,
const hidl_version &version,
const sp<IBinder> &service);
sp<IBinder> getService() const;
void setService(sp<IBinder> service);
- const std::string &getIface() const;
+ const std::string &getPackage() const;
+ const std::string &getInterface() const;
const std::string &getName() const;
const hidl_version &getVersion() const;
bool supportsVersion(const hidl_version &version) const;
+ std::string iface() const; // e.x. "android.hidl.manager::IServiceManager"
+ std::string string() const; // e.x. "android.hidl.manager@1.0::IServiceManager/manager"
+
static std::unique_ptr<HidlService> make(
const std::string &fqName,
const std::string &name,
const sp<IBinder>& service = nullptr);
private:
- const std::string mIface; // e.x. "android.hidl.manager::IServiceManager"
- const std::string mName; // e.x. "manager"
- const hidl_version mVersion; // e.x. { 1, 0 }
+ const std::string mPackage; // e.x. "android.hidl.manager"
+ const std::string mInterface; // e.x. "IServiceManager"
+ const std::string mName; // e.x. "manager"
+ const hidl_version mVersion; // e.x. { 1, 0 }
sp<IBinder> mService;
};