diff options
| author | 2014-06-24 12:19:10 +0000 | |
|---|---|---|
| committer | 2014-06-24 12:19:10 +0000 | |
| commit | 152d5cd30bdfd88b0903b205d38c6966cbded5a8 (patch) | |
| tree | d87a5e99b7aff51bb1e663b4e2880cac2c473817 | |
| parent | 816cff12e1864c4e3d2a9bdc5f57b4b8cc03ac86 (diff) | |
| parent | 22a32d883794a7a96ff5ffb4830ea59065b3ebda (diff) | |
am 22a32d88: am 2a0f9e6a: Merge "Explicitly list out the list of cache subdirs to prune."
* commit '22a32d883794a7a96ff5ffb4830ea59065b3ebda':
Explicitly list out the list of cache subdirs to prune.
| -rw-r--r-- | services/core/java/com/android/server/pm/Installer.java | 5 | ||||
| -rwxr-xr-x | services/core/java/com/android/server/pm/PackageManagerService.java | 13 |
2 files changed, 12 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/pm/Installer.java b/services/core/java/com/android/server/pm/Installer.java index c0f1eec19e25..718996011d8e 100644 --- a/services/core/java/com/android/server/pm/Installer.java +++ b/services/core/java/com/android/server/pm/Installer.java @@ -27,6 +27,7 @@ import android.util.Slog; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.List; public final class Installer extends SystemService { private static final String TAG = "Installer"; @@ -345,8 +346,8 @@ public final class Installer extends SystemService { } } - public int pruneDexCache() { - return execute("prunedexcache"); + public int pruneDexCache(String cacheSubDir) { + return execute("prunedexcache " + cacheSubDir); } public int freeCache(long freeStorageSize) { diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 3736df4662ac..2f5350481848 100755 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -1443,9 +1443,6 @@ public class PackageManagerService extends IPackageManager.Stub { // changed. Consider this significant, and wipe away all other // existing dexopt files to ensure we don't leave any dangling around. // - // Additionally, delete all dex files from the root directory - // since there shouldn't be any there anyway. - // // TODO: This should be revisited because it isn't as good an indicator // as it used to be. It used to include the boot classpath but at some point // DexFile.isDexOptNeeded started returning false for the boot @@ -1453,7 +1450,15 @@ public class PackageManagerService extends IPackageManager.Stub { // small maintenance release update that the library and tool // jars may be unchanged but APK could be removed resulting in // unused dalvik-cache files. - mInstaller.pruneDexCache(); + for (String instructionSet : instructionSets) { + mInstaller.pruneDexCache(instructionSet); + } + + // Additionally, delete all dex files from the root directory + // since there shouldn't be any there anyway, unless we're upgrading + // from an older OS version or a build that contained the "old" style + // flat scheme. + mInstaller.pruneDexCache("."); } // Collect vendor overlay packages. |