summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@android.com>2010-09-28 12:32:08 -0700
committerBrad Fitzpatrick <bradfitz@android.com>2010-09-28 12:32:08 -0700
commitad017bfbbb549cbbaa522038fa46450f0cedf413 (patch)
treec56963d9adb41d649bda3f56c0dd2364d5544299
parent57427e16d929b34a646dbcac0a16004f4a82cc9c (diff)
downloadandroid_packages_providers_DownloadProvider-ad017bfbbb549cbbaa522038fa46450f0cedf413.zip
android_packages_providers_DownloadProvider-ad017bfbbb549cbbaa522038fa46450f0cedf413.tar.gz
android_packages_providers_DownloadProvider-ad017bfbbb549cbbaa522038fa46450f0cedf413.tar.bz2
Trim the database & check spurious files off the UI thread.
Change-Id: I92180fc4344579b93361d5584243688a1cfdd091
-rw-r--r--src/com/android/providers/downloads/DownloadService.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/providers/downloads/DownloadService.java b/src/com/android/providers/downloads/DownloadService.java
index 62598b7..c79ecc4 100644
--- a/src/com/android/providers/downloads/DownloadService.java
+++ b/src/com/android/providers/downloads/DownloadService.java
@@ -196,8 +196,6 @@ public class DownloadService extends Service {
mNotifier = new DownloadNotification(this, mSystemFacade);
mSystemFacade.cancelAllNotifications();
- trimDatabase();
- removeSpuriousFiles();
updateFromProvider();
}
@@ -243,6 +241,9 @@ public class DownloadService extends Service {
public void run() {
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
+ trimDatabase();
+ removeSpuriousFiles();
+
boolean keepService = false;
// for each update from the database, remember which download is
// supposed to get restarted soonest in the future