Skip to content

Commit bbe461b

Browse files
committed
Disable poor network avoidance by default
Bug: 7318044 Change-Id: Icf27e823453eeaba901aad6f3f8eedea242794f9
1 parent 462ff63 commit bbe461b

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -345,13 +345,6 @@ public static WifiWatchdogStateMachine makeWifiWatchdogStateMachine(Context cont
345345
// watchdog in an enabled state
346346
putSettingsGlobalBoolean(contentResolver, Settings.Global.WIFI_WATCHDOG_ON, true);
347347

348-
// disable poor network avoidance
349-
if (sWifiOnly) {
350-
logd("Disabling poor network avoidance for wi-fi only device");
351-
putSettingsGlobalBoolean(contentResolver,
352-
Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, false);
353-
}
354-
355348
WifiWatchdogStateMachine wwsm = new WifiWatchdogStateMachine(context);
356349
wwsm.start();
357350
return wwsm;
@@ -441,8 +434,14 @@ private boolean isWatchdogEnabled() {
441434
private void updateSettings() {
442435
if (DBG) logd("Updating secure settings");
443436

444-
mPoorNetworkDetectionEnabled = getSettingsGlobalBoolean(mContentResolver,
445-
Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, true);
437+
// disable poor network avoidance
438+
if (sWifiOnly) {
439+
logd("Disabling poor network avoidance for wi-fi only device");
440+
mPoorNetworkDetectionEnabled = false;
441+
} else {
442+
mPoorNetworkDetectionEnabled = getSettingsGlobalBoolean(mContentResolver,
443+
Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, false);
444+
}
446445
}
447446

448447
/**

0 commit comments

Comments
 (0)