Skip to content

Commit

Permalink
Do not clean up ART profiles during OTAs
Browse files Browse the repository at this point in the history
Test: manual, upgrade & test for profiles
Bug: 135299330

(cherry picked from commit 86b6bbd4c593aedb3c5e27995727fb2cb55c604b)

Merged-In: I39d3376fc845ec5f2b474ea6f39a3c534ed2ce69
Change-Id: I29833113f7d0806733be669cfbc6fe2b206a982f
  • Loading branch information
Calin Juravle authored and PMS22 committed Apr 16, 2020
1 parent a6d9d77 commit 832f885
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions services/core/java/com/android/server/pm/Installer.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ public class Installer extends SystemService {
public static final int FLAG_USE_QUOTA = IInstalld.FLAG_USE_QUOTA;
public static final int FLAG_FORCE = IInstalld.FLAG_FORCE;

public static final int FLAG_CLEAR_APP_DATA_KEEP_ART_PROFILES =
IInstalld.FLAG_CLEAR_APP_DATA_KEEP_ART_PROFILES;

private final boolean mIsolated;

private volatile IInstalld mInstalld;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3282,7 +3282,8 @@ public PackageManagerService(Context context, Installer installer,
// No apps are running this early, so no need to freeze
clearAppDataLIF(ps.pkg, UserHandle.USER_ALL,
FLAG_STORAGE_DE | FLAG_STORAGE_CE | FLAG_STORAGE_EXTERNAL
| Installer.FLAG_CLEAR_CODE_CACHE_ONLY);
| Installer.FLAG_CLEAR_CODE_CACHE_ONLY
| Installer.FLAG_CLEAR_APP_DATA_KEEP_ART_PROFILES);
}
}
ver.fingerprint = Build.DATE;
Expand Down Expand Up @@ -10394,7 +10395,9 @@ private void clearAppDataLIF(PackageParser.Package pkg, int userId, int flags) {
clearAppDataLeafLIF(pkg.childPackages.get(i), userId, flags);
}

clearAppProfilesLIF(pkg, UserHandle.USER_ALL);
if ((flags & Installer.FLAG_CLEAR_APP_DATA_KEEP_ART_PROFILES) == 0) {
clearAppProfilesLIF(pkg, UserHandle.USER_ALL);
}
}

private void clearAppDataLeafLIF(PackageParser.Package pkg, int userId, int flags) {
Expand Down Expand Up @@ -22737,7 +22740,8 @@ private void loadPrivatePackagesInner(VolumeInfo vol) {

if (!Build.DATE.equals(ver.fingerprint)) {
clearAppDataLIF(ps.pkg, UserHandle.USER_ALL, FLAG_STORAGE_DE | FLAG_STORAGE_CE
| FLAG_STORAGE_EXTERNAL | Installer.FLAG_CLEAR_CODE_CACHE_ONLY);
| FLAG_STORAGE_EXTERNAL | Installer.FLAG_CLEAR_CODE_CACHE_ONLY
| Installer.FLAG_CLEAR_APP_DATA_KEEP_ART_PROFILES);
}
}
}
Expand Down

0 comments on commit 832f885

Please sign in to comment.