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

Commit 97af7249 authored by Paul Jensen's avatar Paul Jensen Committed by Android Git Automerger
Browse files

am 3249d637: am 3107a9ad: am f805ba7d: Merge "Retry failed network validation...

am 3249d637: am 3107a9ad: am f805ba7d: Merge "Retry failed network validation every 10 minutes." into lmp-mr1-dev

* commit '3249d637':
  Retry failed network validation every 10 minutes.
parents 11cf12ff 3249d637
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -215,6 +215,8 @@ public class NetworkMonitor extends StateMachine {
    // Default to 5s reevaluation delay.
    private static final int DEFAULT_REEVALUATE_DELAY_MS = 5000;
    private static final int MAX_RETRIES = 10;
    // Between groups of MAX_RETRIES evaluation attempts, pause 10 mins in hopes ISP outage passes.
    private static final int REEVALUATE_PAUSE_MS = 10*60*1000;
    private final int mReevaluateDelayMs;
    private int mReevaluateToken = 0;
    private static final int INVALID_UID = -1;
@@ -345,6 +347,7 @@ public class NetworkMonitor extends StateMachine {
        public void enter() {
            mConnectivityServiceHandler.sendMessage(obtainMessage(EVENT_NETWORK_TESTED,
                    NETWORK_TEST_RESULT_INVALID, 0, mNetworkAgentInfo));
            if (!mUserDoesNotWant) sendMessageDelayed(CMD_FORCE_REEVALUATION, REEVALUATE_PAUSE_MS);
        }

        @Override
@@ -360,6 +363,15 @@ public class NetworkMonitor extends StateMachine {
                    return NOT_HANDLED;
            }
        }

        @Override
        public void exit() {
             // NOTE: This removes the delayed message posted by enter() but will inadvertently
             // remove any other CMD_FORCE_REEVALUATION in the message queue.  At the moment this
             // is harmless.  If in the future this becomes problematic a different message could
             // be used.
             removeMessages(CMD_FORCE_REEVALUATION);
        }
    }

    // Being in the ValidatedState State indicates a Network is: