public class WifiLastResortWatchdog extends Object
Modifier and Type | Class and Description |
---|---|
static class |
WifiLastResortWatchdog.AvailableNetworkFailureCount
This class holds the failure counts for an 'available network' (one of the potential
candidates for connection, as determined by framework).
|
Modifier and Type | Field and Description |
---|---|
static String |
BSSID_ANY
BSSID used to increment failure counts against ALL bssids associated with a particular SSID
|
static int |
FAILURE_CODE_ASSOCIATION
Association Failure code
|
static int |
FAILURE_CODE_AUTHENTICATION
Authentication Failure code
|
static int |
FAILURE_CODE_DHCP
Dhcp Failure code
|
static int |
FAILURE_THRESHOLD
Failure count that each available networks must meet to possibly trigger the Watchdog
|
static int |
MAX_BSSID_AGE
Maximum number of scan results received since we last saw a BSSID.
|
Modifier and Type | Method and Description |
---|---|
void |
connectedStateTransition(boolean isEntering)
Handles transitions entering and exiting WifiStateMachine ConnectedState
Used to track wifistate, and perform watchdog count reseting
|
int |
getFailureCount(String bssid,
int reason)
Get the failure count for a specific bssid.
|
boolean |
isOverFailureThreshold(String bssid) |
boolean |
noteConnectionFailureAndTriggerIfNeeded(String ssid,
String bssid,
int reason)
Increments the failure reason count for the given bssid.
|
void |
setWifiController(WifiController wifiController)
Method used to set the WifiController for the this watchdog.
|
String |
toString()
Prints all networks & counts within mRecentAvailableNetworks to string
|
void |
updateAvailableNetworks(List<Pair<ScanDetail,WifiConfiguration>> availableNetworks)
Refreshes recentAvailableNetworks with the latest available networks
Adds new networks, removes old ones that have timed out.
|
public static final int FAILURE_CODE_ASSOCIATION
public static final int FAILURE_CODE_AUTHENTICATION
public static final int FAILURE_CODE_DHCP
public static final int MAX_BSSID_AGE
public static final String BSSID_ANY
public static final int FAILURE_THRESHOLD
public void updateAvailableNetworks(List<Pair<ScanDetail,WifiConfiguration>> availableNetworks)
availableNetworks
- ScanDetail & Config list of potential connection
candidatespublic boolean noteConnectionFailureAndTriggerIfNeeded(String ssid, String bssid, int reason)
bssid
- of the network that has failed connection, can be "any"reason
- Message id from WifiStateMachine for this failurepublic void connectedStateTransition(boolean isEntering)
isEntering
- true if called from ConnectedState.enter(), false for exit()public String toString()
public boolean isOverFailureThreshold(String bssid)
bssid
- bssid to check the failures forpublic int getFailureCount(String bssid, int reason)
reason
- failure reason to get count forpublic void setWifiController(WifiController wifiController)
wifiController
- WifiController instance that will be sent the CMD_RESTART_WIFI message.