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

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

Merge \\"Check uid for notification policy access.\\" into nyc-mr1-dev am: 48815309

am: 5d89ccad

Change-Id: Ic22bb1ef2ec3626f0101603fef3d043d6a3f3307
parents 96c0bc2e 5d89ccad
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1997,6 +1997,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");
@@ -3655,6 +3656,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(