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

Commit c24844d2 authored by Garvit Narang's avatar Garvit Narang
Browse files

Include self in permission check for MANAGE_NOTIFICATIONS

Bug: 380326093
Test: manual flash and check, presubmit
Flag: EXEMPT trivial

Change-Id: I79ecb9e6ed8112780ed6f73621bce736ba981607
parent 721bb4ae
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -6134,7 +6134,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;
            }
@@ -6165,7 +6165,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;
            }
@@ -6974,6 +6974,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);