From 6694dbef38c3fe2c5ceef19d0ddd57b6d5b0b587 Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Tue, 10 May 2016 17:19:54 +0100 Subject: [PATCH] Do not clear profiles after OTAs Bug: 28689868 Change-Id: I21b75eb6918915b16b0d1a06e753a56822834a2d --- .../java/com/android/server/pm/PackageManagerService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 87e3d40f324f2..a849184582973 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -2693,6 +2693,9 @@ public class PackageManagerService extends IPackageManager.Stub { // If this is first boot after an OTA, and a normal boot, then // we need to clear code cache directories. + // Note that we do *not* clear the application profiles. These remain valid + // across OTAs and are used to drive profile verification (post OTA) and + // profile compilation (without waiting to collect a fresh set of profiles). if (mIsUpgrade && !onlyCore) { Slog.i(TAG, "Build fingerprint changed; clearing code caches"); for (int i = 0; i < mSettings.mPackages.size(); i++) { @@ -2703,7 +2706,6 @@ public class PackageManagerService extends IPackageManager.Stub { StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE | Installer.FLAG_CLEAR_CODE_CACHE_ONLY); } - clearAppProfilesLIF(ps.pkg); } ver.fingerprint = Build.FINGERPRINT; }