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

Commit f2b6f014 authored by Arthur Ishiguro's avatar Arthur Ishiguro
Browse files

Expose new ContextHubService APIs

Also deprecates old APIs.

Bug: 67734082
Test: make update-api && make
Change-Id: I93166347ce2ec63f9c0cffd0b8b0bbaa488e5ea4
parent 78493a1c
Loading
Loading
Loading
Loading
+114 −13
Original line number Original line Diff line number Diff line
@@ -1340,9 +1340,30 @@ package android.hardware.hdmi {


package android.hardware.location {
package android.hardware.location {


  public class ContextHubClient implements java.io.Closeable {
    method public void close();
    method public android.hardware.location.ContextHubInfo getAttachedHub();
    method public int sendMessageToNanoApp(android.hardware.location.NanoAppMessage);
  }

  public class ContextHubClientCallback {
    ctor public ContextHubClientCallback();
    method public void onHubReset(android.hardware.location.ContextHubClient);
    method public void onMessageFromNanoApp(android.hardware.location.ContextHubClient, android.hardware.location.NanoAppMessage);
    method public void onNanoAppAborted(android.hardware.location.ContextHubClient, long, int);
    method public void onNanoAppDisabled(android.hardware.location.ContextHubClient, long);
    method public void onNanoAppEnabled(android.hardware.location.ContextHubClient, long);
    method public void onNanoAppLoaded(android.hardware.location.ContextHubClient, long);
    method public void onNanoAppUnloaded(android.hardware.location.ContextHubClient, long);
  }

  public class ContextHubInfo implements android.os.Parcelable {
  public class ContextHubInfo implements android.os.Parcelable {
    ctor public ContextHubInfo();
    ctor public ContextHubInfo();
    method public int describeContents();
    method public int describeContents();
    method public byte getChreApiMajorVersion();
    method public byte getChreApiMinorVersion();
    method public short getChrePatchVersion();
    method public long getChrePlatformId();
    method public int getId();
    method public int getId();
    method public int getMaxPacketLengthBytes();
    method public int getMaxPacketLengthBytes();
    method public android.hardware.location.MemoryRegion[] getMemoryRegions();
    method public android.hardware.location.MemoryRegion[] getMemoryRegions();
@@ -1362,19 +1383,27 @@ package android.hardware.location {
  }
  }


  public final class ContextHubManager {
  public final class ContextHubManager {
    method public int[] findNanoAppOnHub(int, android.hardware.location.NanoAppFilter);
    method public android.hardware.location.ContextHubClient createClient(android.hardware.location.ContextHubInfo, android.hardware.location.ContextHubClientCallback, java.util.concurrent.Executor);
    method public int[] getContextHubHandles();
    method public android.hardware.location.ContextHubClient createClient(android.hardware.location.ContextHubInfo, android.hardware.location.ContextHubClientCallback);
    method public android.hardware.location.ContextHubInfo getContextHubInfo(int);
    method public android.hardware.location.ContextHubTransaction<java.lang.Void> disableNanoApp(android.hardware.location.ContextHubInfo, long);
    method public android.hardware.location.NanoAppInstanceInfo getNanoAppInstanceInfo(int);
    method public android.hardware.location.ContextHubTransaction<java.lang.Void> enableNanoApp(android.hardware.location.ContextHubInfo, long);
    method public int loadNanoApp(int, android.hardware.location.NanoApp);
    method public deprecated int[] findNanoAppOnHub(int, android.hardware.location.NanoAppFilter);
    method public int registerCallback(android.hardware.location.ContextHubManager.Callback);
    method public deprecated int[] getContextHubHandles();
    method public int registerCallback(android.hardware.location.ContextHubManager.Callback, android.os.Handler);
    method public deprecated android.hardware.location.ContextHubInfo getContextHubInfo(int);
    method public int sendMessage(int, int, android.hardware.location.ContextHubMessage);
    method public java.util.List<android.hardware.location.ContextHubInfo> getContextHubs();
    method public int unloadNanoApp(int);
    method public deprecated android.hardware.location.NanoAppInstanceInfo getNanoAppInstanceInfo(int);
    method public int unregisterCallback(android.hardware.location.ContextHubManager.Callback);
    method public deprecated int loadNanoApp(int, android.hardware.location.NanoApp);
  }
    method public android.hardware.location.ContextHubTransaction<java.lang.Void> loadNanoApp(android.hardware.location.ContextHubInfo, android.hardware.location.NanoAppBinary);

    method public android.hardware.location.ContextHubTransaction<java.util.List<android.hardware.location.NanoAppState>> queryNanoApps(android.hardware.location.ContextHubInfo);
  public static abstract class ContextHubManager.Callback {
    method public deprecated int registerCallback(android.hardware.location.ContextHubManager.Callback);
    method public deprecated int registerCallback(android.hardware.location.ContextHubManager.Callback, android.os.Handler);
    method public deprecated int sendMessage(int, int, android.hardware.location.ContextHubMessage);
    method public deprecated int unloadNanoApp(int);
    method public android.hardware.location.ContextHubTransaction<java.lang.Void> unloadNanoApp(android.hardware.location.ContextHubInfo, long);
    method public deprecated int unregisterCallback(android.hardware.location.ContextHubManager.Callback);
  }

  public static abstract deprecated class ContextHubManager.Callback {
    ctor protected ContextHubManager.Callback();
    ctor protected ContextHubManager.Callback();
    method public abstract void onMessageReceipt(int, int, android.hardware.location.ContextHubMessage);
    method public abstract void onMessageReceipt(int, int, android.hardware.location.ContextHubMessage);
  }
  }
@@ -1392,6 +1421,37 @@ package android.hardware.location {
    field public static final android.os.Parcelable.Creator<android.hardware.location.ContextHubMessage> CREATOR;
    field public static final android.os.Parcelable.Creator<android.hardware.location.ContextHubMessage> CREATOR;
  }
  }


  public class ContextHubTransaction<T> {
    method public int getType();
    method public void setOnCompleteListener(android.hardware.location.ContextHubTransaction.OnCompleteListener<T>, java.util.concurrent.Executor);
    method public void setOnCompleteListener(android.hardware.location.ContextHubTransaction.OnCompleteListener<T>);
    method public static java.lang.String typeToString(int, boolean);
    method public android.hardware.location.ContextHubTransaction.Response<T> waitForResponse(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException;
    field public static final int RESULT_FAILED_AT_HUB = 5; // 0x5
    field public static final int RESULT_FAILED_BAD_PARAMS = 2; // 0x2
    field public static final int RESULT_FAILED_BUSY = 4; // 0x4
    field public static final int RESULT_FAILED_HAL_UNAVAILABLE = 8; // 0x8
    field public static final int RESULT_FAILED_SERVICE_INTERNAL_FAILURE = 7; // 0x7
    field public static final int RESULT_FAILED_TIMEOUT = 6; // 0x6
    field public static final int RESULT_FAILED_UNINITIALIZED = 3; // 0x3
    field public static final int RESULT_FAILED_UNKNOWN = 1; // 0x1
    field public static final int RESULT_SUCCESS = 0; // 0x0
    field public static final int TYPE_DISABLE_NANOAPP = 3; // 0x3
    field public static final int TYPE_ENABLE_NANOAPP = 2; // 0x2
    field public static final int TYPE_LOAD_NANOAPP = 0; // 0x0
    field public static final int TYPE_QUERY_NANOAPPS = 4; // 0x4
    field public static final int TYPE_UNLOAD_NANOAPP = 1; // 0x1
  }

  public static abstract interface ContextHubTransaction.OnCompleteListener<L> {
    method public abstract void onComplete(android.hardware.location.ContextHubTransaction<L>, android.hardware.location.ContextHubTransaction.Response<L>);
  }

  public static class ContextHubTransaction.Response<R> {
    method public R getContents();
    method public int getResult();
  }

  public final class GeofenceHardware {
  public final class GeofenceHardware {
    method public boolean addGeofence(int, int, android.hardware.location.GeofenceHardwareRequest, android.hardware.location.GeofenceHardwareCallback);
    method public boolean addGeofence(int, int, android.hardware.location.GeofenceHardwareRequest, android.hardware.location.GeofenceHardwareCallback);
    method public int[] getMonitoringTypes();
    method public int[] getMonitoringTypes();
@@ -1508,6 +1568,25 @@ package android.hardware.location {
    field public static final android.os.Parcelable.Creator<android.hardware.location.NanoApp> CREATOR;
    field public static final android.os.Parcelable.Creator<android.hardware.location.NanoApp> CREATOR;
  }
  }


  public final class NanoAppBinary implements android.os.Parcelable {
    ctor public NanoAppBinary(byte[]);
    method public int describeContents();
    method public byte[] getBinary();
    method public byte[] getBinaryNoHeader();
    method public int getFlags();
    method public int getHeaderVersion();
    method public long getHwHubType();
    method public long getNanoAppId();
    method public int getNanoAppVersion();
    method public byte getTargetChreApiMajorVersion();
    method public byte getTargetChreApiMinorVersion();
    method public boolean hasValidHeader();
    method public boolean isEncrypted();
    method public boolean isSigned();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.location.NanoAppBinary> CREATOR;
  }

  public class NanoAppFilter {
  public class NanoAppFilter {
    ctor public NanoAppFilter(long, int, int, long);
    ctor public NanoAppFilter(long, int, int, long);
    method public int describeContents();
    method public int describeContents();
@@ -1541,6 +1620,28 @@ package android.hardware.location {
    field public static final android.os.Parcelable.Creator<android.hardware.location.NanoAppInstanceInfo> CREATOR;
    field public static final android.os.Parcelable.Creator<android.hardware.location.NanoAppInstanceInfo> CREATOR;
  }
  }


  public final class NanoAppMessage implements android.os.Parcelable {
    method public static android.hardware.location.NanoAppMessage createMessageFromNanoApp(long, int, byte[], boolean);
    method public static android.hardware.location.NanoAppMessage createMessageToNanoApp(long, int, byte[]);
    method public int describeContents();
    method public byte[] getMessageBody();
    method public int getMessageType();
    method public long getNanoAppId();
    method public boolean isBroadcastMessage();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.location.NanoAppMessage> CREATOR;
  }

  public final class NanoAppState implements android.os.Parcelable {
    ctor public NanoAppState(long, int, boolean);
    method public int describeContents();
    method public long getNanoAppId();
    method public long getNanoAppVersion();
    method public boolean isEnabled();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.location.NanoAppState> CREATOR;
  }

}
}


package android.hardware.radio {
package android.hardware.radio {
+2 −0
Original line number Original line Diff line number Diff line
@@ -17,6 +17,7 @@ package android.hardware.location;


import android.annotation.NonNull;
import android.annotation.NonNull;
import android.annotation.RequiresPermission;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.os.RemoteException;
import android.os.RemoteException;


import com.android.internal.util.Preconditions;
import com.android.internal.util.Preconditions;
@@ -34,6 +35,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
 *
 *
 * @hide
 * @hide
 */
 */
@SystemApi
public class ContextHubClient implements Closeable {
public class ContextHubClient implements Closeable {
    /*
    /*
     * The proxy to the client interface at the service.
     * The proxy to the client interface at the service.
+10 −4
Original line number Original line Diff line number Diff line
@@ -15,15 +15,20 @@
 */
 */
package android.hardware.location;
package android.hardware.location;


import android.annotation.SystemApi;

import java.util.concurrent.Executor;

/**
/**
 * A class for {@link android.hardware.location.ContextHubClient ContextHubClient} to
 * A class for {@link android.hardware.location.ContextHubClient ContextHubClient} to
 * receive messages and life-cycle events from nanoapps in the Context Hub at which the client is
 * receive messages and life-cycle events from nanoapps in the Context Hub at which the client is
 * attached to.
 * attached to.
 *
 *
 * This callback is registered through the
 * This callback is registered through the {@link
 * {@link android.hardware.location.ContextHubManager#createClient() creation} of
 * android.hardware.location.ContextHubManager#createClient(
 * {@link android.hardware.location.ContextHubClient ContextHubClient}. Callbacks are
 * ContextHubInfo, ContextHubClientCallback, Executor) creation} of
 * invoked in the following ways:
 * {@link android.hardware.location.ContextHubClient ContextHubClient}. Callbacks are invoked in
 * the following ways:
 * 1) Messages from nanoapps delivered through onMessageFromNanoApp may either be broadcasted
 * 1) Messages from nanoapps delivered through onMessageFromNanoApp may either be broadcasted
 *    or targeted to a specific client.
 *    or targeted to a specific client.
 * 2) Nanoapp or Context Hub events (the remaining callbacks) are broadcasted to all clients, and
 * 2) Nanoapp or Context Hub events (the remaining callbacks) are broadcasted to all clients, and
@@ -31,6 +36,7 @@ package android.hardware.location;
 *
 *
 * @hide
 * @hide
 */
 */
@SystemApi
public class ContextHubClientCallback {
public class ContextHubClientCallback {
    /**
    /**
     * Callback invoked when receiving a message from a nanoapp.
     * Callback invoked when receiving a message from a nanoapp.
+0 −12
Original line number Original line Diff line number Diff line
@@ -221,9 +221,6 @@ public class ContextHubInfo implements Parcelable {


    /**
    /**
     * @return the CHRE platform ID as defined in chre/version.h
     * @return the CHRE platform ID as defined in chre/version.h
     *
     * TODO(b/67734082): Expose as public API
     * @hide
     */
     */
    public long getChrePlatformId() {
    public long getChrePlatformId() {
        return mChrePlatformId;
        return mChrePlatformId;
@@ -231,9 +228,6 @@ public class ContextHubInfo implements Parcelable {


    /**
    /**
     * @return the CHRE API's major version as defined in chre/version.h
     * @return the CHRE API's major version as defined in chre/version.h
     *
     * TODO(b/67734082): Expose as public API
     * @hide
     */
     */
    public byte getChreApiMajorVersion() {
    public byte getChreApiMajorVersion() {
        return mChreApiMajorVersion;
        return mChreApiMajorVersion;
@@ -241,9 +235,6 @@ public class ContextHubInfo implements Parcelable {


    /**
    /**
     * @return the CHRE API's minor version as defined in chre/version.h
     * @return the CHRE API's minor version as defined in chre/version.h
     *
     * TODO(b/67734082): Expose as public API
     * @hide
     */
     */
    public byte getChreApiMinorVersion() {
    public byte getChreApiMinorVersion() {
        return mChreApiMinorVersion;
        return mChreApiMinorVersion;
@@ -251,9 +242,6 @@ public class ContextHubInfo implements Parcelable {


    /**
    /**
     * @return the CHRE patch version as defined in chre/version.h
     * @return the CHRE patch version as defined in chre/version.h
     *
     * TODO(b/67734082): Expose as public API
     * @hide
     */
     */
    public short getChrePatchVersion() {
    public short getChrePatchVersion() {
        return mChrePatchVersion;
        return mChrePatchVersion;
+49 −14
Original line number Original line Diff line number Diff line
@@ -62,7 +62,11 @@ public final class ContextHubManager {


    /**
    /**
     * An interface to receive asynchronous communication from the context hub.
     * An interface to receive asynchronous communication from the context hub.
     *
     * @deprecated Use the more refined {@link android.hardware.location.ContextHubClientCallback}
     *             instead for notification callbacks.
     */
     */
    @Deprecated
    public abstract static class Callback {
    public abstract static class Callback {
        protected Callback() {}
        protected Callback() {}


@@ -101,8 +105,13 @@ public final class ContextHubManager {


    /**
    /**
     * Get a handle to all the context hubs in the system
     * Get a handle to all the context hubs in the system
     *
     * @return array of context hub handles
     * @return array of context hub handles
     *
     * @deprecated Use {@link #getContextHubs()} instead. The use of handles are deprecated in the
     *             new APIs.
     */
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    public int[] getContextHubHandles() {
    public int[] getContextHubHandles() {
        try {
        try {
@@ -119,7 +128,11 @@ public final class ContextHubManager {
     * @return ContextHubInfo Information about the requested context hub.
     * @return ContextHubInfo Information about the requested context hub.
     *
     *
     * @see ContextHubInfo
     * @see ContextHubInfo
     *
     * @deprecated Use {@link #getContextHubs()} instead. The use of handles are deprecated in the
     *             new APIs.
     */
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    public ContextHubInfo getContextHubInfo(int hubHandle) {
    public ContextHubInfo getContextHubInfo(int hubHandle) {
        try {
        try {
@@ -147,7 +160,10 @@ public final class ContextHubManager {
     *         -1 otherwise
     *         -1 otherwise
     *
     *
     * @see NanoApp
     * @see NanoApp
     *
     * @deprecated Use {@link #loadNanoApp(ContextHubInfo, NanoAppBinary)} instead.
     */
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    public int loadNanoApp(int hubHandle, @NonNull NanoApp app) {
    public int loadNanoApp(int hubHandle, @NonNull NanoApp app) {
        try {
        try {
@@ -171,7 +187,10 @@ public final class ContextHubManager {
     *
     *
     * @return 0 if the command for unloading was sent to the context hub;
     * @return 0 if the command for unloading was sent to the context hub;
     *         -1 otherwise
     *         -1 otherwise
     *
     * @deprecated Use {@link #unloadNanoApp(ContextHubInfo, long)} instead.
     */
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    public int unloadNanoApp(int nanoAppHandle) {
    public int unloadNanoApp(int nanoAppHandle) {
        try {
        try {
@@ -207,7 +226,11 @@ public final class ContextHubManager {
     *                             does not exist
     *                             does not exist
     *
     *
     * @see NanoAppInstanceInfo
     * @see NanoAppInstanceInfo
     *
     * @deprecated Use {@link #queryNanoApps(ContextHubInfo)} instead to explicitly query the hub
     *             for loaded nanoapps.
     */
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @Nullable public NanoAppInstanceInfo getNanoAppInstanceInfo(int nanoAppHandle) {
    @Nullable public NanoAppInstanceInfo getNanoAppInstanceInfo(int nanoAppHandle) {
        try {
        try {
@@ -226,7 +249,11 @@ public final class ContextHubManager {
     * @see NanoAppFilter
     * @see NanoAppFilter
     *
     *
     * @return int[] Array of handles to any found nano apps
     * @return int[] Array of handles to any found nano apps
     *
     * @deprecated Use {@link #queryNanoApps(ContextHubInfo)} instead to explicitly query the hub
     *             for loaded nanoapps.
     */
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @NonNull public int[] findNanoAppOnHub(int hubHandle, @NonNull NanoAppFilter filter) {
    @NonNull public int[] findNanoAppOnHub(int hubHandle, @NonNull NanoAppFilter filter) {
        try {
        try {
@@ -254,7 +281,14 @@ public final class ContextHubManager {
     * @see ContextHubMessage
     * @see ContextHubMessage
     *
     *
     * @return int 0 on success, -1 otherwise
     * @return int 0 on success, -1 otherwise
     *
     * @deprecated Use {@link android.hardware.location.ContextHubClient#sendMessageToNanoApp(
     *             NanoAppMessage)} instead, after creating a
     *             {@link android.hardware.location.ContextHubClient} with
     *             {@link #createClient(ContextHubInfo, ContextHubClientCallback, Executor)}
     *             or {@link #createClient(ContextHubInfo, ContextHubClientCallback)}.
     */
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    public int sendMessage(int hubHandle, int nanoAppHandle, @NonNull ContextHubMessage message) {
    public int sendMessage(int hubHandle, int nanoAppHandle, @NonNull ContextHubMessage message) {
        try {
        try {
@@ -270,8 +304,6 @@ public final class ContextHubManager {
     * @return the list of ContextHubInfo objects
     * @return the list of ContextHubInfo objects
     *
     *
     * @see ContextHubInfo
     * @see ContextHubInfo
     *
     * @hide
     */
     */
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @NonNull public List<ContextHubInfo> getContextHubs() {
    @NonNull public List<ContextHubInfo> getContextHubs() {
@@ -349,8 +381,6 @@ public final class ContextHubManager {
     * @throws NullPointerException if hubInfo or NanoAppBinary is null
     * @throws NullPointerException if hubInfo or NanoAppBinary is null
     *
     *
     * @see NanoAppBinary
     * @see NanoAppBinary
     *
     * @hide
     */
     */
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @NonNull public ContextHubTransaction<Void> loadNanoApp(
    @NonNull public ContextHubTransaction<Void> loadNanoApp(
@@ -380,8 +410,6 @@ public final class ContextHubManager {
     * @return the ContextHubTransaction of the request
     * @return the ContextHubTransaction of the request
     *
     *
     * @throws NullPointerException if hubInfo is null
     * @throws NullPointerException if hubInfo is null
     *
     * @hide
     */
     */
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @NonNull public ContextHubTransaction<Void> unloadNanoApp(
    @NonNull public ContextHubTransaction<Void> unloadNanoApp(
@@ -410,8 +438,6 @@ public final class ContextHubManager {
     * @return the ContextHubTransaction of the request
     * @return the ContextHubTransaction of the request
     *
     *
     * @throws NullPointerException if hubInfo is null
     * @throws NullPointerException if hubInfo is null
     *
     * @hide
     */
     */
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @NonNull public ContextHubTransaction<Void> enableNanoApp(
    @NonNull public ContextHubTransaction<Void> enableNanoApp(
@@ -440,8 +466,6 @@ public final class ContextHubManager {
     * @return the ContextHubTransaction of the request
     * @return the ContextHubTransaction of the request
     *
     *
     * @throws NullPointerException if hubInfo is null
     * @throws NullPointerException if hubInfo is null
     *
     * @hide
     */
     */
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @NonNull public ContextHubTransaction<Void> disableNanoApp(
    @NonNull public ContextHubTransaction<Void> disableNanoApp(
@@ -469,8 +493,6 @@ public final class ContextHubManager {
     * @return the ContextHubTransaction of the request
     * @return the ContextHubTransaction of the request
     *
     *
     * @throws NullPointerException if hubInfo is null
     * @throws NullPointerException if hubInfo is null
     *
     * @hide
     */
     */
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @NonNull public ContextHubTransaction<List<NanoAppState>> queryNanoApps(
    @NonNull public ContextHubTransaction<List<NanoAppState>> queryNanoApps(
@@ -498,7 +520,12 @@ public final class ContextHubManager {
     * @see Callback
     * @see Callback
     *
     *
     * @return int 0 on success, -1 otherwise
     * @return int 0 on success, -1 otherwise
     *
     * @deprecated Use {@link #createClient(ContextHubInfo, ContextHubClientCallback, Executor)}
     *             or {@link #createClient(ContextHubInfo, ContextHubClientCallback)} instead to
     *             register a {@link android.hardware.location.ContextHubClientCallback}.
     */
     */
    @Deprecated
    @SuppressLint("Doclava125")
    @SuppressLint("Doclava125")
    public int registerCallback(@NonNull Callback callback) {
    public int registerCallback(@NonNull Callback callback) {
        return registerCallback(callback, null);
        return registerCallback(callback, null);
@@ -527,7 +554,12 @@ public final class ContextHubManager {
     * @see Callback
     * @see Callback
     *
     *
     * @return int 0 on success, -1 otherwise
     * @return int 0 on success, -1 otherwise
     *
     * @deprecated Use {@link #createClient(ContextHubInfo, ContextHubClientCallback, Executor)}
     *             or {@link #createClient(ContextHubInfo, ContextHubClientCallback)} instead to
     *             register a {@link android.hardware.location.ContextHubClientCallback}.
     */
     */
    @Deprecated
    @SuppressLint("Doclava125")
    @SuppressLint("Doclava125")
    public int registerCallback(Callback callback, Handler handler) {
    public int registerCallback(Callback callback, Handler handler) {
        synchronized(this) {
        synchronized(this) {
@@ -606,7 +638,6 @@ public final class ContextHubManager {
     * @throws IllegalStateException    if there were too many registered clients at the service
     * @throws IllegalStateException    if there were too many registered clients at the service
     * @throws NullPointerException     if callback, hubInfo, or executor is null
     * @throws NullPointerException     if callback, hubInfo, or executor is null
     *
     *
     * @hide
     * @see ContextHubClientCallback
     * @see ContextHubClientCallback
     */
     */
    @NonNull public ContextHubClient createClient(
    @NonNull public ContextHubClient createClient(
@@ -642,7 +673,7 @@ public final class ContextHubManager {
     * @throws IllegalArgumentException if hubInfo does not represent a valid hub
     * @throws IllegalArgumentException if hubInfo does not represent a valid hub
     * @throws IllegalStateException    if there were too many registered clients at the service
     * @throws IllegalStateException    if there were too many registered clients at the service
     * @throws NullPointerException     if callback or hubInfo is null
     * @throws NullPointerException     if callback or hubInfo is null
     * @hide
     *
     * @see ContextHubClientCallback
     * @see ContextHubClientCallback
     */
     */
    @NonNull public ContextHubClient createClient(
    @NonNull public ContextHubClient createClient(
@@ -658,8 +689,12 @@ public final class ContextHubManager {
     * @param callback method to deregister
     * @param callback method to deregister
     *
     *
     * @return int 0 on success, -1 otherwise
     * @return int 0 on success, -1 otherwise
     *
     * @deprecated Use {@link android.hardware.location.ContextHubClient#close()} to unregister
     *             a {@link android.hardware.location.ContextHubClientCallback}.
     */
     */
    @SuppressLint("Doclava125")
    @SuppressLint("Doclava125")
    @Deprecated
    public int unregisterCallback(@NonNull Callback callback) {
    public int unregisterCallback(@NonNull Callback callback) {
      synchronized(this) {
      synchronized(this) {
          if (callback != mCallback) {
          if (callback != mCallback) {
Loading