summaryrefslogtreecommitdiff
path: root/libs/fakeservicemanager/ServiceManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/fakeservicemanager/ServiceManager.h')
-rw-r--r--libs/fakeservicemanager/ServiceManager.h28
1 files changed, 22 insertions, 6 deletions
diff --git a/libs/fakeservicemanager/ServiceManager.h b/libs/fakeservicemanager/ServiceManager.h
index e26c21b9e9..62311d4727 100644
--- a/libs/fakeservicemanager/ServiceManager.h
+++ b/libs/fakeservicemanager/ServiceManager.h
@@ -19,7 +19,6 @@
#include <binder/IServiceManager.h>
#include <map>
-#include <optional>
namespace android {
@@ -31,25 +30,42 @@ class ServiceManager : public IServiceManager {
public:
ServiceManager();
+ /**
+ * Equivalent of checkService.
+ */
sp<IBinder> getService( const String16& name) const override;
+ /**
+ * Retrieve an existing service, non-blocking.
+ */
sp<IBinder> checkService( const String16& name) const override;
+ /**
+ * Register a service.
+ */
status_t addService(const String16& name, const sp<IBinder>& service,
bool allowIsolated = false,
int dumpsysFlags = DUMP_FLAG_PRIORITY_DEFAULT) override;
+ /**
+ * Return list of all existing services.
+ */
Vector<String16> listServices(int dumpsysFlags = 0) override;
IBinder* onAsBinder() override;
+ /**
+ * Effectively no-oped in this implementation - equivalent to checkService.
+ */
sp<IBinder> waitForService(const String16& name) override;
- bool isDeclared(const String16& name) override;
-
- Vector<String16> getDeclaredInstances(const String16& iface) override;
-
- std::optional<String16> updatableViaApex(const String16& name) override;
+ /**
+ * Check if a service is declared (e.g. VINTF manifest).
+ *
+ * If this returns true, waitForService should always be able to return the
+ * service.
+ */
+ bool isDeclared(const String16& name) override;
private:
std::map<String16, sp<IBinder>> mNameToService;