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

Commit 11aefad9 authored by Irfan Sheriff's avatar Irfan Sheriff
Browse files

Add support for scan always available mode

Modify WifiService to add a controller to track the various
desired states and let the WifiStatemachine actually control
the bring up.

Bug: 8141918

Change-Id: I6e98fd5a29b43c3c50c315eff5255cd0a3eaebcd
parent 1c80a051
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -4783,6 +4783,13 @@ public final class Settings {
        */
       public static final String WIFI_ON = "wifi_on";

       /**
        * Setting to allow scans to be enabled even wifi is turned off for connectivity.
        * @hide
        */
       public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
                "wifi_scan_always_enabled";

       /**
        * Used to save the Wifi_ON state prior to tethering.
        * This state will be checked to restore Wifi after
@@ -5345,6 +5352,7 @@ public final class Settings {
            WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
            WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
            WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
            WIFI_SCAN_ALWAYS_AVAILABLE,
            WIFI_NUM_OPEN_NETWORKS_KEPT,
            EMERGENCY_TONE,
            CALL_AUTO_RETRY,
+1 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ public class Protocol {
    public static final int BASE_WIFI_P2P_SERVICE                                   = 0x00023000;
    public static final int BASE_WIFI_MONITOR                                       = 0x00024000;
    public static final int BASE_WIFI_MANAGER                                       = 0x00025000;
    public static final int BASE_WIFI_CONTROLLER                                    = 0x00026000;
    public static final int BASE_DHCP                                               = 0x00030000;
    public static final int BASE_DATA_CONNECTION                                    = 0x00040000;
    public static final int BASE_DATA_CONNECTION_AC                                 = 0x00041000;
+12 −0
Original line number Diff line number Diff line
WifiService: Implements the IWifiManager 3rd party API. The API and the device state information (screen on/off, battery state, sleep policy) go as input into the WifiController which tracks high level states as to whether STA or AP mode is operational and controls the WifiStateMachine to handle bringup and shut down.

WifiController: Acts as a controller to the WifiStateMachine based on various inputs (API and device state). Runs on the same thread created in WifiService.

WifiSettingsStore: Tracks the various settings (wifi toggle, airplane toggle, tethering toggle, scan mode toggle) and provides API to figure if wifi should be turned on or off.

WifiTrafficPoller: Polls traffic on wifi and notifies apps listening on it.

WifiNotificationController: Controls whether the open network notification is displayed or not based on the scan results.

WifiStateMachine: Tracks the various states on STA and AP connectivity and handles bring up and shut down.
+626 −0

File added.

Preview size limit exceeded, changes collapsed.

+84 −234

File changed.

Preview size limit exceeded, changes collapsed.

Loading