summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/downloads/DownloadThread.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/providers/downloads/DownloadThread.java')
-rw-r--r--src/com/android/providers/downloads/DownloadThread.java14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/com/android/providers/downloads/DownloadThread.java b/src/com/android/providers/downloads/DownloadThread.java
index f6b0be6d..65142db6 100644
--- a/src/com/android/providers/downloads/DownloadThread.java
+++ b/src/com/android/providers/downloads/DownloadThread.java
@@ -45,7 +45,6 @@ import android.drm.DrmManagerClient;
import android.drm.DrmOutputStream;
import android.net.ConnectivityManager;
import android.net.INetworkPolicyListener;
-import android.net.Network;
import android.net.NetworkInfo;
import android.net.NetworkPolicyManager;
import android.net.TrafficStats;
@@ -352,15 +351,6 @@ public class DownloadThread implements Runnable {
throw new StopRequestException(STATUS_BAD_REQUEST, e);
}
- // Use the caller's default network to make this connection, since they might be subject to
- // restrictions that we shouldn't let them circumvent.
- final Network network = mSystemFacade.getActiveNetwork(mInfo.mUid);
- if (network == null) {
- throw new StopRequestException(Downloads.Impl.STATUS_WAITING_FOR_NETWORK,
- "no network associated with requesting UID");
- }
- logDebug("Using network: " + network);
-
boolean cleartextTrafficPermitted = mSystemFacade.isCleartextTrafficPermitted(mInfo.mUid);
int redirectionCount = 0;
while (redirectionCount++ < Constants.MAX_REDIRECTS) {
@@ -376,10 +366,8 @@ public class DownloadThread implements Runnable {
// response with body.
HttpURLConnection conn = null;
try {
- // Check that the caller is allowed to make network connections. If so, make one on
- // their behalf to open the url.
checkConnectivity();
- conn = (HttpURLConnection) network.openConnection(url);
+ conn = (HttpURLConnection) url.openConnection();
conn.setInstanceFollowRedirects(false);
conn.setConnectTimeout(DEFAULT_TIMEOUT);
conn.setReadTimeout(DEFAULT_TIMEOUT);