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

Commit 22a04044 authored by Alex Buynytskyy's avatar Alex Buynytskyy
Browse files

Create per-user state(s) on user creation, for archived packages.

Fixes: 326223729
Test: atest PackageManagerTest
Test: repro steps in https://b.corp.google.com/issues/326223729#comment37
Change-Id: I660c9c2e487119a5f08b2c1dea1dadf2ebc26531
parent 32458607
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -4558,6 +4558,10 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
            for (int i = 0; i < size; i++) {
                final PackageSetting ps = mPackages.valueAt(i);
                if (ps.getPkg() == null) {
                    // This would force-create correct per-user state.
                    ps.setInstalled(false, userHandle);
                    // Make sure the app is excluded from storage mapping for this user.
                    writeKernelMappingLPr(ps);
                    continue;
                }
                final boolean shouldMaybeInstall = ps.isSystem() &&