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

Commit 16811725 authored by Wink Saville's avatar Wink Saville Committed by Android Git Automerger
Browse files

am e8fcfd53: Merge "Add debug and remove SocketTimeoutException." into klp-dev

* commit 'e8fcfd53':
  Add debug and remove SocketTimeoutException.
parents 53be76e1 e8fcfd53
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) {