ServiceManager: add isDeclared
Most of the time, AIDL services exist in client/service pairs. In this
context, `while(true) getService` or `waitForService` makes sense.
However, for VINTF services, this client/server coupling isn't
guaranteed. A device may or may not have specific hardware. So, now
IServiceManager can tell a client when a server will exist so it will
know if it needs to wait for this service during boot-up. The function
waitForDeclaredService is provided for this.
These functions are generic (not referring to VINTF specifically)
because they may be expanded to include information about APEX services
in the future OR the infrastructure may be made generic to work, if
desired, on system services.
Bug: 141828236
Test: binderStabilityTest, using waitForDeclaredService function
Change-Id: Ia230625e44e1685cc3fa9230ece8f0a25c88585e
diff --git a/cmds/dumpsys/tests/dumpsys_test.cpp b/cmds/dumpsys/tests/dumpsys_test.cpp
index cf4e0b5..b9395ba 100644
--- a/cmds/dumpsys/tests/dumpsys_test.cpp
+++ b/cmds/dumpsys/tests/dumpsys_test.cpp
@@ -54,6 +54,7 @@
MOCK_METHOD4(addService, status_t(const String16&, const sp<IBinder>&, bool, int));
MOCK_METHOD1(listServices, Vector<String16>(int));
MOCK_METHOD1(waitForService, sp<IBinder>(const String16&));
+ MOCK_METHOD1(isDeclared, bool(const String16&));
protected:
MOCK_METHOD0(onAsBinder, IBinder*());
};