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

Commit 30f349d2 authored by Christopher Tate's avatar Christopher Tate Committed by Christopher Tate
Browse files

Don't crash in addPackageHoldingPermissions()...

...in cases involving uninstalled apps, or apps whose install state
varies across different users.

Bug 17398315

Change-Id: I7297d82f8bf5d49c50a7fd53d795a706bf2d2313
parent 69dd40d0
Loading
Loading
Loading
Loading
+15 −11
Original line number Diff line number Diff line
@@ -3783,6 +3783,9 @@ public class PackageManagerService extends IPackageManager.Stub {
        } else {
            pi = generatePackageInfoFromSettingsLPw(ps.name, flags, userId);
        }
        // The above might return null in cases of uninstalled apps or install-state
        // skew across users/profiles.
        if (pi != null) {
            if ((flags&PackageManager.GET_PERMISSIONS) == 0) {
                if (numMatch == permissions.length) {
                    pi.requestedPermissions = permissions;
@@ -3799,6 +3802,7 @@ public class PackageManagerService extends IPackageManager.Stub {
            }
            list.add(pi);
        }
    }
    @Override
    public ParceledListSlice<PackageInfo> getPackagesHoldingPermissions(