Skip to content

Commit 858c396

Browse files
isheriffAndroid (Google) Code Review
authored andcommitted
Merge "Finalize wifi watchdog default settings"
2 parents dd4c771 + 998196d commit 858c396

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

wifi/java/android/net/wifi/WifiWatchdogStateMachine.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ public class WifiWatchdogStateMachine extends StateMachine {
7777
/**
7878
* Low signal is defined as less than or equal to cut off
7979
*/
80-
private static final int LOW_SIGNAL_CUTOFF = 1;
80+
private static final int LOW_SIGNAL_CUTOFF = 0;
8181

8282
private static final long DEFAULT_DNS_CHECK_SHORT_INTERVAL_MS = 2 * 60 * 1000;
83-
private static final long DEFAULT_DNS_CHECK_LONG_INTERVAL_MS = 30 * 60 * 1000;
83+
private static final long DEFAULT_DNS_CHECK_LONG_INTERVAL_MS = 60 * 60 * 1000;
8484
private static final long DEFAULT_WALLED_GARDEN_INTERVAL_MS = 30 * 60 * 1000;
8585

8686
private static final int DEFAULT_MAX_SSID_BLACKLISTS = 7;
87-
private static final int DEFAULT_NUM_DNS_PINGS = 15; // Multiple pings to detect setup issues
88-
private static final int DEFAULT_MIN_DNS_RESPONSES = 3;
87+
private static final int DEFAULT_NUM_DNS_PINGS = 5; // Multiple pings to detect setup issues
88+
private static final int DEFAULT_MIN_DNS_RESPONSES = 1;
8989

9090
private static final int DEFAULT_DNS_PING_TIMEOUT_MS = 2000;
9191

@@ -95,7 +95,9 @@ public class WifiWatchdogStateMachine extends StateMachine {
9595
private static final String DEFAULT_WALLED_GARDEN_URL =
9696
"http://clients3.google.com/generate_204";
9797
private static final int WALLED_GARDEN_SOCKET_TIMEOUT_MS = 10000;
98-
private static final int DNS_INTRATEST_PING_INTERVAL = 200; // Long delay to detect setup issues
98+
private static final int DNS_INTRATEST_PING_INTERVAL_MS = 200;
99+
/* With some router setups, it takes a few hunder milli-seconds before connection is active */
100+
private static final int DNS_START_DELAY_MS = 1000;
99101

100102
private static final int BASE = Protocol.BASE_WIFI_WATCHDOG;
101103

@@ -677,7 +679,7 @@ public void enter() {
677679
for (int i=0; i < mNumDnsPings; i++) {
678680
for (int j = 0; j < numDnses; j++) {
679681
idDnsMap.put(mDnsPinger.pingDnsAsync(mDnsList.get(j), mDnsPingTimeoutMs,
680-
DNS_INTRATEST_PING_INTERVAL * i), j);
682+
DNS_START_DELAY_MS + DNS_INTRATEST_PING_INTERVAL_MS * i), j);
681683
}
682684
}
683685
}

0 commit comments

Comments
 (0)