summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Heyl <ed@google.com>2011-10-25 19:50:42 +0000
committerEd Heyl <ed@google.com>2011-10-25 19:50:42 +0000
commit36deb30d94eb7e76a8d5139a9ef73a023d00437c (patch)
treec1c701107195587a0974a77270fee4bb986e92e8
parent3e149d56b94639aef98c11e0f857d5329c2acc18 (diff)
parent7a3050291cbf3e8f379548063409233e93926edf (diff)
downloadandroid_packages_providers_DownloadProvider-36deb30d94eb7e76a8d5139a9ef73a023d00437c.tar.gz
android_packages_providers_DownloadProvider-36deb30d94eb7e76a8d5139a9ef73a023d00437c.tar.bz2
android_packages_providers_DownloadProvider-36deb30d94eb7e76a8d5139a9ef73a023d00437c.zip
Merge remote branch 'goog/ics-mr0' into ics-mr1
-rw-r--r--src/com/android/providers/downloads/DownloadThread.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/com/android/providers/downloads/DownloadThread.java b/src/com/android/providers/downloads/DownloadThread.java
index 63a51a8f..9080e725 100644
--- a/src/com/android/providers/downloads/DownloadThread.java
+++ b/src/com/android/providers/downloads/DownloadThread.java
@@ -162,13 +162,6 @@ public class DownloadThread extends Thread {
boolean finished = false;
while(!finished) {
- if (state.mCurrentBytes == state.mTotalBytes) {
- Log.i(Constants.TAG, "Skipping initiating request for download " +
- mInfo.mId + "; already completed");
- finished = true;
- break;
- }
-
Log.i(Constants.TAG, "Initiating request for download " + mInfo.mId);
// Set or unset proxy, which may have changed since last GET request.
// setDefaultProxy() supports null as proxy parameter.
@@ -243,6 +236,13 @@ public class DownloadThread extends Thread {
setupDestinationFile(state, innerState);
addRequestHeaders(state, request);
+ // skip when already finished; remove after fixing race in 5217390
+ if (state.mCurrentBytes == state.mTotalBytes) {
+ Log.i(Constants.TAG, "Skipping initiating request for download " +
+ mInfo.mId + "; already completed");
+ return;
+ }
+
// check just before sending the request to avoid using an invalid connection at all
checkConnectivity();