Loading services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java +10 −2 Original line number Diff line number Diff line Loading @@ -449,7 +449,7 @@ public class ContextHubClientBroker extends IContextHubClient.Stub } /** * Sends a reliable message rom this client to a nanoapp. * Sends a reliable message from this client to a nanoapp. * * @param message the message to send * @param transactionCallback The callback to use to confirm the delivery of the message for Loading @@ -473,6 +473,12 @@ public class ContextHubClientBroker extends IContextHubClient.Stub @Nullable IContextHubTransactionCallback transactionCallback) { ContextHubServiceUtil.checkPermissions(mContext); // Clear the isReliable and messageSequenceNumber fields. // These will be set to true and a real value if the message // is reliable. message.setIsReliable(false); message.setMessageSequenceNumber(0); @ContextHubTransaction.Result int result; if (isRegistered()) { int authState = mMessageChannelNanoappIdMap.getOrDefault( Loading @@ -485,7 +491,9 @@ public class ContextHubClientBroker extends IContextHubClient.Stub // Return a bland error code for apps targeting old SDKs since they wouldn't be able // to use an error code added in S. return ContextHubTransaction.RESULT_FAILED_UNKNOWN; } else if (authState == AUTHORIZATION_UNKNOWN) { } if (authState == AUTHORIZATION_UNKNOWN) { // Only check permissions the first time a nanoapp is queried since nanoapp // permissions don't currently change at runtime. If the host permission changes // later, that'll be checked by onOpChanged. Loading Loading
services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java +10 −2 Original line number Diff line number Diff line Loading @@ -449,7 +449,7 @@ public class ContextHubClientBroker extends IContextHubClient.Stub } /** * Sends a reliable message rom this client to a nanoapp. * Sends a reliable message from this client to a nanoapp. * * @param message the message to send * @param transactionCallback The callback to use to confirm the delivery of the message for Loading @@ -473,6 +473,12 @@ public class ContextHubClientBroker extends IContextHubClient.Stub @Nullable IContextHubTransactionCallback transactionCallback) { ContextHubServiceUtil.checkPermissions(mContext); // Clear the isReliable and messageSequenceNumber fields. // These will be set to true and a real value if the message // is reliable. message.setIsReliable(false); message.setMessageSequenceNumber(0); @ContextHubTransaction.Result int result; if (isRegistered()) { int authState = mMessageChannelNanoappIdMap.getOrDefault( Loading @@ -485,7 +491,9 @@ public class ContextHubClientBroker extends IContextHubClient.Stub // Return a bland error code for apps targeting old SDKs since they wouldn't be able // to use an error code added in S. return ContextHubTransaction.RESULT_FAILED_UNKNOWN; } else if (authState == AUTHORIZATION_UNKNOWN) { } if (authState == AUTHORIZATION_UNKNOWN) { // Only check permissions the first time a nanoapp is queried since nanoapp // permissions don't currently change at runtime. If the host permission changes // later, that'll be checked by onOpChanged. Loading