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

Commit 0ebd2789 authored by Song Chun Fan's avatar Song Chun Fan Committed by Android (Google) Code Review
Browse files

Merge "[pm] set firstInstallTime for system apps on createNewUser" into main

parents 21c33ccf 2bc720fa
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -4537,6 +4537,8 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
        t.traceBegin("createNewUser-" + userHandle);
        Installer.Batch batch = new Installer.Batch();
        final boolean skipPackageAllowList = userTypeInstallablePackages == null;
        // Use the same timestamp for all system apps that are to be installed on the new user
        final long currentTimeMillis = System.currentTimeMillis();
        synchronized (mLock) {
            final int size = mPackages.size();
            for (int i = 0; i < size; i++) {
@@ -4552,6 +4554,9 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
                                ps.getPackageName()));
                // Only system apps are initially installed.
                ps.setInstalled(shouldReallyInstall, userHandle);
                if (Flags.fixSystemAppsFirstInstallTime() && shouldReallyInstall) {
                    ps.setFirstInstallTime(currentTimeMillis, userHandle);
                }

                // Non-Apex system apps, that are not included in the allowlist in
                // initialNonStoppedSystemPackages, should be marked as stopped by default.