From e8a0442b0842021547aaf9918072a023098d8c39 Mon Sep 17 00:00:00 2001 From: Chia-Chi Teng Date: Fri, 27 Sep 2024 22:15:18 +0000 Subject: Add log message for nanoapp auth errors Flag: EXEMPT log only update Bug: 339102088 Test: on device Change-Id: Iba7b22d65753ca68c5bd7b0c77929f07a1122e1b --- .../server/location/contexthub/ContextHubClientBroker.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java b/services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java index 91a4d6f1707f..598901e33305 100644 --- a/services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java +++ b/services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java @@ -764,6 +764,7 @@ public class ContextHubClientBroker extends IContextHubClient.Stub boolean hasPermissions(List permissions) { for (String permission : permissions) { if (mContext.checkPermission(permission, mPid, mUid) != PERMISSION_GRANTED) { + Log.e(TAG, "no permission for " + permission); return false; } } @@ -919,6 +920,14 @@ public class ContextHubClientBroker extends IContextHubClient.Stub } } if (curAuthState != newAuthState) { + if (newAuthState == AUTHORIZATION_DENIED + || newAuthState == AUTHORIZATION_DENIED_GRACE_PERIOD) { + Log.e(TAG, "updateNanoAppAuthState auth error: " + + Long.toHexString(nanoAppId) + ", " + + nanoappPermissions + ", " + + gracePeriodExpired + ", " + + forceDenied); + } // Don't send the callback in the synchronized block or it could end up in a deadlock. sendAuthStateCallback(nanoAppId, newAuthState); } -- cgit v1.2.3-59-g8ed1b