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

Commit 11046a2a authored by Mike Lockwood's avatar Mike Lockwood
Browse files

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



Bug: 5551068

Change-Id: I7817eeb1409af2056a63548104c3c64f93ee7def
Signed-off-by: default avatarMike Lockwood <lockwood@google.com>
parent 673b352f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -142,4 +142,8 @@

    <!-- 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
@@ -1565,6 +1565,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
@@ -1742,7 +1742,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);
            WifiConfigStore.disableNetwork(mLastNetworkId,