From e545035e0ece992941047d7676a53d090c81448d Mon Sep 17 00:00:00 2001 From: Alex Light Date: Thu, 28 Aug 2014 16:17:55 -0700 Subject: [PATCH] Remove obsolete pruneDexCache Bug: 16875245 (cherry picked from commit 09107db4916913912e61bfe592643b9c4c50b500) Change-Id: I06e14c405aa4af295795982c1d236be3cb00e893 --- .../java/com/android/server/pm/Installer.java | 4 ---- .../server/pm/PackageManagerService.java | 23 ------------------- 2 files changed, 27 deletions(-) diff --git a/services/core/java/com/android/server/pm/Installer.java b/services/core/java/com/android/server/pm/Installer.java index 694669c091251..ca11862fa0f61 100644 --- a/services/core/java/com/android/server/pm/Installer.java +++ b/services/core/java/com/android/server/pm/Installer.java @@ -224,10 +224,6 @@ public final class Installer extends SystemService { } } - public int pruneDexCache(String cacheSubDir) { - return mInstaller.execute("prunedexcache " + cacheSubDir); - } - public int freeCache(long freeStorageSize) { StringBuilder builder = new StringBuilder("freecache"); builder.append(' '); diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 89878ef766b72..2cb90774d0df7 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -1497,29 +1497,6 @@ public class PackageManagerService extends IPackageManager.Stub { } } - if (didDexOptLibraryOrTool) { - // If we dexopted a library or tool, then something on the system has - // changed. Consider this significant, and wipe away all other - // existing dexopt files to ensure we don't leave any dangling around. - // - // 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 - // class path files in all cases. It is very possible in a - // small maintenance release update that the library and tool - // jars may be unchanged but APK could be removed resulting in - // unused dalvik-cache files. - for (String dexCodeInstructionSet : dexCodeInstructionSets) { - mInstaller.pruneDexCache(dexCodeInstructionSet); - } - - // 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. // (Do this before scanning any apps.) // For security and version matching reason, only consider