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

Commit 89e2c90c authored by Svet Ganov's avatar Svet Ganov
Browse files

Fix a NPE in PackageInstaller

We were returing a null PermissionGroup object to a place
where this was not expected by design. The reason for that
was an incorrect fix for b/28241097. This CL reverts the
introduced regression and adds a null check just in case.

bug:27102458

Change-Id: I78f8107d0adf6bb2da5d8e11c5f3cf3c00fe36a2
parent eff96c98
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -162,10 +162,6 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
            group.addPermission(permission);
        }

        if (group.getPermissions().isEmpty()) {
            return null;
        }

        return group;
    }

+4 −0
Original line number Diff line number Diff line
@@ -190,6 +190,10 @@ public class PermissionApps {
                    AppPermissionGroup group = AppPermissionGroup.create(mContext,
                            app, groupInfo, groupPermInfos, user);

                    if (group == null) {
                        continue;
                    }

                    String label = mSkipUi ? app.packageName
                            : app.applicationInfo.loadLabel(mPm).toString();
                    PermissionApp permApp = new PermissionApp(app.packageName,