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

Commit 09afc2e4 authored by Dan Sandler's avatar Dan Sandler
Browse files

Defend against null ApplicationInfos.

Bug: 16303792
Change-Id: Id2d7a70f92718ecda8e3ff418c4e109f6982a75f
parent 9f6799be
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2366,6 +2366,9 @@ public class NotificationManagerService extends SystemService {
        try {
            ApplicationInfo ai = AppGlobals.getPackageManager().getApplicationInfo(
                    pkg, 0, UserHandle.getCallingUserId());
            if (ai == null) {
                throw new SecurityException("Unknown package " + pkg);
            }
            if (!UserHandle.isSameApp(ai.uid, uid)) {
                throw new SecurityException("Calling uid " + uid + " gave package"
                        + pkg + " which is owned by uid " + ai.uid);