Defeat transparent Accept-Encoding: gzip.
Jeff Sharkey [Tue, 19 Mar 2013 01:30:02 +0000 (18:30 -0700)]
Transparent gzip encoding doesn't allow us to easily resume partial
requests, so defeat it for now.

Bug: 8409417
Change-Id: I1172709c09d1153fff1ba8df072a9bef896e244d

src/com/android/providers/downloads/DownloadThread.java

index a0b3e54..f1add24 100644 (file)
@@ -818,6 +818,10 @@ public class DownloadThread implements Runnable {
             conn.addRequestProperty("User-Agent", userAgent());
         }
 
+        // Defeat transparent gzip compression, since it doesn't allow us to
+        // easily resume partial downloads.
+        conn.setRequestProperty("Accept-Encoding", "identity");
+
         if (state.mContinuingDownload) {
             if (state.mHeaderETag != null) {
                 conn.addRequestProperty("If-Match", state.mHeaderETag);