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

Commit 09a12bcf authored by Mike Lockwood's avatar Mike Lockwood
Browse files

WifiStateMachine: Move wifi teardown delay to a framework resource



Bug: 5931171

Change-Id: I96a4e3bf1d044ea4a4d2955775703b6f0ce862ed
Signed-off-by: default avatarMike Lockwood <lockwood@google.com>
parent 86548c47
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -284,6 +284,10 @@
         point on the move. A value of 0 means no periodic scans will be used in the framework. -->
    <integer translatable="false" name="config_wifi_framework_scan_interval">300000</integer>

    <!-- Wifi driver stop delay, in milliseconds.
         Default value is 2 minutes. -->
    <integer translatable="false" name="config_wifi_driver_stop_delay">120000</integer>

    <!-- Flag indicating whether the keyguard should be bypassed when
         the slider is open.  This can be set or unset depending how easily
         the slider can be opened (for example, in a pocket or purse). -->
+5 −2
Original line number Diff line number Diff line
@@ -394,7 +394,7 @@ public class WifiStateMachine extends StateMachine {
     * Starting and shutting down driver too quick causes problems leading to driver
     * being in a bad state. Delay driver stop.
     */
    private static final int DELAYED_DRIVER_STOP_MS = 2 * 60 * 1000; /* 2 minutes */
    private final int mDriverStopDelayMs;
    private int mDelayedStopCounter;
    private boolean mInDelayedStop = false;

@@ -563,6 +563,9 @@ public class WifiStateMachine extends StateMachine {
        mDefaultSupplicantScanIntervalMs = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_wifi_supplicant_scan_interval);

        mDriverStopDelayMs = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_wifi_driver_stop_delay);

        mContext.registerReceiver(
            new BroadcastReceiver() {
                @Override
@@ -2589,7 +2592,7 @@ public class WifiStateMachine extends StateMachine {
                    } else {
                        /* send regular delayed shut down */
                        sendMessageDelayed(obtainMessage(CMD_DELAYED_STOP_DRIVER,
                                mDelayedStopCounter, 0), DELAYED_DRIVER_STOP_MS);
                                mDelayedStopCounter, 0), mDriverStopDelayMs);
                    }
                    break;
                case CMD_START_DRIVER: