diff options
-rw-r--r-- | src/com/android/providers/downloads/DownloadService.java | 18 |
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; } } |