diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2010-07-19 09:30:32 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-07-19 09:30:32 -0700 |
commit | 89fb824c42c8ee1686439dab4ca42a69b19624f0 (patch) | |
tree | 76220ed94c3e3d1c68565cc7e7d28926ae70d457 /src/com/android | |
parent | 248f9688e3880cdfebd535f237ff9edea8a91f46 (diff) | |
parent | 8e64adfed603d808a712f0caad97425a5ef038f4 (diff) | |
download | android_packages_providers_DownloadProvider-89fb824c42c8ee1686439dab4ca42a69b19624f0.tar.gz android_packages_providers_DownloadProvider-89fb824c42c8ee1686439dab4ca42a69b19624f0.tar.bz2 android_packages_providers_DownloadProvider-89fb824c42c8ee1686439dab4ca42a69b19624f0.zip |
am 8e64adfe: merge from open-source master
Merge commit '8e64adfed603d808a712f0caad97425a5ef038f4'
* commit '8e64adfed603d808a712f0caad97425a5ef038f4':
Use proxy for downloads.
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/providers/downloads/DownloadThread.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/providers/downloads/DownloadThread.java b/src/com/android/providers/downloads/DownloadThread.java index 8188eaae..c488c0cd 100644 --- a/src/com/android/providers/downloads/DownloadThread.java +++ b/src/com/android/providers/downloads/DownloadThread.java @@ -16,13 +16,16 @@ package com.android.providers.downloads; +import org.apache.http.conn.params.ConnRouteParams; + import android.content.ContentUris; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.drm.mobile1.DrmRawContent; -import android.net.Uri; import android.net.http.AndroidHttpClient; +import android.net.Proxy; +import android.net.Uri; import android.os.FileUtils; import android.os.PowerManager; import android.os.Process; @@ -179,6 +182,10 @@ public class DownloadThread extends Thread { */ http_request_loop: while (true) { + // Set or unset proxy, which may have changed since last GET request. + // setDefaultProxy() supports null as proxy parameter. + ConnRouteParams.setDefaultProxy(client.getParams(), + Proxy.getPreferredHttpHost(mContext, mInfo.mUri)); // Prepares the request and fires it. HttpGet request = new HttpGet(mInfo.mUri); |