summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Ravi <sunilravi@google.com>2020-03-19 04:01:57 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-03-19 04:01:57 +0000
commitcbfa1d24a001ca938fa5e99b22a1238e8c36ab22 (patch)
tree791db8fe21b56a801741b9e7e0de8aaa3050f6ed
parente61116cf473de8befe18114be0533708333d89aa (diff)
parent06a5b1236b2defcef2b13959a1440d2f3dd5af2e (diff)
Merge "MBO/OCE/FILS metrics" into rvc-dev
-rw-r--r--service/java/com/android/server/wifi/ClientModeImpl.java9
-rw-r--r--service/java/com/android/server/wifi/WifiMetrics.java100
-rw-r--r--service/java/com/android/server/wifi/WifiNetworkSelector.java2
-rw-r--r--service/java/com/android/server/wifi/hotspot2/NetworkDetail.java21
-rw-r--r--service/proto/src/metrics.proto34
-rw-r--r--tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java11
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java99
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java2
8 files changed, 261 insertions, 17 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java
index f5f96a134..7cdc8e084 100644
--- a/service/java/com/android/server/wifi/ClientModeImpl.java
+++ b/service/java/com/android/server/wifi/ClientModeImpl.java
@@ -4016,6 +4016,7 @@ public class ClientModeImpl extends StateMachine {
connectToNetwork(config);
break;
case CMD_START_FILS_CONNECTION:
+ mWifiMetrics.incrementConnectRequestWithFilsAkmCount();
List<Layer2PacketParcelable> packets;
packets = (List<Layer2PacketParcelable>) message.obj;
if (mVerboseLoggingEnabled) {
@@ -4095,6 +4096,7 @@ public class ClientModeImpl extends StateMachine {
handleStatus = NOT_HANDLED;
break;
case WifiMonitor.FILS_NETWORK_CONNECTION_EVENT:
+ mWifiMetrics.incrementL2ConnectionThroughFilsAuthCount();
mSentHLPs = true;
case WifiMonitor.NETWORK_CONNECTION_EVENT:
if (mVerboseLoggingEnabled) log("Network connection established");
@@ -6157,6 +6159,12 @@ public class ClientModeImpl extends StateMachine {
| MboOceConstants.BTM_DATA_FLAG_BSS_TERMINATION_INCLUDED
| MboOceConstants.BTM_DATA_FLAG_ESS_DISASSOCIATION_IMMINENT)) != 0;
+ if ((frameData.mBssTmDataFlagsMask
+ & MboOceConstants.BTM_DATA_FLAG_MBO_CELL_DATA_CONNECTION_PREFERENCE_INCLUDED)
+ != 0) {
+ mWifiMetrics.incrementMboCellularSwitchRequestCount();
+ }
+
if (isImminentBit) {
long duration = frameData.mBlackListDurationMs;
@@ -6174,6 +6182,7 @@ public class ClientModeImpl extends StateMachine {
if (frameData.mStatus != MboOceConstants.BTM_RESPONSE_STATUS_ACCEPT) {
// Trigger the network selection and re-connect to new network if available.
+ mWifiMetrics.incrementForceScanCountDueToSteeringRequest();
mWifiConnectivityManager.forceConnectivityScan(ClientModeImpl.WIFI_WORK_SOURCE);
}
}
diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java
index 0c5bae954..8022bd909 100644
--- a/service/java/com/android/server/wifi/WifiMetrics.java
+++ b/service/java/com/android/server/wifi/WifiMetrics.java
@@ -1495,6 +1495,13 @@ public class WifiMetrics {
}
mCurrentConnectionEvent.mRouterFingerPrint.mRouterFingerPrintProto
.routerTechnology = connectionWifiMode;
+
+ if (networkDetail.isMboSupported()) {
+ mWifiLogProto.numConnectToNetworkSupportingMbo++;
+ if (networkDetail.isOceSupported()) {
+ mWifiLogProto.numConnectToNetworkSupportingOce++;
+ }
+ }
}
/**
@@ -2047,6 +2054,10 @@ public class WifiMetrics {
int wpa3EnterpriseNetworks = 0;
int wapiPersonalNetworks = 0;
int wapiEnterpriseNetworks = 0;
+ int mboSupportedNetworks = 0;
+ int mboCellularDataAwareNetworks = 0;
+ int oceSupportedNetworks = 0;
+ int filsSupportedNetworks = 0;
for (ScanDetail scanDetail : scanDetails) {
NetworkDetail networkDetail = scanDetail.getNetworkDetail();
@@ -2063,8 +2074,21 @@ public class WifiMetrics {
hotspot2r2Networks++;
}
}
+ if (networkDetail.isMboSupported()) {
+ mboSupportedNetworks++;
+ if (networkDetail.isMboCellularDataAware()) {
+ mboCellularDataAwareNetworks++;
+ }
+ if (networkDetail.isOceSupported()) {
+ oceSupportedNetworks++;
+ }
+ }
}
if (scanResult != null && scanResult.capabilities != null) {
+ if (ScanResultUtil.isScanResultForFilsSha256Network(scanResult)
+ || ScanResultUtil.isScanResultForFilsSha384Network(scanResult)) {
+ filsSupportedNetworks++;
+ }
if (ScanResultUtil.isScanResultForEapSuiteBNetwork(scanResult)) {
wpa3EnterpriseNetworks++;
} else if (ScanResultUtil.isScanResultForWapiPskNetwork(scanResult)) {
@@ -2098,6 +2122,10 @@ public class WifiMetrics {
mWifiLogProto.numHiddenNetworkScanResults += hiddenNetworks;
mWifiLogProto.numHotspot2R1NetworkScanResults += hotspot2r1Networks;
mWifiLogProto.numHotspot2R2NetworkScanResults += hotspot2r2Networks;
+ mWifiLogProto.numMboSupportedNetworkScanResults += mboSupportedNetworks;
+ mWifiLogProto.numMboCellularDataAwareNetworkScanResults += mboCellularDataAwareNetworks;
+ mWifiLogProto.numOceSupportedNetworkScanResults += oceSupportedNetworks;
+ mWifiLogProto.numFilsSupportedNetworkScanResults += filsSupportedNetworks;
mWifiLogProto.numScans++;
}
}
@@ -2876,6 +2904,29 @@ public class WifiMetrics {
+ mWifiLogProto.numHotspot2R1NetworkScanResults);
pw.println("mWifiLogProto.numHotspot2R2NetworkScanResults="
+ mWifiLogProto.numHotspot2R2NetworkScanResults);
+ pw.println("mWifiLogProto.numMboSupportedNetworkScanResults="
+ + mWifiLogProto.numMboSupportedNetworkScanResults);
+ pw.println("mWifiLogProto.numMboCellularDataAwareNetworkScanResults="
+ + mWifiLogProto.numMboCellularDataAwareNetworkScanResults);
+ pw.println("mWifiLogProto.numOceSupportedNetworkScanResults="
+ + mWifiLogProto.numOceSupportedNetworkScanResults);
+ pw.println("mWifiLogProto.numFilsSupportedNetworkScanResults="
+ + mWifiLogProto.numFilsSupportedNetworkScanResults);
+ pw.println("mWifiLogProto.numBssidFilteredDueToMboAssocDisallowInd="
+ + mWifiLogProto.numBssidFilteredDueToMboAssocDisallowInd);
+ pw.println("mWifiLogProto.numConnectToNetworkSupportingMbo="
+ + mWifiLogProto.numConnectToNetworkSupportingMbo);
+ pw.println("mWifiLogProto.numConnectToNetworkSupportingOce="
+ + mWifiLogProto.numConnectToNetworkSupportingOce);
+ pw.println("mWifiLogProto.numForceScanDueToSteeringRequest="
+ + mWifiLogProto.numForceScanDueToSteeringRequest);
+ pw.println("mWifiLogProto.numMboCellularSwitchRequest="
+ + mWifiLogProto.numMboCellularSwitchRequest);
+ pw.println("mWifiLogProto.numConnectRequestWithFilsAkm="
+ + mWifiLogProto.numConnectRequestWithFilsAkm);
+ pw.println("mWifiLogProto.numL2ConnectionThroughFilsAuthentication="
+ + mWifiLogProto.numL2ConnectionThroughFilsAuthentication);
+
pw.println("mWifiLogProto.numScans=" + mWifiLogProto.numScans);
pw.println("mWifiLogProto.WifiScoreCount: [" + MIN_WIFI_SCORE + ", "
+ MAX_WIFI_SCORE + "]");
@@ -5588,4 +5639,53 @@ public class WifiMetrics {
}
}
}
+
+ /**
+ * Increment number of BSSIDs filtered out from network selection due to MBO Association
+ * disallowed indication.
+ */
+ public void incrementNetworkSelectionFilteredBssidCountDueToMboAssocDisallowInd() {
+ synchronized (mLock) {
+ mWifiLogProto.numBssidFilteredDueToMboAssocDisallowInd++;
+ }
+ }
+
+ /**
+ * Increment number of times force scan is triggered due to a
+ * BSS transition management request frame from AP.
+ */
+ public void incrementForceScanCountDueToSteeringRequest() {
+ synchronized (mLock) {
+ mWifiLogProto.numForceScanDueToSteeringRequest++;
+ }
+ }
+
+ /**
+ * Increment number of times STA received cellular switch
+ * request from MBO supported AP.
+ */
+ public void incrementMboCellularSwitchRequestCount() {
+ synchronized (mLock) {
+ mWifiLogProto.numMboCellularSwitchRequest++;
+ }
+ }
+
+ /**
+ * Increment number of connect request to AP adding FILS AKM.
+ */
+ public void incrementConnectRequestWithFilsAkmCount() {
+ synchronized (mLock) {
+ mWifiLogProto.numConnectRequestWithFilsAkm++;
+ }
+ }
+
+ /**
+ * Increment number of times STA connected through FILS
+ * authentication.
+ */
+ public void incrementL2ConnectionThroughFilsAuthCount() {
+ synchronized (mLock) {
+ mWifiLogProto.numL2ConnectionThroughFilsAuthentication++;
+ }
+ }
}
diff --git a/service/java/com/android/server/wifi/WifiNetworkSelector.java b/service/java/com/android/server/wifi/WifiNetworkSelector.java
index d030bd894..d0a97f574 100644
--- a/service/java/com/android/server/wifi/WifiNetworkSelector.java
+++ b/service/java/com/android/server/wifi/WifiNetworkSelector.java
@@ -407,6 +407,8 @@ public class WifiNetworkSelector {
if (networkDetail != null) {
if (networkDetail.getMboAssociationDisallowedReasonCode()
!= MboOceConstants.MBO_OCE_ATTRIBUTE_NOT_PRESENT) {
+ mWifiMetrics
+ .incrementNetworkSelectionFilteredBssidCountDueToMboAssocDisallowInd();
mboAssociationDisallowedBssid.append(scanId).append("(")
.append(networkDetail.getMboAssociationDisallowedReasonCode())
.append(")").append(" / ");
diff --git a/service/java/com/android/server/wifi/hotspot2/NetworkDetail.java b/service/java/com/android/server/wifi/hotspot2/NetworkDetail.java
index 06fb52591..752cebf7c 100644
--- a/service/java/com/android/server/wifi/hotspot2/NetworkDetail.java
+++ b/service/java/com/android/server/wifi/hotspot2/NetworkDetail.java
@@ -126,6 +126,9 @@ public class NetworkDetail {
* and is set to -1 if association disallowed attribute is not present in the element.
*/
private final int mMboAssociationDisallowedReasonCode;
+ private final boolean mMboSupported;
+ private final boolean mMboCellularDataAware;
+ private final boolean mOceSupported;
public NetworkDetail(String bssid, ScanResult.InformationElement[] infoElements,
List<String> anqpLines, int freq) {
@@ -287,6 +290,9 @@ public class NetworkDetail {
mInternet = interworking.internet;
mHSRelease = vsa.hsRelease;
mAnqpDomainID = vsa.anqpDomainID;
+ mMboSupported = vsa.IsMboCapable;
+ mMboCellularDataAware = vsa.IsMboApCellularDataAware;
+ mOceSupported = vsa.IsOceCapable;
mMboAssociationDisallowedReasonCode = vsa.mboAssociationDisallowedReasonCode;
mAnqpOICount = roamingConsortium.anqpOICount;
mRoamingConsortiums = roamingConsortium.getRoamingConsortiums();
@@ -417,6 +423,9 @@ public class NetworkDetail {
mWifiMode = base.mWifiMode;
mMaxRate = base.mMaxRate;
mMaxNumberSpatialStreams = base.mMaxNumberSpatialStreams;
+ mMboSupported = base.mMboSupported;
+ mMboCellularDataAware = base.mMboCellularDataAware;
+ mOceSupported = base.mOceSupported;
mMboAssociationDisallowedReasonCode = base.mMboAssociationDisallowedReasonCode;
}
@@ -625,4 +634,16 @@ public class NetworkDetail {
public int getMboAssociationDisallowedReasonCode() {
return mMboAssociationDisallowedReasonCode;
}
+
+ public boolean isMboSupported() {
+ return mMboSupported;
+ }
+
+ public boolean isMboCellularDataAware() {
+ return mMboCellularDataAware;
+ }
+
+ public boolean isOceSupported() {
+ return mOceSupported;
+ }
}
diff --git a/service/proto/src/metrics.proto b/service/proto/src/metrics.proto
index d76c8fc6a..828dcaa19 100644
--- a/service/proto/src/metrics.proto
+++ b/service/proto/src/metrics.proto
@@ -603,6 +603,40 @@ message WifiLog {
// Metrics related to Wi-Fi off
optional WifiOffMetrics wifi_off_metrics = 166;
+
+ // Total number of scan results for MBO supported networks
+ optional int32 num_mbo_supported_network_scan_results = 167;
+
+ // Total number of scan results for MBO cellular data aware networks
+ optional int32 num_mbo_cellular_data_aware_network_scan_results = 168;
+
+ // Total number of scan results for OCE supported networks
+ optional int32 num_oce_supported_network_scan_results = 169;
+
+ // Total number of scan results for FILS supported networks
+ optional int32 num_fils_supported_network_scan_results = 170;
+
+ // Total number of bssids filtered from network selection due to mbo association
+ // disallowed indication
+ optional int32 num_bssid_filtered_due_to_mbo_assoc_disallow_ind = 171;
+
+ // Total number of connection to network supporting MBO
+ optional int32 num_connect_to_network_supporting_mbo = 172;
+
+ // Total number of connection to network supporting OCE
+ optional int32 num_connect_to_network_supporting_oce = 173;
+
+ // Total number of scans triggered due to steering request from AP
+ optional int32 num_force_scan_due_to_steering_request = 174;
+
+ // Total number of cellular switch requests from MBO supported AP
+ optional int32 num_mbo_cellular_switch_request = 175;
+
+ // Total number of connect request to AP adding FILS AKM
+ optional int32 num_connect_request_with_fils_akm = 176;
+
+ // Total number of successful L2 connection through FILS authentication
+ optional int32 num_l2_connection_through_fils_authentication = 177;
}
// Information that gets logged for every WiFi connection.
diff --git a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
index 7e12c2699..42bcd0013 100644
--- a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
@@ -4163,7 +4163,8 @@ public class ClientModeImplTest extends WifiBaseTest {
MboOceController.BtmFrameData btmFrmData = new MboOceController.BtmFrameData();
btmFrmData.mStatus = MboOceConstants.BTM_RESPONSE_STATUS_REJECT_UNSPECIFIED;
- btmFrmData.mBssTmDataFlagsMask = MboOceConstants.BTM_DATA_FLAG_DISASSOCIATION_IMMINENT;
+ btmFrmData.mBssTmDataFlagsMask = MboOceConstants.BTM_DATA_FLAG_DISASSOCIATION_IMMINENT
+ | MboOceConstants.BTM_DATA_FLAG_MBO_CELL_DATA_CONNECTION_PREFERENCE_INCLUDED;
btmFrmData.mBlackListDurationMs = 0;
mCmi.sendMessage(WifiMonitor.MBO_OCE_BSS_TM_HANDLING_DONE, btmFrmData);
@@ -4172,6 +4173,10 @@ public class ClientModeImplTest extends WifiBaseTest {
verify(mBssidBlocklistMonitor).blockBssidForDurationMs(sBSSID, sSSID,
MboOceConstants.DEFAULT_BLACKLIST_DURATION_MS);
verify(mWifiConnectivityManager).forceConnectivityScan(ClientModeImpl.WIFI_WORK_SOURCE);
+ verify(mWifiMetrics, times(1)).incrementMboCellularSwitchRequestCount();
+ verify(mWifiMetrics, times(1))
+ .incrementForceScanCountDueToSteeringRequest();
+
}
/**
@@ -4735,9 +4740,13 @@ public class ClientModeImplTest extends WifiBaseTest {
prepareFilsHlpPktAndSendStartConnect();
+ verify(mWifiMetrics, times(1)).incrementConnectRequestWithFilsAkmCount();
+
mCmi.sendMessage(WifiMonitor.FILS_NETWORK_CONNECTION_EVENT, 0, 0, sBSSID);
mLooper.dispatchAll();
+ verify(mWifiMetrics, times(1)).incrementL2ConnectionThroughFilsAuthCount();
+
mCmi.sendMessage(WifiMonitor.SUPPLICANT_STATE_CHANGE_EVENT, 0, 0,
new StateChangeResult(0, WifiSsid.createFromAsciiEncoded(sFilsSsid),
sBSSID, SupplicantState.COMPLETED));
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
index abaf62841..1cf3597f8 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
@@ -455,8 +455,24 @@ public class WifiMetricsTest extends WifiBaseTest {
private static final int MAX_SUPPORTED_TX_LINK_SPEED_MBPS = 144;
private static final int MAX_SUPPORTED_RX_LINK_SPEED_MBPS = 190;
+ private static final long NUM_MBO_SUPPORTED_NETWORKS_SCAN_RESULTS = 4;
+ private static final long NUM_MBO_CELL_DATA_AWARE_NETWORKS_SCAN_RESULTS = 2;
+ private static final long NUM_OCE_SUPPORTED_NETWORKS_SCAN_RESULTS = 2;
+ private static final long NUM_FILS_SUPPORTED_NETWORKS_SCAN_RESULTS = 2;
+ private static final long NUM_BSSID_FILTERED_DUE_TO_MBO_ASSOC_DISALLOW_IND = 3;
+ private static final long NUM_CONNECT_TO_MBO_SUPPORTED_NETWORKS = 4;
+ private static final long NUM_CONNECT_TO_OCE_SUPPORTED_NETWORKS = 3;
+ private static final long NUM_FORCE_SCAN_DUE_TO_STEERING_REQUEST = 2;
+ private static final long NUM_MBO_CELLULAR_SWITCH_REQUEST = 3;
+ private static final long NUM_CONNECT_REQUEST_WITH_FILS_AKM = 4;
+ private static final long NUM_L2_CONNECTION_THROUGH_FILS_AUTHENTICATION = 3;
+
+ public static final int FEATURE_MBO = 1 << 0;
+ public static final int FEATURE_MBO_CELL_DATA_AWARE = 1 << 1;
+ public static final int FEATURE_OCE = 1 << 2;
+
private ScanDetail buildMockScanDetail(boolean hidden, NetworkDetail.HSRelease hSRelease,
- String capabilities) {
+ String capabilities, int supportedFeatures) {
ScanDetail mockScanDetail = mock(ScanDetail.class);
NetworkDetail mockNetworkDetail = mock(NetworkDetail.class);
ScanResult mockScanResult = mock(ScanResult.class);
@@ -465,6 +481,15 @@ public class WifiMetricsTest extends WifiBaseTest {
when(mockNetworkDetail.isHiddenBeaconFrame()).thenReturn(hidden);
when(mockNetworkDetail.getHSRelease()).thenReturn(hSRelease);
mockScanResult.capabilities = capabilities;
+ if ((supportedFeatures & FEATURE_MBO) != 0) {
+ when(mockNetworkDetail.isMboSupported()).thenReturn(true);
+ }
+ if ((supportedFeatures & FEATURE_MBO_CELL_DATA_AWARE) != 0) {
+ when(mockNetworkDetail.isMboCellularDataAware()).thenReturn(true);
+ }
+ if ((supportedFeatures & FEATURE_OCE) != 0) {
+ when(mockNetworkDetail.isOceSupported()).thenReturn(true);
+ }
return mockScanDetail;
}
@@ -513,24 +538,26 @@ public class WifiMetricsTest extends WifiBaseTest {
private List<ScanDetail> buildMockScanDetailList() {
List<ScanDetail> mockScanDetails = new ArrayList<ScanDetail>();
- mockScanDetails.add(buildMockScanDetail(true, null, "[ESS]"));
- mockScanDetails.add(buildMockScanDetail(false, null, "[WPA2-PSK-CCMP][ESS]"));
- mockScanDetails.add(buildMockScanDetail(false, null, "[WPA-PSK-CCMP]"));
- mockScanDetails.add(buildMockScanDetail(false, null, "[WPA2-SAE-CCMP]"));
- mockScanDetails.add(buildMockScanDetail(false, null, "[WPA-PSK-CCMP]"));
- mockScanDetails.add(buildMockScanDetail(false, null, "[WEP]"));
- mockScanDetails.add(buildMockScanDetail(false, null, "[WPA2-SAE-CCMP]"));
- mockScanDetails.add(buildMockScanDetail(false, null, "[WPA2-OWE-CCMP]"));
- mockScanDetails.add(buildMockScanDetail(false, null, "[WPA2-EAP-SUITE-B-192]"));
- mockScanDetails.add(buildMockScanDetail(false, null, "[WAPI-WAPI-PSK-SMS4-SMS4]"));
- mockScanDetails.add(buildMockScanDetail(false, null, "[WAPI-WAPI-CERT-SMS4-SMS4]"));
- mockScanDetails.add(buildMockScanDetail(false, null, "[WAPI-WAPI-CERT-SMS4-SMS4]"));
+ mockScanDetails.add(buildMockScanDetail(true, null, "[ESS]", 0));
+ mockScanDetails.add(buildMockScanDetail(false, null, "[WPA2-PSK-CCMP][ESS]", 0));
+ mockScanDetails.add(buildMockScanDetail(false, null, "[WPA-PSK-CCMP]", 0));
+ mockScanDetails.add(buildMockScanDetail(false, null, "[WPA2-SAE-CCMP]", FEATURE_MBO));
+ mockScanDetails.add(buildMockScanDetail(false, null, "[WPA-PSK-CCMP]", 0));
+ mockScanDetails.add(buildMockScanDetail(false, null, "[WEP]", 0));
+ mockScanDetails.add(buildMockScanDetail(false, null, "[WPA2-SAE-CCMP]",
+ FEATURE_MBO | FEATURE_MBO_CELL_DATA_AWARE));
+ mockScanDetails.add(buildMockScanDetail(false, null, "[WPA2-OWE-CCMP]",
+ FEATURE_MBO | FEATURE_MBO_CELL_DATA_AWARE | FEATURE_OCE));
+ mockScanDetails.add(buildMockScanDetail(false, null, "[WPA2-EAP-SUITE-B-192]", 0));
+ mockScanDetails.add(buildMockScanDetail(false, null, "[WAPI-WAPI-PSK-SMS4-SMS4]", 0));
+ mockScanDetails.add(buildMockScanDetail(false, null, "[WAPI-WAPI-CERT-SMS4-SMS4]", 0));
+ mockScanDetails.add(buildMockScanDetail(false, null, "[WAPI-WAPI-CERT-SMS4-SMS4]", 0));
mockScanDetails.add(buildMockScanDetail(false, NetworkDetail.HSRelease.R2,
- "[WPA-EAP-CCMP]"));
+ "[WPA-EAP-CCMP+FILS-SHA256-CCMP]", FEATURE_MBO | FEATURE_OCE));
mockScanDetails.add(buildMockScanDetail(false, NetworkDetail.HSRelease.R2,
- "[WPA2-EAP+FT/EAP-CCMP]"));
+ "[WPA2-EAP+FT/EAP-CCMP+FILS-SHA256-CCMP]", 0));
mockScanDetails.add(buildMockScanDetail(false, NetworkDetail.HSRelease.R1,
- "[WPA-EAP-CCMP]"));
+ "[WPA-EAP-CCMP]", 0));
return mockScanDetails;
}
@@ -919,6 +946,22 @@ public class WifiMetricsTest extends WifiBaseTest {
DATA_STALL_MIN_TX_BAD_SETTING);
mResources.setInteger(R.integer.config_wifiDataStallMinTxSuccessWithoutRx,
DATA_STALL_MIN_TX_SUCCESS_WITHOUT_RX_SETTING);
+
+ for (int i = 0; i < NUM_BSSID_FILTERED_DUE_TO_MBO_ASSOC_DISALLOW_IND; i++) {
+ mWifiMetrics.incrementNetworkSelectionFilteredBssidCountDueToMboAssocDisallowInd();
+ }
+ for (int i = 0; i < NUM_FORCE_SCAN_DUE_TO_STEERING_REQUEST; i++) {
+ mWifiMetrics.incrementForceScanCountDueToSteeringRequest();
+ }
+ for (int i = 0; i < NUM_MBO_CELLULAR_SWITCH_REQUEST; i++) {
+ mWifiMetrics.incrementMboCellularSwitchRequestCount();
+ }
+ for (int i = 0; i < NUM_CONNECT_REQUEST_WITH_FILS_AKM; i++) {
+ mWifiMetrics.incrementConnectRequestWithFilsAkmCount();
+ }
+ for (int i = 0; i < NUM_L2_CONNECTION_THROUGH_FILS_AUTHENTICATION; i++) {
+ mWifiMetrics.incrementL2ConnectionThroughFilsAuthCount();
+ }
}
private void addWifiPowerMetrics() {
@@ -1114,6 +1157,15 @@ public class WifiMetricsTest extends WifiBaseTest {
mDecodedProto.numHotspot2R1NetworkScanResults);
assertEquals(NUM_HOTSPOT2_R2_NETWORK_SCAN_RESULTS * NUM_SCANS,
mDecodedProto.numHotspot2R2NetworkScanResults);
+
+ assertEquals(NUM_MBO_SUPPORTED_NETWORKS_SCAN_RESULTS * NUM_SCANS,
+ mDecodedProto.numMboSupportedNetworkScanResults);
+ assertEquals(NUM_MBO_CELL_DATA_AWARE_NETWORKS_SCAN_RESULTS * NUM_SCANS,
+ mDecodedProto.numMboCellularDataAwareNetworkScanResults);
+ assertEquals(NUM_OCE_SUPPORTED_NETWORKS_SCAN_RESULTS * NUM_SCANS,
+ mDecodedProto.numOceSupportedNetworkScanResults);
+ assertEquals(NUM_FILS_SUPPORTED_NETWORKS_SCAN_RESULTS * NUM_SCANS,
+ mDecodedProto.numFilsSupportedNetworkScanResults);
assertEquals(NUM_SCANS,
mDecodedProto.numScans);
assertEquals(NUM_CONNECTIVITY_ONESHOT_SCAN_EVENT,
@@ -1277,6 +1329,17 @@ public class WifiMetricsTest extends WifiBaseTest {
mDecodedProto.healthMonitorMetrics.numNetworkSufficientRecentStatsOnly);
assertEquals(NUM_NETWORK_SUFFICIENT_RECENT_PREV_STATS,
mDecodedProto.healthMonitorMetrics.numNetworkSufficientRecentPrevStats);
+ assertEquals(NUM_BSSID_FILTERED_DUE_TO_MBO_ASSOC_DISALLOW_IND,
+ mDecodedProto.numBssidFilteredDueToMboAssocDisallowInd);
+ assertEquals(NUM_FORCE_SCAN_DUE_TO_STEERING_REQUEST,
+ mDecodedProto.numForceScanDueToSteeringRequest);
+ assertEquals(NUM_MBO_CELLULAR_SWITCH_REQUEST,
+ mDecodedProto.numMboCellularSwitchRequest);
+ assertEquals(NUM_CONNECT_REQUEST_WITH_FILS_AKM,
+ mDecodedProto.numConnectRequestWithFilsAkm);
+ assertEquals(NUM_L2_CONNECTION_THROUGH_FILS_AUTHENTICATION,
+ mDecodedProto.numL2ConnectionThroughFilsAuthentication);
+
}
/**
@@ -1446,6 +1509,8 @@ public class WifiMetricsTest extends WifiBaseTest {
ScanDetail scanDetail = mock(ScanDetail.class);
when(scanDetail.getNetworkDetail()).thenReturn(networkDetail);
when(scanDetail.getScanResult()).thenReturn(scanResult);
+ when(networkDetail.isMboSupported()).thenReturn(true);
+ when(networkDetail.isOceSupported()).thenReturn(true);
config.networkId = TEST_NETWORK_ID;
mWifiMetrics.setNominatorForNetwork(TEST_NETWORK_ID,
@@ -1502,6 +1567,8 @@ public class WifiMetricsTest extends WifiBaseTest {
assertFalse(mDecodedProto.connectionEvent[1].useRandomizedMac);
assertEquals(WifiMetricsProto.ConnectionEvent.NOMINATOR_MANUAL,
mDecodedProto.connectionEvent[0].connectionNominator);
+ assertEquals(1, mDecodedProto.numConnectToNetworkSupportingMbo);
+ assertEquals(1, mDecodedProto.numConnectToNetworkSupportingOce);
}
/**
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java b/tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java
index 735c1fc8c..4f303d104 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java
@@ -1471,6 +1471,8 @@ public class WifiNetworkSelectorTest extends WifiBaseTest {
List<WifiCandidates.Candidate> candidates = mWifiNetworkSelector.getCandidatesFromScan(
scanDetails, blacklist, mWifiInfo, false, true, false);
WifiConfiguration candidate = mWifiNetworkSelector.selectNetwork(candidates);
+ verify(mWifiMetrics, times(1))
+ .incrementNetworkSelectionFilteredBssidCountDueToMboAssocDisallowInd();
assertEquals("Expect null configuration", null, candidate);
assertTrue(mWifiNetworkSelector.getConnectableScanDetails().isEmpty());
}