Improve ContextHubClient.java documentations

- Remove IllegalExceptions @throws for getId()
- Add <p> markers

Bug: 210923723
Test: None, doc only
Change-Id: Ie7804429b7f183754e7f8a85782e91f123c0f054
This commit is contained in:
Arthur Ishiguro 2021-12-22 01:11:46 +00:00
parent 6a17cc1c6f
commit d7d39a881b

View File

@ -30,7 +30,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
/** /**
* A class describing a client of the Context Hub Service. * A class describing a client of the Context Hub Service.
* * <p>
* Clients can send messages to nanoapps at a Context Hub through this object. The APIs supported * Clients can send messages to nanoapps at a Context Hub through this object. The APIs supported
* by this object are thread-safe and can be used without external synchronization. * by this object are thread-safe and can be used without external synchronization.
* *
@ -110,7 +110,7 @@ public class ContextHubClient implements Closeable {
* This value can be used as an identifier for the messaging channel between a * This value can be used as an identifier for the messaging channel between a
* ContextHubClient and the Context Hub. This may be used as a routing mechanism * ContextHubClient and the Context Hub. This may be used as a routing mechanism
* between various ContextHubClient objects within an application. * between various ContextHubClient objects within an application.
* * <p>
* The value returned by this method will remain the same if it is associated with * The value returned by this method will remain the same if it is associated with
* the same client reference at the ContextHubService (for instance, the ID of a * the same client reference at the ContextHubService (for instance, the ID of a
* PendingIntent ContextHubClient will remain the same even if the local object * PendingIntent ContextHubClient will remain the same even if the local object
@ -119,8 +119,6 @@ public class ContextHubClient implements Closeable {
* of a non-equal PendingIntent client), the ID will not be the same. * of a non-equal PendingIntent client), the ID will not be the same.
* *
* @return The ID of this ContextHubClient. * @return The ID of this ContextHubClient.
*
* @throws IllegalStateException if the ID was not set internally.
*/ */
public int getId() { public int getId() {
if (mId == null) { if (mId == null) {
@ -135,7 +133,7 @@ public class ContextHubClient implements Closeable {
* When this function is invoked, the messaging associated with this client is invalidated. * When this function is invoked, the messaging associated with this client is invalidated.
* All futures messages targeted for this client are dropped at the service, and the * All futures messages targeted for this client are dropped at the service, and the
* ContextHubClient is unregistered from the service. * ContextHubClient is unregistered from the service.
* * <p>
* If this object has a PendingIntent, i.e. the object was generated via * If this object has a PendingIntent, i.e. the object was generated via
* {@link ContextHubManager.createClient(PendingIntent, ContextHubInfo, long)}, then the * {@link ContextHubManager.createClient(PendingIntent, ContextHubInfo, long)}, then the
* Intent events corresponding to the PendingIntent will no longer be triggered. * Intent events corresponding to the PendingIntent will no longer be triggered.
@ -158,7 +156,7 @@ public class ContextHubClient implements Closeable {
* *
* This function returns RESULT_SUCCESS if the message has reached the HAL, but * This function returns RESULT_SUCCESS if the message has reached the HAL, but
* does not guarantee delivery of the message to the target nanoapp. * does not guarantee delivery of the message to the target nanoapp.
* * <p>
* Before sending the first message to your nanoapp, it's recommended that the following * Before sending the first message to your nanoapp, it's recommended that the following
* operations should be performed: * operations should be performed:
* 1) Invoke {@link ContextHubManager#queryNanoApps(ContextHubInfo)} to verify the nanoapp is * 1) Invoke {@link ContextHubManager#queryNanoApps(ContextHubInfo)} to verify the nanoapp is