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

Commit be62ae7d authored by Alex Buynytskyy's avatar Alex Buynytskyy
Browse files

Add null check if shared user not found.

Bug: 221205043
Fixes: 221205043
Test: presubmit
Change-Id: I3c812dd9f3993366604816237d6a4f24d5e289f0
parent 09076f0a
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -3906,13 +3906,17 @@ public final class Settings implements Watchable, Snappable {
                } else if (tagName.equals(TAG_PERMISSIONS)) {
                    final LegacyPermissionState legacyState;
                    if (packageSetting.hasSharedUser()) {
                        legacyState = getSettingLPr(
                                packageSetting.getSharedUserAppId()).getLegacyPermissionState();
                        final SettingBase sharedUserSettings = getSettingLPr(
                                packageSetting.getSharedUserAppId());
                        legacyState = sharedUserSettings != null
                                ? sharedUserSettings.getLegacyPermissionState() : null;
                    } else {
                        legacyState = packageSetting.getLegacyPermissionState();
                    }
                    if (legacyState != null) {
                        readInstallPermissionsLPr(parser, legacyState, users);
                        packageSetting.setInstallPermissionsFixed(true);
                    }
                } else if (tagName.equals("proper-signing-keyset")) {
                    long id = parser.getAttributeLong(null, "identifier");
                    Integer refCt = mKeySetRefs.get(id);