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

Commit 79d37353 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "wifi: don't avoid poor connections if mobile isn't connected and avoid...

Merge "wifi: don't avoid poor connections if mobile isn't connected and avoid NPE on wifi only devices." into jellybean
parents be235043 9955dfc3
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -262,6 +262,8 @@ public class WifiWatchdogStateMachine extends StateMachine {
        ConnectivityManager cm = (ConnectivityManager) context.getSystemService(
                Context.CONNECTIVITY_SERVICE);
        sWifiOnly = (cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE) == false);
        boolean noMobileConnection = sWifiOnly ? true : (cm.getNetworkInfo(
                ConnectivityManager.TYPE_MOBILE).isConnected() == false);

        // Watchdog is always enabled. Poor network detection & walled garden detection
        // can individually be turned on/off
@@ -270,7 +272,7 @@ public class WifiWatchdogStateMachine extends StateMachine {
        putSettingsBoolean(contentResolver, Settings.Secure.WIFI_WATCHDOG_ON, true);

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