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

Commit 72a69290 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Skip data stall check on unnecessary network am: b6dbfb4e

Change-Id: I6e356b39a195f13098edfa49b2cffa7878edf212
parents eca3bdf1 b6dbfb4e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2253,6 +2253,10 @@ public class NetworkMonitor extends StateMachine {

    @VisibleForTesting
    protected boolean isDataStall() {
        if (!isValidationRequired()) {
            return false;
        }

        Boolean result = null;
        final StringJoiner msg = (DBG || VDBG_STALL) ? new StringJoiner(", ") : null;
        // Reevaluation will generate traffic. Thus, set a minimal reevaluation timer to limit the
+13 −0
Original line number Diff line number Diff line
@@ -814,6 +814,19 @@ public class NetworkMonitorTest {
        assertTrue(wrappedMonitor.isDataStall());
    }

    @Test
    public void testIsDataStall_SkipEvaluateOnValidationNotRequiredNetwork() {
        // Make DNS and TCP stall condition satisfied.
        setDataStallEvaluationType(DATA_STALL_EVALUATION_TYPE_DNS | DATA_STALL_EVALUATION_TYPE_TCP);
        when(mTstDependencies.isTcpInfoParsingSupported()).thenReturn(true);
        when(mTst.getLatestReceivedCount()).thenReturn(0);
        when(mTst.isDataStallSuspected()).thenReturn(true);
        final WrappedNetworkMonitor nm = makeMonitor(NO_INTERNET_CAPABILITIES);
        nm.setLastProbeTime(SystemClock.elapsedRealtime() - 1000);
        makeDnsTimeoutEvent(nm, DEFAULT_DNS_TIMEOUT_THRESHOLD);
        assertFalse(nm.isDataStall());
    }

    @Test
    public void testIsDataStall_EvaluationDnsWithDnsTimeThreshold() {
        // Test dns events happened in valid dns time threshold.