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

Commit fb5f2e57 authored by Andreas Gampe's avatar Andreas Gampe Committed by Android (Google) Code Review
Browse files

Merge "Frameworks/base: Extract packages after cache pruning" into nyc-dev

parents 336d8a80 d7f9220a
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -6891,7 +6891,8 @@ public class PackageManagerService extends IPackageManager.Stub {
        // Extract pacakges only if profile-guided compilation is enabled because
        // otherwise BackgroundDexOptService will not dexopt them later.
        if (!isUpgrade()) {
        boolean prunedCache = VMRuntime.didPruneDalvikCache();
        if (!isUpgrade() && !prunedCache) {
            return;
        }
@@ -6919,8 +6920,11 @@ public class PackageManagerService extends IPackageManager.Stub {
            }
            if (PackageDexOptimizer.canOptimizePackage(pkg)) {
                // If the cache was pruned, any compiled odex files will likely be out of date
                // and would have to be patched (would be SELF_PATCHOAT, which is deprecated).
                // Instead, force the extraction in this case.
                performDexOpt(pkg.packageName, null /* instructionSet */,
                         false /* useProfiles */, true /* extractOnly */, false /* force */);
                         false /* useProfiles */, true /* extractOnly */, prunedCache);
            }
        }
    }