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

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

Merge \\\"Check caller\\\'s uid before allowing notification policy...

Merge \\\"Check caller\\\'s uid before allowing notification policy access.\\\" into mnc-dev am: 234e1c25 am: 8e8bb663
am: 5c6db3af

Change-Id: Ie212c6105f8796f0e7c4ccf25ea132b8c9f99519
parents ff58d7c9 5c6db3af
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1643,6 +1643,7 @@ public class NotificationManagerService extends SystemService {
        }

        private void enforcePolicyAccess(String pkg, String method) {
            checkCallerIsSameApp(pkg);
            if (!checkPolicyAccess(pkg)) {
                Slog.w(TAG, "Notification policy access denied calling " + method);
                throw new SecurityException("Notification policy access denied");
@@ -3131,6 +3132,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(