Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce9b5c76 authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Android (Google) Code Review
Browse files

Merge "Fix walled garden detection on nakasi" into jb-dev

parents bde32efa ae094b27
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -263,12 +263,19 @@ public class WifiWatchdogStateMachine extends StateMachine {
                Context.CONNECTIVITY_SERVICE);
        sWifiOnly = (cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE) == false);

        // Disable for wifi only devices.
        if (Settings.Secure.getString(contentResolver, Settings.Secure.WIFI_WATCHDOG_ON) == null
                && sWifiOnly) {
            log("Disabling watchog for wi-fi only device");
            putSettingsBoolean(contentResolver, Settings.Secure.WIFI_WATCHDOG_ON, false);
        // Watchdog is always enabled. Poor network detection & walled garden detection
        // can individually be turned on/off
        // TODO: Remove this setting & clean up state machine since we always have
        // watchdog in an enabled state
        putSettingsBoolean(contentResolver, Settings.Secure.WIFI_WATCHDOG_ON, true);

        // Disable poor network avoidance, but keep watchdog active for walled garden detection
        if (sWifiOnly) {
            log("Disabling poor network avoidance for wi-fi only device");
            putSettingsBoolean(contentResolver,
                    Settings.Secure.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, false);
        }

        WifiWatchdogStateMachine wwsm = new WifiWatchdogStateMachine(context);
        wwsm.start();
        return wwsm;