File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
wifi/java/android/net/wifi Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -263,12 +263,19 @@ public static WifiWatchdogStateMachine makeWifiWatchdogStateMachine(Context cont
263263 Context .CONNECTIVITY_SERVICE );
264264 sWifiOnly = (cm .isNetworkSupported (ConnectivityManager .TYPE_MOBILE ) == false );
265265
266- // Disable for wifi only devices.
267- if (Settings .Secure .getString (contentResolver , Settings .Secure .WIFI_WATCHDOG_ON ) == null
268- && sWifiOnly ) {
269- log ("Disabling watchog for wi-fi only device" );
270- putSettingsBoolean (contentResolver , Settings .Secure .WIFI_WATCHDOG_ON , false );
266+ // Watchdog is always enabled. Poor network detection & walled garden detection
267+ // can individually be turned on/off
268+ // TODO: Remove this setting & clean up state machine since we always have
269+ // watchdog in an enabled state
270+ putSettingsBoolean (contentResolver , Settings .Secure .WIFI_WATCHDOG_ON , true );
271+
272+ // Disable poor network avoidance, but keep watchdog active for walled garden detection
273+ if (sWifiOnly ) {
274+ log ("Disabling poor network avoidance for wi-fi only device" );
275+ putSettingsBoolean (contentResolver ,
276+ Settings .Secure .WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED , false );
271277 }
278+
272279 WifiWatchdogStateMachine wwsm = new WifiWatchdogStateMachine (context );
273280 wwsm .start ();
274281 return wwsm ;
You can’t perform that action at this time.
0 commit comments