diff options
-rw-r--r-- | src/com/android/providers/downloads/DownloadJobService.java | 7 | ||||
-rw-r--r-- | src/com/android/providers/downloads/DownloadThread.java | 1 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/providers/downloads/DownloadJobService.java b/src/com/android/providers/downloads/DownloadJobService.java index 731e15f2..b971a3a9 100644 --- a/src/com/android/providers/downloads/DownloadJobService.java +++ b/src/com/android/providers/downloads/DownloadJobService.java @@ -88,11 +88,10 @@ public class DownloadJobService extends JobService { thread = mActiveThreads.removeReturnOld(id); } if (thread != null) { - // If the thread is still running, ask it to gracefully shutdown, - // and reschedule ourselves to resume in the future. + // If the thread is still running, asynchronously request a + // shutdown. The thread is responsible for rescheduling the + // job based on its latest progress. thread.requestShutdown(); - - Helpers.scheduleJob(this, DownloadInfo.queryDownloadInfo(this, id)); } return false; } diff --git a/src/com/android/providers/downloads/DownloadThread.java b/src/com/android/providers/downloads/DownloadThread.java index c43280dd..8522e26b 100644 --- a/src/com/android/providers/downloads/DownloadThread.java +++ b/src/com/android/providers/downloads/DownloadThread.java @@ -380,6 +380,7 @@ public class DownloadThread extends Thread { if (mInfoDelta.mStatus == STATUS_WAITING_TO_RETRY || mInfoDelta.mStatus == STATUS_WAITING_FOR_NETWORK || mInfoDelta.mStatus == STATUS_QUEUED_FOR_WIFI) { + logDebug("rescheduling the job id:" + mId); needsReschedule = true; } |