From d2dc0fef0cb2dcae05e009cd22013141473f8ddc Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Wed, 17 Oct 2018 16:35:15 -0700 Subject: 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 --- core/java/android/hardware/location/ContextHubClient.java | 15 +++++++++------ 1 file 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, -- cgit v1.2.3-59-g8ed1b