summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-10-04 15:26:41 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2023-10-04 15:26:41 +0000
commit54204d8f25a84d05c61469f1bb328bc537e11f17 (patch)
tree19f29546be09d6df2a3887853f1602c84a278529
parent6e607443bc1dc9b81392ce59ff57f5160acf4868 (diff)
parent9d64fa469090047974a8cfa34f6ff4c8ca832a96 (diff)
downloadDownloadProvider-platform-tools-34.0.5.tar.gz
Merge "Snap for 10900817 from c3ccf93814c721e470156d4e3e129874ccd4973c to sdk-release" into sdk-releaseplatform-tools-34.0.5
-rw-r--r--src/com/android/providers/downloads/DownloadJobService.java7
-rw-r--r--src/com/android/providers/downloads/DownloadThread.java1
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;
}