Clarifies requirements of registerIntent API

- Clarifies that only one PendingIntent can be registered to a client
  at a time, since otherwise it can't be regenerated meaningfully.
- Also adds that a ContextHubInfo object is provided in Intent events
  to regenerate the client.

Bug: 117612105
Test: None
Change-Id: Ia2b1cc9bc01d10b092598374c0d82e4fa1b45079
This commit is contained in:
Arthur Ishiguro
2018-10-17 16:35:15 -07:00
parent e767fa2e13
commit d2dc0fef0c

View File

@@ -105,12 +105,15 @@ public class ContextHubClient implements Closeable {
*
* This method should be used if the caller wants to receive notifications even after the
* process exits. The client must have an open connection with the Context Hub Service (i.e. it
* cannot have been closed through the {@link #close()} method). If registered successfully,
* intents will be delivered regarding events for the specified nanoapp from the attached
* Context Hub. Any unicast messages for this client will also be delivered. The intent will
* have an extra {@link #EXTRA_EVENT_TYPE} of type {@link ContextHubManager.Event}, which will
* contain the type of the event. See {@link ContextHubManager.Event} for description of each
* event type.
* cannot have been closed through the {@link #close()} method). Only one PendingIntent can be
* registered at a time for a single ContextHubClient. If registered successfully, intents will
* be delivered regarding events for the specified nanoapp from the attached Context Hub. Any
* unicast messages for this client will also be delivered. The intent will have an extra
* {@link ContextHubManager.EXTRA_CONTEXT_HUB_INFO} of type {@link ContextHubInfo}, which
* describes the Context Hub the intent event was for. The intent will also have an extra
* {@link ContextHubManager.EXTRA_EVENT_TYPE} of type {@link ContextHubManager.Event}, which
* will contain the type of the event. See {@link ContextHubManager.Event} for description of
* each event type, along with event-specific extra fields.
*
* When the intent is received, this client can be recreated through
* {@link ContextHubManager.createClient(PendingIntent, ContextHubInfo,