Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d4204d6 authored by Wink Saville's avatar Wink Saville
Browse files

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
parent 93c84e82
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -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) {