diff options
-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(); |