summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nate Myren <ntmyren@google.com> 2024-01-16 18:37:27 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-01-16 18:37:27 +0000
commit5b4e13aaa4c532aa2e4bb619ccc785cd3f20487a (patch)
tree1a9ae172dc6fedb79be92fb1fbe0e0a2a6303cc1
parente90f0d5a2400f62a33771c29a47b0fc549ff108f (diff)
parent5ab1d831e0967072b79a85d24d0be518e0dffe52 (diff)
Merge "Clear calling identity when checking if NLS is trusted" into main
-rwxr-xr-xservices/core/java/com/android/server/notification/NotificationManagerService.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 9ddc362769f6..c9f45e523e3b 100755
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -12103,6 +12103,7 @@ public class NotificationManagerService extends SystemService {
return true;
}
+ long token = Binder.clearCallingIdentity();
try {
if (mPackageManager.checkUidPermission(RECEIVE_SENSITIVE_NOTIFICATIONS, uid)
== PERMISSION_GRANTED || mPackageManagerInternal.isPlatformSigned(pkg)) {
@@ -12129,6 +12130,8 @@ public class NotificationManagerService extends SystemService {
}
} catch (RemoteException e) {
Slog.e(TAG, "Failed to check trusted status of listener", e);
+ } finally {
+ Binder.restoreCallingIdentity(token);
}
return false;
}