public class WifiMetrics extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CLEAN_DUMP_ARG |
static String |
PROTO_DUMP_ARG |
Constructor and Description |
---|
WifiMetrics(Clock clock) |
Modifier and Type | Method and Description |
---|---|
void |
addCountToNumLastResortWatchdogAvailableNetworksTotal(int count) |
void |
addCountToNumLastResortWatchdogBadAssociationNetworksTotal(int count) |
void |
addCountToNumLastResortWatchdogBadAuthenticationNetworksTotal(int count) |
void |
addCountToNumLastResortWatchdogBadDhcpNetworksTotal(int count) |
void |
addCountToNumLastResortWatchdogBadOtherNetworksTotal(int count) |
void |
countScanResults(List<ScanDetail> scanDetails)
Counts all the different types of networks seen in a set of scan results
|
void |
dump(FileDescriptor fd,
PrintWriter pw,
String[] args)
Dump all WifiMetrics.
|
void |
endConnectionEvent(int level2FailureCode,
int connectivityFailureCode)
End a Connection event record.
|
int |
getBackgroundScanCount()
Get Background scan count
|
int |
getOneshotScanCount()
Get oneshot scan count
|
int |
getScanReturnEntry(int scanReturnCode)
Get the count of this scanReturnCode
|
int |
getSystemStateCount(int state,
boolean screenOn)
Get the count of this system State Entry
|
void |
incrementAlertReasonCount(int reason)
Increments the count of alerts by alert reason.
|
void |
incrementBackgroundScanCount()
Increment background scan count
|
void |
incrementEmptyScanResultCount()
Increment Empty Scan Results count
|
void |
incrementNonEmptyScanResultCount()
Increment Non Empty Scan Results count
|
void |
incrementNumConnectivityWatchdogBackgroundBad()
Increment number of times connectivity watchdog found background scan not working
|
void |
incrementNumConnectivityWatchdogBackgroundGood()
Increment number of times connectivity watchdog confirmed background scan is working
|
void |
incrementNumConnectivityWatchdogPnoBad()
Increment number of times connectivity watchdog found pno not working
|
void |
incrementNumConnectivityWatchdogPnoGood()
Increment number of times connectivity watchdog confirmed pno is working
|
void |
incrementNumLastResortWatchdogSuccesses()
Increment count of Watchdog successes.
|
void |
incrementNumLastResortWatchdogTriggers()
Increment number of times the Watchdog of Last Resort triggered, resetting the wifi stack
|
void |
incrementNumLastResortWatchdogTriggersWithBadAssociation()
Increment count of triggers with atleast one bad association network
|
void |
incrementNumLastResortWatchdogTriggersWithBadAuthentication()
Increment count of triggers with atleast one bad authentication network
|
void |
incrementNumLastResortWatchdogTriggersWithBadDhcp()
Increment count of triggers with atleast one bad dhcp network
|
void |
incrementNumLastResortWatchdogTriggersWithBadOther()
Increment count of triggers with atleast one bad other network
|
void |
incrementOneshotScanCount()
Increment oneshot scan count, and the associated WifiSystemScanStateCount entry
|
void |
incrementRssiPollRssiCount(int rssi)
Increment occurence count of RSSI level from RSSI poll.
|
void |
incrementScanReturnEntry(int scanReturnCode,
int countToAdd)
Increment count of scan return code occurrence
|
void |
incrementWifiScoreCount(int score)
Increments occurence of a particular wifi score calculated
in WifiScoreReport by current connected network.
|
void |
incrementWifiSystemScanStateCount(int state,
boolean screenOn)
Increments the count of scans initiated by each wifi state, accounts for screenOn/Off
|
void |
setConnectionEventRoamType(int roamType)
set the RoamType of the current ConnectionEvent (if any)
|
void |
setConnectionScanDetail(ScanDetail scanDetail)
Set AP related metrics from ScanDetail
|
void |
setScreenState(boolean screenOn)
Set screen state (On/Off)
|
void |
setWifiState(int wifiState)
Set wifi state (WIFI_UNKNOWN, WIFI_DISABLED, WIFI_DISCONNECTED, WIFI_ASSOCIATED)
|
void |
startConnectionEvent(WifiConfiguration config,
String targetBSSID,
int roamType)
Create a new connection event.
|
public static final String PROTO_DUMP_ARG
public static final String CLEAN_DUMP_ARG
public WifiMetrics(Clock clock)
public void startConnectionEvent(WifiConfiguration config, String targetBSSID, int roamType)
config
- WifiConfiguration of the config used for the current connection attemptroamType
- Roam type that caused connection attempt, see WifiMetricsProto.WifiLog.ROAM_Xpublic void setConnectionEventRoamType(int roamType)
public void setConnectionScanDetail(ScanDetail scanDetail)
public void endConnectionEvent(int level2FailureCode, int connectivityFailureCode)
level2FailureCode
- Level 2 failure code returned by supplicantconnectivityFailureCode
- WifiMetricsProto.ConnectionEvent.HLF_Xpublic void incrementNonEmptyScanResultCount()
public void incrementEmptyScanResultCount()
public void incrementBackgroundScanCount()
public int getBackgroundScanCount()
public void incrementOneshotScanCount()
public int getOneshotScanCount()
public void incrementScanReturnEntry(int scanReturnCode, int countToAdd)
scanReturnCode
- Return code from scan attempt WifiMetricsProto.WifiLog.SCAN_Xpublic int getScanReturnEntry(int scanReturnCode)
scanReturnCode
- that we are getting the count forpublic void incrementWifiSystemScanStateCount(int state, boolean screenOn)
state
- State of the system when scan was initiated, see WifiMetricsProto.WifiLog.WIFI_XscreenOn
- Is the screen onpublic int getSystemStateCount(int state, boolean screenOn)
public void incrementNumLastResortWatchdogTriggers()
public void addCountToNumLastResortWatchdogBadAssociationNetworksTotal(int count)
count
- number of networks over bad association threshold when watchdog triggeredpublic void addCountToNumLastResortWatchdogBadAuthenticationNetworksTotal(int count)
count
- number of networks over bad authentication threshold when watchdog triggeredpublic void addCountToNumLastResortWatchdogBadDhcpNetworksTotal(int count)
count
- number of networks over bad dhcp threshold when watchdog triggeredpublic void addCountToNumLastResortWatchdogBadOtherNetworksTotal(int count)
count
- number of networks over bad other threshold when watchdog triggeredpublic void addCountToNumLastResortWatchdogAvailableNetworksTotal(int count)
count
- number of networks seen when watchdog triggeredpublic void incrementNumLastResortWatchdogTriggersWithBadAssociation()
public void incrementNumLastResortWatchdogTriggersWithBadAuthentication()
public void incrementNumLastResortWatchdogTriggersWithBadDhcp()
public void incrementNumLastResortWatchdogTriggersWithBadOther()
public void incrementNumConnectivityWatchdogPnoGood()
public void incrementNumConnectivityWatchdogPnoBad()
public void incrementNumConnectivityWatchdogBackgroundGood()
public void incrementNumConnectivityWatchdogBackgroundBad()
public void incrementRssiPollRssiCount(int rssi)
public void incrementNumLastResortWatchdogSuccesses()
public void incrementAlertReasonCount(int reason)
reason
- The cause of the alert. The reason values are driver-specific.public void countScanResults(List<ScanDetail> scanDetails)
public void incrementWifiScoreCount(int score)
public void dump(FileDescriptor fd, PrintWriter pw, String[] args)
fd
- unusedpw
- PrintWriter for writing dump toargs
- unusedpublic void setScreenState(boolean screenOn)
public void setWifiState(int wifiState)