summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers
diff options
context:
space:
mode:
authorRobin Lee <rgl@google.com>2016-04-08 12:01:19 +0100
committerRobin Lee <rgl@google.com>2016-04-08 12:01:19 +0100
commita8bbae54b9533d560dc3c81c0858de0f99fed0ee (patch)
treea96a17dc3401f73738fb02ed60bfd4c573846984 /src/com/android/providers
parentf4837c7cf730eb08fdd3596169fa383e0b8c6293 (diff)
downloadandroid_packages_providers_DownloadProvider-a8bbae54b9533d560dc3c81c0858de0f99fed0ee.tar.gz
android_packages_providers_DownloadProvider-a8bbae54b9533d560dc3c81c0858de0f99fed0ee.tar.bz2
android_packages_providers_DownloadProvider-a8bbae54b9533d560dc3c81c0858de0f99fed0ee.zip
Extra comments for multinetwork downloading
Bug: 27074270 Change-Id: I7145fcdf0c8af0f0c299ca491f01eaef6204e2cb
Diffstat (limited to 'src/com/android/providers')
-rw-r--r--src/com/android/providers/downloads/DownloadThread.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/providers/downloads/DownloadThread.java b/src/com/android/providers/downloads/DownloadThread.java
index 8d51909e..f6b0be6d 100644
--- a/src/com/android/providers/downloads/DownloadThread.java
+++ b/src/com/android/providers/downloads/DownloadThread.java
@@ -352,6 +352,8 @@ 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,
@@ -374,6 +376,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.setInstanceFollowRedirects(false);