summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2013-02-21 00:11:58 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-02-21 00:11:58 +0000
commit54277c8d2de6ba2db1cb5c632914a89aa4ad499c (patch)
tree4b4ece616200d09e7b166d14eec5674dd076b989
parent8d669d11147ea80495a1c99fa274b7cf93b4eb56 (diff)
parentdd1179c09fb6ac2420292e52ea3ced395f76a7be (diff)
downloadandroid_packages_providers_DownloadProvider-54277c8d2de6ba2db1cb5c632914a89aa4ad499c.tar.gz
android_packages_providers_DownloadProvider-54277c8d2de6ba2db1cb5c632914a89aa4ad499c.tar.bz2
android_packages_providers_DownloadProvider-54277c8d2de6ba2db1cb5c632914a89aa4ad499c.zip
Merge "Ack, we actually need to UpdateThread.quit()."
-rw-r--r--src/com/android/providers/downloads/DownloadService.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/com/android/providers/downloads/DownloadService.java b/src/com/android/providers/downloads/DownloadService.java
index 20cf6294..c8e55d7d 100644
--- a/src/com/android/providers/downloads/DownloadService.java
+++ b/src/com/android/providers/downloads/DownloadService.java
@@ -158,11 +158,9 @@ public class DownloadService extends Service {
mAlarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
mStorageManager = new StorageManager(this);
- if (mUpdateThread == null) {
- mUpdateThread = new HandlerThread(TAG + "-UpdateThread");
- mUpdateThread.start();
- mUpdateHandler = new Handler(mUpdateThread.getLooper(), mUpdateCallback);
- }
+ mUpdateThread = new HandlerThread(TAG + "-UpdateThread");
+ mUpdateThread.start();
+ mUpdateHandler = new Handler(mUpdateThread.getLooper(), mUpdateCallback);
mScanner = new DownloadScanner(this);
@@ -187,8 +185,9 @@ public class DownloadService extends Service {
@Override
public void onDestroy() {
- mScanner.shutdown();
getContentResolver().unregisterContentObserver(mObserver);
+ mScanner.shutdown();
+ mUpdateThread.quit();
if (Constants.LOGVV) {
Log.v(Constants.TAG, "Service onDestroy");
}
@@ -257,8 +256,7 @@ public class DownloadService extends Service {
if (stopSelfResult(startId)) {
if (DEBUG_LIFECYCLE) Log.v(TAG, "Nothing left; stopped");
- mUpdateHandler.removeMessages(MSG_UPDATE);
- mUpdateHandler.removeMessages(MSG_FINAL_UPDATE);
+ mUpdateThread.quit();
}
}