summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2013-03-26 03:20:13 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2013-03-26 03:20:13 +0000
commita25507e16b5a7bbf197e12fabff5afd2eb73eae5 (patch)
tree987a5ffe75d9078c9dd1fc23e1985995a2889f64
parent214cc913ee42361d7597c1e3f06defc53a594ce0 (diff)
parent0f2f63932bd8d963764d37527b3237d219fdaa4d (diff)
downloadandroid_packages_providers_DownloadProvider-a25507e16b5a7bbf197e12fabff5afd2eb73eae5.tar.gz
android_packages_providers_DownloadProvider-a25507e16b5a7bbf197e12fabff5afd2eb73eae5.tar.bz2
android_packages_providers_DownloadProvider-a25507e16b5a7bbf197e12fabff5afd2eb73eae5.zip
am 0f2f6393: Revert "Avoid sending messages after HandlerThread.quit()."
* commit '0f2f63932bd8d963764d37527b3237d219fdaa4d': Revert "Avoid sending messages after HandlerThread.quit()."
-rw-r--r--src/com/android/providers/downloads/DownloadService.java18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/com/android/providers/downloads/DownloadService.java b/src/com/android/providers/downloads/DownloadService.java
index c519faaf..6c61193c 100644
--- a/src/com/android/providers/downloads/DownloadService.java
+++ b/src/com/android/providers/downloads/DownloadService.java
@@ -189,7 +189,6 @@ public class DownloadService extends Service {
getContentResolver().unregisterContentObserver(mObserver);
mScanner.shutdown();
mUpdateThread.quit();
- mUpdateThread = null;
if (Constants.LOGVV) {
Log.v(Constants.TAG, "Service onDestroy");
}
@@ -200,10 +199,8 @@ public class DownloadService extends Service {
* Enqueue an {@link #updateLocked()} pass to occur in future.
*/
private void enqueueUpdate() {
- if (mUpdateThread != null) {
- mUpdateHandler.removeMessages(MSG_UPDATE);
- mUpdateHandler.obtainMessage(MSG_UPDATE, mLastStartId, -1).sendToTarget();
- }
+ mUpdateHandler.removeMessages(MSG_UPDATE);
+ mUpdateHandler.obtainMessage(MSG_UPDATE, mLastStartId, -1).sendToTarget();
}
/**
@@ -211,12 +208,10 @@ public class DownloadService extends Service {
* catch any finished operations that didn't trigger an update pass.
*/
private void enqueueFinalUpdate() {
- if (mUpdateThread != null) {
- mUpdateHandler.removeMessages(MSG_FINAL_UPDATE);
- mUpdateHandler.sendMessageDelayed(
- mUpdateHandler.obtainMessage(MSG_FINAL_UPDATE, mLastStartId, -1),
- 5 * MINUTE_IN_MILLIS);
- }
+ mUpdateHandler.removeMessages(MSG_FINAL_UPDATE);
+ mUpdateHandler.sendMessageDelayed(
+ mUpdateHandler.obtainMessage(MSG_FINAL_UPDATE, mLastStartId, -1),
+ 5 * MINUTE_IN_MILLIS);
}
private static final int MSG_UPDATE = 1;
@@ -274,7 +269,6 @@ public class DownloadService extends Service {
if (stopSelfResult(startId)) {
if (DEBUG_LIFECYCLE) Log.v(TAG, "Nothing left; stopped");
mUpdateThread.quit();
- mUpdateThread = null;
}
}