Loading core/api/system-current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -3539,6 +3539,7 @@ package android.hardware.location { field public static final int RESULT_FAILED_BAD_PARAMS = 2; // 0x2 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_BUSY = 4; // 0x4 field public static final int RESULT_FAILED_HAL_UNAVAILABLE = 8; // 0x8 field public static final int RESULT_FAILED_HAL_UNAVAILABLE = 8; // 0x8 field public static final int RESULT_FAILED_PERMISSION_DENIED = 9; // 0x9 field public static final int RESULT_FAILED_SERVICE_INTERNAL_FAILURE = 7; // 0x7 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_TIMEOUT = 6; // 0x6 field public static final int RESULT_FAILED_UNINITIALIZED = 3; // 0x3 field public static final int RESULT_FAILED_UNINITIALIZED = 3; // 0x3 Loading core/java/android/hardware/location/ContextHubClient.java +14 −0 Original line number Original line Diff line number Diff line Loading @@ -127,6 +127,20 @@ 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. * * * Before sending the first message to your nanoapp, it's recommended that the following * operations should be performed: * 1) Invoke {@link ContextHubManager#queryNanoApps(ContextHubInfo)} to verify the nanoapp is * present. * 2) Validate that you have the permissions to communicate with the nanoapp by looking at * {@link NanoAppState#getNanoAppPermissions}. * 3) If you don't have permissions, send an idempotent message to the nanoapp ensuring any * work your app previously may have asked it to do is stopped. This is useful if your app * restarts due to permission changes and no longer has the permissions when it is started * again. * 4) If you have valid permissions, send a message to your nanoapp to resubscribe so that it's * aware you have restarted or so you can initially subscribe if this is the first time you * have sent it a message. * * @param message the message object to send * @param message the message object to send * * * @return the result of sending the message defined as in ContextHubTransaction.Result * @return the result of sending the message defined as in ContextHubTransaction.Result Loading core/java/android/hardware/location/ContextHubClientCallback.java +5 −4 Original line number Original line Diff line number Diff line Loading @@ -117,10 +117,11 @@ public class ContextHubClientCallback { * 4) {@link ContextHubClient} performs any cleanup required with the nanoapp * 4) {@link ContextHubClient} performs any cleanup required with the nanoapp * 5) Callback invoked with the nanoapp ID and {@link ContextHubManager#AUTHORIZATION_DENIED}. * 5) Callback invoked with the nanoapp ID and {@link ContextHubManager#AUTHORIZATION_DENIED}. * At this point, any further attempts of communication between the nanoapp and the * At this point, any further attempts of communication between the nanoapp and the * {@link ContextHubClient} will be dropped by the contexthub along with * {@link ContextHubClient} will be dropped by the contexthub and a return value of * {@link ContextHubManager#AUTHORIZATION_DENIED} being sent. The {@link ContextHubClient} * {@link ContextHubTransaction#RESULT_FAILED_PERMISSION_DENIED} will be used when calling * should assume no communciation can happen again until * {@link ContextHubClient#sendMessageToNanoApp}. The {@link ContextHubClient} should assume * {@link ContextHubManager#AUTHORIZATION_GRANTED} is received. * no communciation can happen again until {@link ContextHubManager#AUTHORIZATION_GRANTED} is * received. * * * @param client the client that is associated with this callback * @param client the client that is associated with this callback * @param nanoAppId the ID of the nanoapp associated with the new * @param nanoAppId the ID of the nanoapp associated with the new Loading core/java/android/hardware/location/ContextHubTransaction.java +7 −1 Original line number Original line Diff line number Diff line Loading @@ -81,7 +81,8 @@ public class ContextHubTransaction<T> { RESULT_FAILED_AT_HUB, RESULT_FAILED_AT_HUB, RESULT_FAILED_TIMEOUT, RESULT_FAILED_TIMEOUT, RESULT_FAILED_SERVICE_INTERNAL_FAILURE, RESULT_FAILED_SERVICE_INTERNAL_FAILURE, RESULT_FAILED_HAL_UNAVAILABLE RESULT_FAILED_HAL_UNAVAILABLE, RESULT_FAILED_PERMISSION_DENIED }) }) public @interface Result {} public @interface Result {} public static final int RESULT_SUCCESS = 0; public static final int RESULT_SUCCESS = 0; Loading Loading @@ -117,6 +118,11 @@ public class ContextHubTransaction<T> { * Failure mode when the Context Hub HAL was not available. * Failure mode when the Context Hub HAL was not available. */ */ public static final int RESULT_FAILED_HAL_UNAVAILABLE = 8; public static final int RESULT_FAILED_HAL_UNAVAILABLE = 8; /** * Failure mode when the user of the API doesn't have the required permissions to perform the * operation. */ public static final int RESULT_FAILED_PERMISSION_DENIED = 9; /** /** * A class describing the response for a ContextHubTransaction. * A class describing the response for a ContextHubTransaction. Loading Loading
core/api/system-current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -3539,6 +3539,7 @@ package android.hardware.location { field public static final int RESULT_FAILED_BAD_PARAMS = 2; // 0x2 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_BUSY = 4; // 0x4 field public static final int RESULT_FAILED_HAL_UNAVAILABLE = 8; // 0x8 field public static final int RESULT_FAILED_HAL_UNAVAILABLE = 8; // 0x8 field public static final int RESULT_FAILED_PERMISSION_DENIED = 9; // 0x9 field public static final int RESULT_FAILED_SERVICE_INTERNAL_FAILURE = 7; // 0x7 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_TIMEOUT = 6; // 0x6 field public static final int RESULT_FAILED_UNINITIALIZED = 3; // 0x3 field public static final int RESULT_FAILED_UNINITIALIZED = 3; // 0x3 Loading
core/java/android/hardware/location/ContextHubClient.java +14 −0 Original line number Original line Diff line number Diff line Loading @@ -127,6 +127,20 @@ 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. * * * Before sending the first message to your nanoapp, it's recommended that the following * operations should be performed: * 1) Invoke {@link ContextHubManager#queryNanoApps(ContextHubInfo)} to verify the nanoapp is * present. * 2) Validate that you have the permissions to communicate with the nanoapp by looking at * {@link NanoAppState#getNanoAppPermissions}. * 3) If you don't have permissions, send an idempotent message to the nanoapp ensuring any * work your app previously may have asked it to do is stopped. This is useful if your app * restarts due to permission changes and no longer has the permissions when it is started * again. * 4) If you have valid permissions, send a message to your nanoapp to resubscribe so that it's * aware you have restarted or so you can initially subscribe if this is the first time you * have sent it a message. * * @param message the message object to send * @param message the message object to send * * * @return the result of sending the message defined as in ContextHubTransaction.Result * @return the result of sending the message defined as in ContextHubTransaction.Result Loading
core/java/android/hardware/location/ContextHubClientCallback.java +5 −4 Original line number Original line Diff line number Diff line Loading @@ -117,10 +117,11 @@ public class ContextHubClientCallback { * 4) {@link ContextHubClient} performs any cleanup required with the nanoapp * 4) {@link ContextHubClient} performs any cleanup required with the nanoapp * 5) Callback invoked with the nanoapp ID and {@link ContextHubManager#AUTHORIZATION_DENIED}. * 5) Callback invoked with the nanoapp ID and {@link ContextHubManager#AUTHORIZATION_DENIED}. * At this point, any further attempts of communication between the nanoapp and the * At this point, any further attempts of communication between the nanoapp and the * {@link ContextHubClient} will be dropped by the contexthub along with * {@link ContextHubClient} will be dropped by the contexthub and a return value of * {@link ContextHubManager#AUTHORIZATION_DENIED} being sent. The {@link ContextHubClient} * {@link ContextHubTransaction#RESULT_FAILED_PERMISSION_DENIED} will be used when calling * should assume no communciation can happen again until * {@link ContextHubClient#sendMessageToNanoApp}. The {@link ContextHubClient} should assume * {@link ContextHubManager#AUTHORIZATION_GRANTED} is received. * no communciation can happen again until {@link ContextHubManager#AUTHORIZATION_GRANTED} is * received. * * * @param client the client that is associated with this callback * @param client the client that is associated with this callback * @param nanoAppId the ID of the nanoapp associated with the new * @param nanoAppId the ID of the nanoapp associated with the new Loading
core/java/android/hardware/location/ContextHubTransaction.java +7 −1 Original line number Original line Diff line number Diff line Loading @@ -81,7 +81,8 @@ public class ContextHubTransaction<T> { RESULT_FAILED_AT_HUB, RESULT_FAILED_AT_HUB, RESULT_FAILED_TIMEOUT, RESULT_FAILED_TIMEOUT, RESULT_FAILED_SERVICE_INTERNAL_FAILURE, RESULT_FAILED_SERVICE_INTERNAL_FAILURE, RESULT_FAILED_HAL_UNAVAILABLE RESULT_FAILED_HAL_UNAVAILABLE, RESULT_FAILED_PERMISSION_DENIED }) }) public @interface Result {} public @interface Result {} public static final int RESULT_SUCCESS = 0; public static final int RESULT_SUCCESS = 0; Loading Loading @@ -117,6 +118,11 @@ public class ContextHubTransaction<T> { * Failure mode when the Context Hub HAL was not available. * Failure mode when the Context Hub HAL was not available. */ */ public static final int RESULT_FAILED_HAL_UNAVAILABLE = 8; public static final int RESULT_FAILED_HAL_UNAVAILABLE = 8; /** * Failure mode when the user of the API doesn't have the required permissions to perform the * operation. */ public static final int RESULT_FAILED_PERMISSION_DENIED = 9; /** /** * A class describing the response for a ContextHubTransaction. * A class describing the response for a ContextHubTransaction. Loading