summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Wink Saville <wink@google.com> 2013-08-08 15:43:07 -0700
committer Android Git Automerger <android-git-automerger@android.com> 2013-08-08 15:43:07 -0700
commitb9b4321b756ac6e44650031ebfe0134508f60eaa (patch)
tree99309e88ec971dfa523ff5b2fbd6f33f553cd89e
parent9b6363e5e6d37e3e8d103751d81613eeca32bbbf (diff)
parent5191b8599011c255936e3a3cacc052c03e57b772 (diff)
am 5191b859: Merge "In CaptiviePortalTracker a socket timeout is probably a captive portal." into jb-mr2-dev
* commit '5191b8599011c255936e3a3cacc052c03e57b772': In CaptiviePortalTracker a socket timeout is probably a captive portal.
-rw-r--r--core/java/android/net/CaptivePortalTracker.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/net/CaptivePortalTracker.java b/core/java/android/net/CaptivePortalTracker.java
index 21995c021ca5..2f1eb8d9ffe2 100644
--- a/core/java/android/net/CaptivePortalTracker.java
+++ b/core/java/android/net/CaptivePortalTracker.java
@@ -42,6 +42,7 @@ import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.Inet4Address;
+import java.net.SocketTimeoutException;
import java.net.URL;
import java.net.UnknownHostException;
@@ -52,7 +53,7 @@ import com.android.internal.R;
* @hide
*/
public class CaptivePortalTracker extends StateMachine {
- private static final boolean DBG = false;
+ private static final boolean DBG = true;
private static final String TAG = "CaptivePortalTracker";
private static final String DEFAULT_SERVER = "clients3.google.com";
@@ -337,6 +338,9 @@ public class CaptivePortalTracker extends StateMachine {
urlConnection.getInputStream();
// we got a valid response, but not from the real google
return urlConnection.getResponseCode() != 204;
+ } catch (SocketTimeoutException e) {
+ if (DBG) log("Probably a portal: exception " + e);
+ return true;
} catch (IOException e) {
if (DBG) log("Probably not a portal: exception " + e);
return false;