diff options
author | Jeff Sharkey <jsharkey@android.com> | 2011-10-25 12:13:49 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-10-25 12:13:49 -0700 |
commit | 7a3050291cbf3e8f379548063409233e93926edf (patch) | |
tree | 72987578fb91b5da3bcfe40d01e6f3ee36cb059d /src | |
parent | 3074179d22e9d7e1f506b85dca866301a6206156 (diff) | |
parent | 3e1f6ff817247a5003df0f2c9f27acaf84ad40ec (diff) | |
download | android_packages_providers_DownloadProvider-7a3050291cbf3e8f379548063409233e93926edf.tar.gz android_packages_providers_DownloadProvider-7a3050291cbf3e8f379548063409233e93926edf.tar.bz2 android_packages_providers_DownloadProvider-7a3050291cbf3e8f379548063409233e93926edf.zip |
Merge "Sanity check only after updating from file size." into ics-mr0
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/providers/downloads/DownloadThread.java | 14 |
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(); |