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

Commit 79f5a041 authored by Mike Lockwood's avatar Mike Lockwood
Browse files

WifiStateTracker: add support for overriding DCHP max retry count in an overlay



Bug: 5551068

Signed-off-by: default avatarMike Lockwood <lockwood@google.com>

Conflicts:

	packages/SettingsProvider/res/values/defaults.xml

Change-Id: I6a6519316a87bd1af39ea9dc51e0d312011135ef
parent 16b7ddcf
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -148,4 +148,7 @@
    <!-- Development settings -->
    <bool name="def_stay_on_while_plugged_in">false</bool>

    <!-- Number of retries for connecting to DHCP.
         Value here is the same as WifiStateMachine.DEFAULT_MAX_DHCP_RETRIES -->
    <integer name="def_max_dhcp_retries">9</integer>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -1602,6 +1602,9 @@ public class DatabaseHelper extends SQLiteOpenHelper {

            loadBooleanSetting(stmt, Settings.Secure.NETSTATS_ENABLED,
                    R.bool.def_netstats_enabled);

            loadIntegerSetting(stmt, Settings.Secure.WIFI_MAX_DHCP_RETRY_COUNT,
                    R.integer.def_max_dhcp_retries);
        } finally {
            if (stmt != null) stmt.close();
        }
+3 −1
Original line number Diff line number Diff line
@@ -1754,7 +1754,9 @@ public class WifiStateMachine extends StateMachine {
         * If we've exceeded the maximum number of retries for DHCP
         * to a given network, disable the network
         */
        if (++mReconnectCount > getMaxDhcpRetries()) {
        int maxRetries = getMaxDhcpRetries();
        // maxRetries == 0 means keep trying forever
        if (maxRetries > 0 && ++mReconnectCount > maxRetries) {
            loge("Failed " +
                    mReconnectCount + " times, Disabling " + mLastNetworkId);
            mWifiConfigStore.disableNetwork(mLastNetworkId,