summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Arthur Ishiguro <arthuri@google.com> 2018-10-17 16:35:15 -0700
committer Arthur Ishiguro <arthuri@google.com> 2018-10-19 13:53:57 -0700
commitd2dc0fef0cb2dcae05e009cd22013141473f8ddc (patch)
tree568fd1d0817bc945e8e06bd552c7a5fb1d06b360
parente767fa2e136d72a3703b1117e73b16ae55afc96e (diff)
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
-rw-r--r--core/java/android/hardware/location/ContextHubClient.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/core/java/android/hardware/location/ContextHubClient.java b/core/java/android/hardware/location/ContextHubClient.java
index 6609b76faac1..5de89e3422ab 100644
--- a/core/java/android/hardware/location/ContextHubClient.java
+++ b/core/java/android/hardware/location/ContextHubClient.java
@@ -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,