Commits

Wink Saville  committed 02a727f

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

  • Participants
  • Parent commits 19b7388

Comments (0)

Files changed (1)

File core/java/android/net/CaptivePortalTracker.java

 import java.net.HttpURLConnection;
 import java.net.InetAddress;
 import java.net.Inet4Address;
+import java.net.SocketTimeoutException;
 import java.net.URL;
 import java.net.UnknownHostException;
 
  * @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";
             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;