summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/providers/downloads/DownloadService.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/android/providers/downloads/DownloadService.java b/src/com/android/providers/downloads/DownloadService.java
index 66d3be96..20cf6294 100644
--- a/src/com/android/providers/downloads/DownloadService.java
+++ b/src/com/android/providers/downloads/DownloadService.java
@@ -158,9 +158,11 @@ public class DownloadService extends Service {
mAlarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
mStorageManager = new StorageManager(this);
- mUpdateThread = new HandlerThread(TAG + "-UpdateThread");
- mUpdateThread.start();
- mUpdateHandler = new Handler(mUpdateThread.getLooper(), mUpdateCallback);
+ if (mUpdateThread == null) {
+ mUpdateThread = new HandlerThread(TAG + "-UpdateThread");
+ mUpdateThread.start();
+ mUpdateHandler = new Handler(mUpdateThread.getLooper(), mUpdateCallback);
+ }
mScanner = new DownloadScanner(this);
@@ -185,7 +187,6 @@ public class DownloadService extends Service {
@Override
public void onDestroy() {
- mUpdateThread.quit();
mScanner.shutdown();
getContentResolver().unregisterContentObserver(mObserver);
if (Constants.LOGVV) {