summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorArthur Ishiguro <arthuri@google.com>2022-01-13 17:06:28 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2022-01-13 17:06:28 +0000
commit9ee529d8e033be8610f0ea541112b3d46e772eb6 (patch)
treebb69352b6692ccf73dbbdca0c6880a444fd67358 /core/java/android
parentd07c63b45bdd68e2ca45ca9d5c598307188186bc (diff)
parent71c765985b5f3c6716785d7323636d96134c9e8d (diff)
Merge "Make ContextHubClient.getId() return a 16-bit value"
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/hardware/location/ContextHubClient.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/java/android/hardware/location/ContextHubClient.java b/core/java/android/hardware/location/ContextHubClient.java
index 9468ca2590bb..54060cc0a784 100644
--- a/core/java/android/hardware/location/ContextHubClient.java
+++ b/core/java/android/hardware/location/ContextHubClient.java
@@ -15,6 +15,7 @@
*/
package android.hardware.location;
+import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
@@ -118,13 +119,14 @@ public class ContextHubClient implements Closeable {
* is newly generated (e.g. any regeneration of a callback client, or generation
* 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, in the range [0, 65535].
*/
+ @IntRange(from = 0, to = 65535)
public int getId() {
if (mId == null) {
throw new IllegalStateException("ID was not set");
}
- return mId;
+ return (0x0000FFFF & mId);
}
/**