summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2010-03-09 21:57:30 -0500
committerEddie Ringle <eddie.ringle@gmail.com>2010-12-19 12:59:35 -0500
commit6189154d5fef04545244d8669bbcbfd8608450ee (patch)
tree941147cb8b12282a7507948e11fecc909dfca31c
parent9a69f10556fcd7e600f862992e1e16d69b34cb48 (diff)
downloadandroid_packages_providers_DownloadProvider-6189154d5fef04545244d8669bbcbfd8608450ee.zip
android_packages_providers_DownloadProvider-6189154d5fef04545244d8669bbcbfd8608450ee.tar.gz
android_packages_providers_DownloadProvider-6189154d5fef04545244d8669bbcbfd8608450ee.tar.bz2
Don't try to purge the dalvik-cache directory on /cache.
-rw-r--r--src/com/android/providers/downloads/Constants.java3
-rw-r--r--src/com/android/providers/downloads/DownloadService.java8
2 files changed, 7 insertions, 4 deletions
diff --git a/src/com/android/providers/downloads/Constants.java b/src/com/android/providers/downloads/Constants.java
index 5cf1353..7cfe6bc 100644
--- a/src/com/android/providers/downloads/Constants.java
+++ b/src/com/android/providers/downloads/Constants.java
@@ -88,6 +88,9 @@ public class Constants {
/** A magic filename that is allowed to exist within the system cache */
public static final String RECOVERY_DIRECTORY = "recovery";
+ /** A magic filename that is allowed to exist within the system cache */
+ public static final String DEX_CACHE_DIRECTORY = "dalvik-cache";
+
/** The default user agent used for downloads */
public static final String DEFAULT_USER_AGENT = "AndroidDownloadManager";
diff --git a/src/com/android/providers/downloads/DownloadService.java b/src/com/android/providers/downloads/DownloadService.java
index 169ef97..2d87b80 100644
--- a/src/com/android/providers/downloads/DownloadService.java
+++ b/src/com/android/providers/downloads/DownloadService.java
@@ -430,10 +430,10 @@ public class DownloadService extends Service {
}
HashSet<String> fileSet = new HashSet<String>();
for (int i = 0; i < files.length; i++) {
- if (files[i].getName().equals(Constants.KNOWN_SPURIOUS_FILENAME)) {
- continue;
- }
- if (files[i].getName().equalsIgnoreCase(Constants.RECOVERY_DIRECTORY)) {
+ String filename = files[i].getName();
+ if (Constants.KNOWN_SPURIOUS_FILENAME.equals(filename) ||
+ Constants.RECOVERY_DIRECTORY.equalsIgnoreCase(filename) ||
+ Constants.DEX_CACHE_DIRECTORY.equalsIgnoreCase(filename)) {
continue;
}
fileSet.add(files[i].getPath());