Commit 7a305029 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Sanity check only after updating from file size." into ics-mr0

parents 3074179d 3e1f6ff8
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment