diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2014-07-18 01:57:34 +0900 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2014-07-29 13:36:10 +0900 |
commit | ae6dffb69792a93422c3bbc50088572c99e5b7be (patch) | |
tree | 8fe99e3d65181fb1ff86079c059f4b82143295ed /services/core/java/com/android/server/connectivity/NetworkMonitor.java | |
parent | 73f1856f7f224dce9670b57707f65f805bb0f6b3 (diff) | |
download | frameworks_base-ae6dffb69792a93422c3bbc50088572c99e5b7be.zip frameworks_base-ae6dffb69792a93422c3bbc50088572c99e5b7be.tar.gz frameworks_base-ae6dffb69792a93422c3bbc50088572c99e5b7be.tar.bz2 |
Use getBoundURL for network validation.
Disable for now, until we're more confident that it doesn't choke
on strange captive portals.
Change-Id: Ic8e66a379d32c915c949df70ca0d38535cd5dbe0
Diffstat (limited to 'services/core/java/com/android/server/connectivity/NetworkMonitor.java')
-rw-r--r-- | services/core/java/com/android/server/connectivity/NetworkMonitor.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/connectivity/NetworkMonitor.java b/services/core/java/com/android/server/connectivity/NetworkMonitor.java index 5260185..e1c102a 100644 --- a/services/core/java/com/android/server/connectivity/NetworkMonitor.java +++ b/services/core/java/com/android/server/connectivity/NetworkMonitor.java @@ -617,8 +617,11 @@ public class NetworkMonitor extends StateMachine { int httpResponseCode = 599; try { URL url = new URL(urlString); + // TODO: check that standard HttpURLConnection doesn't choke on + // cruel and unusual captive portals, and then replace the + // hand-rolled HTTP code in the else branch with this code. if (false) { - // TODO: Need to add URLConnection.setNetwork() before we can enable. + url = mNetworkAgentInfo.network.getBoundURL(url); urlConnection = (HttpURLConnection) url.openConnection(); urlConnection.setInstanceFollowRedirects(false); urlConnection.setConnectTimeout(SOCKET_TIMEOUT_MS); |