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

Commit f3dfe171 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Include self in permission check for MANAGE_NOTIFICATIONS" into main

parents 35798f9a c24844d2
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -6145,7 +6145,7 @@ public class NotificationManagerService extends SystemService {
        }
        private void enforcePolicyAccess(int uid, String method) {
            if (PERMISSION_GRANTED == getContext().checkCallingPermission(
            if (PERMISSION_GRANTED == getContext().checkCallingOrSelfPermission(
                    android.Manifest.permission.MANAGE_NOTIFICATIONS)) {
                return;
            }
@@ -6176,7 +6176,7 @@ public class NotificationManagerService extends SystemService {
        }
        private void enforcePolicyAccess(String pkg, String method) {
            if (PERMISSION_GRANTED == getContext().checkCallingPermission(
            if (PERMISSION_GRANTED == getContext().checkCallingOrSelfPermission(
                    android.Manifest.permission.MANAGE_NOTIFICATIONS)) {
                return;
            }
@@ -6985,6 +6985,7 @@ public class NotificationManagerService extends SystemService {
    protected void checkNotificationListenerAccess() {
        if (!isCallerSystemOrPhone()) {
            // Safe to check calling permission as caller is already not system or phone
            getContext().enforceCallingPermission(
                    permission.MANAGE_NOTIFICATION_LISTENERS,
                    "Caller must hold " + permission.MANAGE_NOTIFICATION_LISTENERS);