Skip to content

Commit ae094b2

Browse files
committed
Fix walled garden detection on nakasi
Bug: 6576101 Change-Id: Iad2ea67e54662cd30a0e7425dab2a6174d13d152
1 parent 18afc62 commit ae094b2

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)