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

Commit bf04ea6d authored by Patrick Baumann's avatar Patrick Baumann Committed by Sterling Huber
Browse files

RESTRICT AUTOMERGE

Fixes NPE when preparing app data during init

When deleting an unused static shared library on Q, the user manager was
fetched via mContext.getSystemService. At this time during boot, the
service wasn't registered and so null was returned. This has already
been addressed in R with a move to injecting dependencies in the
PackageManagerService constructor.

Bug: 142083996
Bug: 141413692
Test: manual; remove static dependency on eng Q build and reboot
Change-Id: I8ae4e331d09b4734c54cdc6887b273705dce88b1
Merged In: I8ae4e331d09b4734c54cdc6887b273705dce88b1
parent 428a2722
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -22937,9 +22937,9 @@ public class PackageManagerService extends IPackageManager.Stub
            mSettings.writeKernelMappingLPr(ps);
        }
        final UserManager um = mContext.getSystemService(UserManager.class);
        final UserManagerService um = sUserManager;
        UserManagerInternal umInternal = getUserManagerInternal();
        for (UserInfo user : um.getUsers()) {
        for (UserInfo user : um.getUsers(false /* excludeDying */)) {
            final int flags;
            if (umInternal.isUserUnlockingOrUnlocked(user.id)) {
                flags = StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE;