Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ee529d8 authored by Arthur Ishiguro's avatar Arthur Ishiguro Committed by Android (Google) Code Review
Browse files

Merge "Make ContextHubClient.getId() return a 16-bit value"

parents d07c63b4 71c76598
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4154,7 +4154,7 @@ package android.hardware.location {
  public class ContextHubClient implements java.io.Closeable {
    method public void close();
    method @NonNull public android.hardware.location.ContextHubInfo getAttachedHub();
    method public int getId();
    method @IntRange(from=0, to=65535) public int getId();
    method @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB) public int sendMessageToNanoApp(@NonNull android.hardware.location.NanoAppMessage);
  }
+4 −2
Original line number Diff line number Diff line
@@ -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);
    }

    /**