From 9d4204d6257bf69885cf0718aa3adaa17457c318 Mon Sep 17 00:00:00 2001 From: Wink Saville Date: Thu, 29 Aug 2013 16:42:44 -0700 Subject: [PATCH] Add debug and remove SocketTimeoutException. Bad merge from jb-mr2 to klp, the SocketTimeoutException in isCaptivePortal should not be present. Also add debug for bug 9972012. The SocketTimeoutException is a possible cause of 9972012 but the logs from post #24 it was not caused by a timeout, so this is not a fix. Bug: 9972012 Change-Id: I290518832f8258d4682821815834f5621245b643 --- core/java/android/net/CaptivePortalTracker.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/core/java/android/net/CaptivePortalTracker.java b/core/java/android/net/CaptivePortalTracker.java index 6b96ad457f1b..01977cde07b8 100644 --- a/core/java/android/net/CaptivePortalTracker.java +++ b/core/java/android/net/CaptivePortalTracker.java @@ -397,17 +397,14 @@ public class CaptivePortalTracker extends StateMachine { long responseTimestamp = SystemClock.elapsedRealtime(); // we got a valid response, but not from the real google - boolean isCaptivePortal = urlConnection.getResponseCode() != 204; + int rspCode = urlConnection.getResponseCode(); + boolean isCaptivePortal = rspCode != 204; sendNetworkConditionsBroadcast(true /* response received */, isCaptivePortal, requestTimestamp, responseTimestamp); + + if (DBG) log("isCaptivePortal: ret=" + isCaptivePortal + " rspCode=" + rspCode); return isCaptivePortal; - } catch (SocketTimeoutException e) { - if (DBG) log("Probably a portal: exception " + e); - if (requestTimestamp != -1) { - sendFailedCaptivePortalCheckBroadcast(requestTimestamp); - } // else something went wrong with setting up the urlConnection - return true; } catch (IOException e) { if (DBG) log("Probably not a portal: exception " + e); if (requestTimestamp != -1) { -- 2.11.0