From bbe461b78f9697775281d986bcf3c00904e1e62c Mon Sep 17 00:00:00 2001 From: Irfan Sheriff Date: Tue, 9 Oct 2012 15:49:33 -0700 Subject: Disable poor network avoidance by default Bug: 7318044 Change-Id: Icf27e823453eeaba901aad6f3f8eedea242794f9 --- .../java/android/net/wifi/WifiWatchdogStateMachine.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'wifi') diff --git a/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java b/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java index 4440145..97a3b33 100644 --- a/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java +++ b/wifi/java/android/net/wifi/WifiWatchdogStateMachine.java @@ -345,13 +345,6 @@ public class WifiWatchdogStateMachine extends StateMachine { // watchdog in an enabled state putSettingsGlobalBoolean(contentResolver, Settings.Global.WIFI_WATCHDOG_ON, true); - // disable poor network avoidance - if (sWifiOnly) { - logd("Disabling poor network avoidance for wi-fi only device"); - putSettingsGlobalBoolean(contentResolver, - Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, false); - } - WifiWatchdogStateMachine wwsm = new WifiWatchdogStateMachine(context); wwsm.start(); return wwsm; @@ -441,8 +434,14 @@ public class WifiWatchdogStateMachine extends StateMachine { private void updateSettings() { if (DBG) logd("Updating secure settings"); - mPoorNetworkDetectionEnabled = getSettingsGlobalBoolean(mContentResolver, - Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, true); + // disable poor network avoidance + if (sWifiOnly) { + logd("Disabling poor network avoidance for wi-fi only device"); + mPoorNetworkDetectionEnabled = false; + } else { + mPoorNetworkDetectionEnabled = getSettingsGlobalBoolean(mContentResolver, + Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, false); + } } /** -- cgit v1.1