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

Commit 5921f817 authored by Julia Reynolds's avatar Julia Reynolds Committed by android-build-merger
Browse files

Merge \"Check uid for notification policy access.\" into nyc-dev

am: 8f17d2a4

Change-Id: Ibe8b12cb0bb57a31e0e1ca077863b2cf63daba1a
parents 72022a69 8f17d2a4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1983,6 +1983,7 @@ public class NotificationManagerService extends SystemService {
                    android.Manifest.permission.MANAGE_NOTIFICATIONS)) {
                return;
            }
            checkCallerIsSameApp(pkg);
            if (!checkPolicyAccess(pkg)) {
                Slog.w(TAG, "Notification policy access denied calling " + method);
                throw new SecurityException("Notification policy access denied");
@@ -3643,6 +3644,10 @@ public class NotificationManagerService extends SystemService {
        if (isCallerSystem()) {
            return;
        }
        checkCallerIsSameApp(pkg);
    }

    private static void checkCallerIsSameApp(String pkg) {
        final int uid = Binder.getCallingUid();
        try {
            ApplicationInfo ai = AppGlobals.getPackageManager().getApplicationInfo(