diff options
| author | Arthur Ishiguro <arthuri@google.com> | 2018-10-24 13:00:22 -0700 |
|---|---|---|
| committer | Arthur Ishiguro <arthuri@google.com> | 2018-10-24 15:33:09 -0700 |
| commit | 2640f0b7d7836797e90f19972f0f974477405525 (patch) | |
| tree | 40f774b93c561ce469e0fb6af0fcfb8b1a843032 /core/java | |
| parent | a7c3797577a228dde089389ca45cab053170a432 (diff) | |
Makes minor modifications to Intent-based Service APIs
Bug: 117612105
Test: None
Change-Id: Ic6b623a78a1a807363de403050f027ad3f950817
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/hardware/location/ContextHubClient.java | 18 | ||||
| -rw-r--r-- | core/java/android/hardware/location/ContextHubManager.java | 31 |
2 files changed, 26 insertions, 23 deletions
diff --git a/core/java/android/hardware/location/ContextHubClient.java b/core/java/android/hardware/location/ContextHubClient.java index 0229aef34689..56da719e7869 100644 --- a/core/java/android/hardware/location/ContextHubClient.java +++ b/core/java/android/hardware/location/ContextHubClient.java @@ -130,18 +130,18 @@ public class ContextHubClient implements Closeable { * {@link PendingIntent} through a {@link BroadcastReceiver}, and maps an {@link Intent} to a * {@link ContextHubClientCallback}. * - * @param intent The PendingIntent to register for this client - * @param nanoAppId the unique ID of the nanoapp to receive events for + * @param pendingIntent the PendingIntent to register for this client + * @param nanoAppId the unique ID of the nanoapp to receive events for * @return true on success, false otherwise * * @hide */ @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) - public boolean registerIntent(@NonNull PendingIntent intent, long nanoAppId) { - Preconditions.checkNotNull(intent, "PendingIntent cannot be null"); + public boolean registerIntent(@NonNull PendingIntent pendingIntent, long nanoAppId) { + Preconditions.checkNotNull(pendingIntent, "PendingIntent cannot be null"); try { - return mClientProxy.registerIntent(intent, nanoAppId); + return mClientProxy.registerIntent(pendingIntent, nanoAppId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } @@ -151,16 +151,18 @@ public class ContextHubClient implements Closeable { * Unregisters an intent previously registered via {@link #registerIntent(PendingIntent, long)}. * If this intent has not been registered for this client, this method returns false. * + * @param pendingIntent the PendingIntent to unregister + * * @return true on success, false otherwise * * @hide */ @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) - public boolean unregisterIntent(@NonNull PendingIntent intent) { - Preconditions.checkNotNull(intent, "PendingIntent cannot be null"); + public boolean unregisterIntent(@NonNull PendingIntent pendingIntent) { + Preconditions.checkNotNull(pendingIntent, "PendingIntent cannot be null"); try { - return mClientProxy.unregisterIntent(intent); + return mClientProxy.unregisterIntent(pendingIntent); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } diff --git a/core/java/android/hardware/location/ContextHubManager.java b/core/java/android/hardware/location/ContextHubManager.java index 6541ecd907ae..b0b77f31c24d 100644 --- a/core/java/android/hardware/location/ContextHubManager.java +++ b/core/java/android/hardware/location/ContextHubManager.java @@ -800,22 +800,22 @@ public final class ContextHubManager { * through {@link #createClient(ContextHubInfo, ContextHubClientCallback, Executor)} or * equivalent at an earlier time. * - * @param intent the intent that is associated with a client - * @param hubInfo the hub to attach this client to - * @param callback the notification callback to register - * @param executor the executor to invoke the callback + * @param pendingIntent the PendingIntent that has been registered with a client + * @param hubInfo the hub to attach this client to + * @param callback the notification callback to register + * @param executor the executor to invoke the callback * @return the registered client object * - * @throws IllegalArgumentException if hubInfo does not represent a valid hub, or the intent + * @throws IllegalArgumentException if hubInfo does not represent a valid hub, or pendingIntent * was not associated with a client * @throws IllegalStateException if there were too many registered clients at the service - * @throws NullPointerException if intent, hubInfo, callback, or executor is null + * @throws NullPointerException if pendingIntent, hubInfo, callback, or executor is null * * @hide */ @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) @NonNull public ContextHubClient createClient( - @NonNull PendingIntent intent, @NonNull ContextHubInfo hubInfo, + @NonNull PendingIntent pendingIntent, @NonNull ContextHubInfo hubInfo, @NonNull ContextHubClientCallback callback, @NonNull @CallbackExecutor Executor executor) { // TODO: Implement this @@ -823,26 +823,27 @@ public final class ContextHubManager { } /** - * Equivalent to {@link #createClient(Intent, ContextHubInfo, ContextHubClientCallback, + * Equivalent to {@link #createClient(PendingIntent, ContextHubInfo, ContextHubClientCallback, * Executor)} with the executor using the main thread's Looper. * - * @param intent the intent that is associated with a client - * @param hubInfo the hub to attach this client to - * @param callback the notification callback to register + * @param pendingIntent the PendingIntent that has been registered with a client + * @param hubInfo the hub to attach this client to + * @param callback the notification callback to register * @return the registered client object * - * @throws IllegalArgumentException if hubInfo does not represent a valid hub, or the intent + * @throws IllegalArgumentException if hubInfo does not represent a valid hub, or pendingIntent * was not associated with a client * @throws IllegalStateException if there were too many registered clients at the service - * @throws NullPointerException if intent, hubInfo, or callback is null + * @throws NullPointerException if pendingIntent, hubInfo, or callback is null * * @hide */ @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) @NonNull public ContextHubClient createClient( - @NonNull PendingIntent intent, @NonNull ContextHubInfo hubInfo, + @NonNull PendingIntent pendingIntent, @NonNull ContextHubInfo hubInfo, @NonNull ContextHubClientCallback callback) { - return createClient(intent, hubInfo, callback, new HandlerExecutor(Handler.getMain())); + return createClient( + pendingIntent, hubInfo, callback, new HandlerExecutor(Handler.getMain())); } /** |
