diff options
author | Wink Saville <wink@google.com> | 2013-08-02 11:25:23 -0700 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2013-08-05 14:17:02 -0700 |
commit | bf34122a96ef3d02e9b7935e07eb4f9b04034828 (patch) | |
tree | 686caf15b7d482553d84f91f347602d8152daa0c /core/java | |
parent | 607b414d0444067e166fa54d8ea37563f2715ea3 (diff) | |
download | frameworks_base-bf34122a96ef3d02e9b7935e07eb4f9b04034828.zip frameworks_base-bf34122a96ef3d02e9b7935e07eb4f9b04034828.tar.gz frameworks_base-bf34122a96ef3d02e9b7935e07eb4f9b04034828.tar.bz2 |
In CaptiviePortalTracker a socket timeout is probably a captive portal.
On a AT&T warm SIM a socket is not possible so a timeout occurs.
In CheckMp a timing out on a socket is declared as a "warm" sim,
make CaptivePortalTracker the same.
Bug: 10038362
Change-Id: Icb9fb0a1b67704dc9adf6a6348a3781fb9582a89
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/net/CaptivePortalTracker.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/net/CaptivePortalTracker.java b/core/java/android/net/CaptivePortalTracker.java index 21995c0..2f1eb8d 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; |