Defend against null ApplicationInfos.
Bug: 16303792 Change-Id: Id2d7a70f92718ecda8e3ff418c4e109f6982a75f
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user