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

Commit f25013c3 authored by Eugene Susla's avatar Eugene Susla
Browse files

Avoid crashing on unknown package in pregrants exceptions

Test: presubmit
Fixes: 121200439
Change-Id: I59d1be568fc238fa097056dde171b06753837744
parent 3d6fff4d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1473,6 +1473,13 @@ public final class DefaultPermissionGrantPolicy {
                if (packageExceptions == null) {
                    // The package must be on the system image
                    PackageInfo packageInfo = getSystemPackageInfo(packageName);

                    if (packageInfo == null) {
                        Log.w(TAG, "No such package:" + packageName);
                        XmlUtils.skipCurrentTag(parser);
                        continue;
                    }

                    if (!isSystemPackage(packageInfo)) {
                        Log.w(TAG, "Unknown system package:" + packageName);
                        XmlUtils.skipCurrentTag(parser);