Merge "@1.2::IServiceManager:onNoClients->onClients(bool)"
am: ccea91f3e1
Change-Id: Ie26c3e4163172e87ff632239af269232601a6c06
diff --git a/transport/manager/1.2/IClientCallback.hal b/transport/manager/1.2/IClientCallback.hal
index 030bcd0..1189e44 100644
--- a/transport/manager/1.2/IClientCallback.hal
+++ b/transport/manager/1.2/IClientCallback.hal
@@ -18,9 +18,15 @@
interface IClientCallback {
/**
- * Called when there are no clients remaining for the HAL registered with this service.
+ * This is called when there is a transition between having >= 1 clients and having 0 clients
+ * (or vice versa).
*
* @param registered binder 'server' registered with IServiceManager's registerClientCallback
+ * @param hasClients whether there are currently clients
+ * true - when there are >= 1 clients. This must be called as soon as IServiceManager::get
+ * is called (no race).
+ * false - when there are 0 clients. This may be delayed if it is thought that another
+ * may be used again soon.
*/
- oneway onNoClients(interface registered);
+ oneway onClients(interface registered, bool hasClients);
};
diff --git a/transport/manager/1.2/IServiceManager.hal b/transport/manager/1.2/IServiceManager.hal
index 8d34fb6..ae3fdfd 100644
--- a/transport/manager/1.2/IServiceManager.hal
+++ b/transport/manager/1.2/IServiceManager.hal
@@ -29,7 +29,8 @@
/**
* Adds a callback that must be called when the specified server has no clients.
*
- * This must only be called after the first time the service has no clients.
+ * If the service has clients at the time of registration, the callback is called with
+ * hasClients true. After that, it is called based on the changes in clientele.
*
* @param server non-null service waiting to have no clients
* @param cb non-null callback to call when there are no clients