diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2020-04-14 00:53:09 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-04-14 00:53:09 +0000 |
commit | ba2f907993b7a4609fde4fd6078e104dc3971a9a (patch) | |
tree | c753b9901d6fe7fe408cf8d4647bb70f134ba058 | |
parent | 1ab4050b64971191a62d3ccb330c096da0308c23 (diff) | |
parent | 6e5f940b37880a6d05a9a50c0dbb7245f2448ce0 (diff) |
Merge "[Passpoint] Add metrics for R3 APs" into rvc-dev
-rw-r--r-- | service/java/com/android/server/wifi/WifiMetrics.java | 40 | ||||
-rw-r--r-- | service/proto/src/metrics.proto | 17 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java | 28 |
3 files changed, 83 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java index 409293f9c..0760dee4a 100644 --- a/service/java/com/android/server/wifi/WifiMetrics.java +++ b/service/java/com/android/server/wifi/WifiMetrics.java @@ -318,10 +318,13 @@ public class WifiMetrics { private final SparseIntArray mObservedHotspotR1ApInScanHistogram = new SparseIntArray(); private final SparseIntArray mObservedHotspotR2ApInScanHistogram = new SparseIntArray(); + private final SparseIntArray mObservedHotspotR3ApInScanHistogram = new SparseIntArray(); private final SparseIntArray mObservedHotspotR1EssInScanHistogram = new SparseIntArray(); private final SparseIntArray mObservedHotspotR2EssInScanHistogram = new SparseIntArray(); + private final SparseIntArray mObservedHotspotR3EssInScanHistogram = new SparseIntArray(); private final SparseIntArray mObservedHotspotR1ApsPerEssInScanHistogram = new SparseIntArray(); private final SparseIntArray mObservedHotspotR2ApsPerEssInScanHistogram = new SparseIntArray(); + private final SparseIntArray mObservedHotspotR3ApsPerEssInScanHistogram = new SparseIntArray(); private final SparseIntArray mObserved80211mcApInScanHistogram = new SparseIntArray(); @@ -2193,6 +2196,7 @@ public class WifiMetrics { int hiddenNetworks = 0; int hotspot2r1Networks = 0; int hotspot2r2Networks = 0; + int hotspot2r3Networks = 0; int enhacedOpenNetworks = 0; int wpa3PersonalNetworks = 0; int wpa3EnterpriseNetworks = 0; @@ -2218,6 +2222,8 @@ public class WifiMetrics { hotspot2r1Networks++; } else if (networkDetail.getHSRelease() == NetworkDetail.HSRelease.R2) { hotspot2r2Networks++; + } else if (networkDetail.getHSRelease() == NetworkDetail.HSRelease.R3) { + hotspot2r3Networks++; } } if (networkDetail.isMboSupported()) { @@ -2274,6 +2280,7 @@ public class WifiMetrics { mWifiLogProto.numHiddenNetworkScanResults += hiddenNetworks; mWifiLogProto.numHotspot2R1NetworkScanResults += hotspot2r1Networks; mWifiLogProto.numHotspot2R2NetworkScanResults += hotspot2r2Networks; + mWifiLogProto.numHotspot2R3NetworkScanResults += hotspot2r3Networks; mWifiLogProto.numMboSupportedNetworkScanResults += mboSupportedNetworks; mWifiLogProto.numMboCellularDataAwareNetworkScanResults += mboCellularDataAwareNetworks; mWifiLogProto.numOceSupportedNetworkScanResults += oceSupportedNetworks; @@ -2725,8 +2732,10 @@ public class WifiMetrics { int savedPasspointProviderBssids = 0; int passpointR1Aps = 0; int passpointR2Aps = 0; + int passpointR3Aps = 0; Map<ANQPNetworkKey, Integer> passpointR1UniqueEss = new HashMap<>(); Map<ANQPNetworkKey, Integer> passpointR2UniqueEss = new HashMap<>(); + Map<ANQPNetworkKey, Integer> passpointR3UniqueEss = new HashMap<>(); int supporting80211mcAps = 0; for (ScanDetail scanDetail : scanDetails) { NetworkDetail networkDetail = scanDetail.getNetworkDetail(); @@ -2746,6 +2755,8 @@ public class WifiMetrics { passpointR1Aps++; } else if (networkDetail.getHSRelease() == NetworkDetail.HSRelease.R2) { passpointR2Aps++; + } else if (networkDetail.getHSRelease() == NetworkDetail.HSRelease.R3) { + passpointR3Aps++; } long bssid = 0; @@ -2768,9 +2779,12 @@ public class WifiMetrics { Integer countObj = passpointR2UniqueEss.get(uniqueEss); int count = countObj == null ? 0 : countObj; passpointR2UniqueEss.put(uniqueEss, count + 1); + } else if (networkDetail.getHSRelease() == NetworkDetail.HSRelease.R3) { + Integer countObj = passpointR3UniqueEss.get(uniqueEss); + int count = countObj == null ? 0 : countObj; + passpointR3UniqueEss.put(uniqueEss, count + 1); } } - } if (mWifiNetworkSelector.isSignalTooWeak(scanResult)) { @@ -2822,16 +2836,22 @@ public class WifiMetrics { savedPasspointProviderBssids); incrementTotalPasspointAps(mObservedHotspotR1ApInScanHistogram, passpointR1Aps); incrementTotalPasspointAps(mObservedHotspotR2ApInScanHistogram, passpointR2Aps); + incrementTotalPasspointAps(mObservedHotspotR3ApInScanHistogram, passpointR3Aps); incrementTotalUniquePasspointEss(mObservedHotspotR1EssInScanHistogram, passpointR1UniqueEss.size()); incrementTotalUniquePasspointEss(mObservedHotspotR2EssInScanHistogram, passpointR2UniqueEss.size()); + incrementTotalUniquePasspointEss(mObservedHotspotR3EssInScanHistogram, + passpointR3UniqueEss.size()); for (Integer count : passpointR1UniqueEss.values()) { incrementPasspointPerUniqueEss(mObservedHotspotR1ApsPerEssInScanHistogram, count); } for (Integer count : passpointR2UniqueEss.values()) { incrementPasspointPerUniqueEss(mObservedHotspotR2ApsPerEssInScanHistogram, count); } + for (Integer count : passpointR3UniqueEss.values()) { + incrementPasspointPerUniqueEss(mObservedHotspotR3ApsPerEssInScanHistogram, count); + } increment80211mcAps(mObserved80211mcApInScanHistogram, supporting80211mcAps); } } @@ -3127,6 +3147,8 @@ public class WifiMetrics { + mWifiLogProto.numHotspot2R1NetworkScanResults); pw.println("mWifiLogProto.numHotspot2R2NetworkScanResults=" + mWifiLogProto.numHotspot2R2NetworkScanResults); + pw.println("mWifiLogProto.numHotspot2R3NetworkScanResults=" + + mWifiLogProto.numHotspot2R3NetworkScanResults); pw.println("mWifiLogProto.numMboSupportedNetworkScanResults=" + mWifiLogProto.numMboSupportedNetworkScanResults); pw.println("mWifiLogProto.numMboCellularDataAwareNetworkScanResults=" @@ -3317,14 +3339,20 @@ public class WifiMetrics { + mObservedHotspotR1ApInScanHistogram); pw.println("mWifiLogProto.observedHotspotR2ApInScanHistogram=" + mObservedHotspotR2ApInScanHistogram); + pw.println("mWifiLogProto.observedHotspotR3ApInScanHistogram=" + + mObservedHotspotR3ApInScanHistogram); pw.println("mWifiLogProto.observedHotspotR1EssInScanHistogram=" + mObservedHotspotR1EssInScanHistogram); pw.println("mWifiLogProto.observedHotspotR2EssInScanHistogram=" + mObservedHotspotR2EssInScanHistogram); + pw.println("mWifiLogProto.observedHotspotR3EssInScanHistogram=" + + mObservedHotspotR3EssInScanHistogram); pw.println("mWifiLogProto.observedHotspotR1ApsPerEssInScanHistogram=" + mObservedHotspotR1ApsPerEssInScanHistogram); pw.println("mWifiLogProto.observedHotspotR2ApsPerEssInScanHistogram=" + mObservedHotspotR2ApsPerEssInScanHistogram); + pw.println("mWifiLogProto.observedHotspotR3ApsPerEssInScanHistogram=" + + mObservedHotspotR3ApsPerEssInScanHistogram); pw.println("mWifiLogProto.observed80211mcSupportingApsInScanHistogram" + mObserved80211mcApInScanHistogram); @@ -3969,16 +3997,23 @@ public class WifiMetrics { makeNumConnectableNetworksBucketArray(mObservedHotspotR1ApInScanHistogram); mWifiLogProto.observedHotspotR2ApsInScanHistogram = makeNumConnectableNetworksBucketArray(mObservedHotspotR2ApInScanHistogram); + mWifiLogProto.observedHotspotR3ApsInScanHistogram = + makeNumConnectableNetworksBucketArray(mObservedHotspotR3ApInScanHistogram); mWifiLogProto.observedHotspotR1EssInScanHistogram = makeNumConnectableNetworksBucketArray(mObservedHotspotR1EssInScanHistogram); mWifiLogProto.observedHotspotR2EssInScanHistogram = makeNumConnectableNetworksBucketArray(mObservedHotspotR2EssInScanHistogram); + mWifiLogProto.observedHotspotR3EssInScanHistogram = + makeNumConnectableNetworksBucketArray(mObservedHotspotR3EssInScanHistogram); mWifiLogProto.observedHotspotR1ApsPerEssInScanHistogram = makeNumConnectableNetworksBucketArray( mObservedHotspotR1ApsPerEssInScanHistogram); mWifiLogProto.observedHotspotR2ApsPerEssInScanHistogram = makeNumConnectableNetworksBucketArray( mObservedHotspotR2ApsPerEssInScanHistogram); + mWifiLogProto.observedHotspotR3ApsPerEssInScanHistogram = + makeNumConnectableNetworksBucketArray( + mObservedHotspotR3ApsPerEssInScanHistogram); mWifiLogProto.observed80211McSupportingApsInScanHistogram = makeNumConnectableNetworksBucketArray(mObserved80211mcApInScanHistogram); @@ -4297,10 +4332,13 @@ public class WifiMetrics { mNumOpenNetworkConnectMessageFailedToSend = 0; mObservedHotspotR1ApInScanHistogram.clear(); mObservedHotspotR2ApInScanHistogram.clear(); + mObservedHotspotR3ApInScanHistogram.clear(); mObservedHotspotR1EssInScanHistogram.clear(); mObservedHotspotR2EssInScanHistogram.clear(); + mObservedHotspotR3EssInScanHistogram.clear(); mObservedHotspotR1ApsPerEssInScanHistogram.clear(); mObservedHotspotR2ApsPerEssInScanHistogram.clear(); + mObservedHotspotR3ApsPerEssInScanHistogram.clear(); mSoftApEventListTethered.clear(); mSoftApEventListLocalOnly.clear(); mWpsMetrics.clear(); diff --git a/service/proto/src/metrics.proto b/service/proto/src/metrics.proto index 04682db21..932fb2e0f 100644 --- a/service/proto/src/metrics.proto +++ b/service/proto/src/metrics.proto @@ -658,6 +658,23 @@ message WifiLog { // Initial partial scan stats optional InitPartialScanStats init_partial_scan_stats = 184; + + // Total number of scan results for hotspot 2.0 r3 networks + optional int32 num_hotspot2_r3_network_scan_results = 185; + + // Histogram counting instances of scans with N many HotSpot 2.0 R3 APs + repeated NumConnectableNetworksBucket observed_hotspot_r3_aps_in_scan_histogram = 186; + + // Histogram counting number of HotSpot 2.0 R3 APs per observed ESS in a scan + // (one value added per unique ESS - potentially multiple counts per single + // scan!) + repeated NumConnectableNetworksBucket observed_hotspot_r3_aps_per_ess_in_scan_histogram = 187; + + // Histogram counting instances of scans with N many unique HotSpot 2.0 R3 ESS. + // Where ESS is defined as the (HESSID, ANQP Domain ID), (SSID, ANQP Domain ID) or + // (SSID, BSSID) tuple depending on AP configuration (in the above priority + // order). + repeated NumConnectableNetworksBucket observed_hotspot_r3_ess_in_scan_histogram = 188; } // Information that gets logged for every WiFi connection. diff --git a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java index d9a435705..c8b149ba6 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java @@ -347,7 +347,6 @@ public class WifiMetricsTest extends WifiBaseTest { private static final int NUM_RSSI_LEVELS_TO_INCREMENT = 20; private static final int NUM_OPEN_NETWORK_SCAN_RESULTS = 1; private static final int NUM_LEGACY_PERSONAL_NETWORK_SCAN_RESULTS = 4; - private static final int NUM_LEGACY_ENTERPRISE_NETWORK_SCAN_RESULTS = 3; private static final int NUM_ENHANCED_OPEN_NETWORK_SCAN_RESULTS = 1; private static final int NUM_WPA3_PERSONAL_NETWORK_SCAN_RESULTS = 2; private static final int NUM_WPA3_ENTERPRISE_NETWORK_SCAN_RESULTS = 1; @@ -356,6 +355,10 @@ public class WifiMetricsTest extends WifiBaseTest { private static final int NUM_HIDDEN_NETWORK_SCAN_RESULTS = 1; private static final int NUM_HOTSPOT2_R1_NETWORK_SCAN_RESULTS = 1; private static final int NUM_HOTSPOT2_R2_NETWORK_SCAN_RESULTS = 2; + private static final int NUM_HOTSPOT2_R3_NETWORK_SCAN_RESULTS = 1; + private static final int NUM_LEGACY_ENTERPRISE_NETWORK_SCAN_RESULTS = + NUM_HOTSPOT2_R1_NETWORK_SCAN_RESULTS + NUM_HOTSPOT2_R2_NETWORK_SCAN_RESULTS + + NUM_HOTSPOT2_R3_NETWORK_SCAN_RESULTS; private static final int NUM_SCANS = 5; private static final int NUM_CONNECTIVITY_ONESHOT_SCAN_EVENT = 4; private static final int NUM_EXTERNAL_APP_ONESHOT_SCAN_REQUESTS = 15; @@ -582,12 +585,17 @@ public class WifiMetricsTest extends WifiBaseTest { 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)); + // Number of scans of R2 networks must be equal to NUM_HOTSPOT2_R2_NETWORK_SCAN_RESULTS mockScanDetails.add(buildMockScanDetail(false, NetworkDetail.HSRelease.R2, "[WPA-EAP-CCMP+FILS-SHA256-CCMP]", FEATURE_MBO | FEATURE_OCE)); mockScanDetails.add(buildMockScanDetail(false, NetworkDetail.HSRelease.R2, "[WPA2-EAP+FT/EAP-CCMP+FILS-SHA256-CCMP]", 0)); + // Number of scans of R1 networks must be equal to NUM_HOTSPOT2_R1_NETWORK_SCAN_RESULTS mockScanDetails.add(buildMockScanDetail(false, NetworkDetail.HSRelease.R1, "[WPA-EAP-CCMP]", 0)); + // Number of scans of R3 networks must be equal to NUM_HOTSPOT2_R3_NETWORK_SCAN_RESULTS + mockScanDetails.add(buildMockScanDetail(false, NetworkDetail.HSRelease.R3, + "[WPA-EAP-CCMP]", 0)); return mockScanDetails; } @@ -1223,6 +1231,8 @@ public class WifiMetricsTest extends WifiBaseTest { mDecodedProto.numHotspot2R1NetworkScanResults); assertEquals(NUM_HOTSPOT2_R2_NETWORK_SCAN_RESULTS * NUM_SCANS, mDecodedProto.numHotspot2R2NetworkScanResults); + assertEquals(NUM_HOTSPOT2_R3_NETWORK_SCAN_RESULTS * NUM_SCANS, + mDecodedProto.numHotspot2R3NetworkScanResults); assertEquals(NUM_MBO_SUPPORTED_NETWORKS_SCAN_RESULTS * NUM_SCANS, mDecodedProto.numMboSupportedNetworkScanResults); @@ -2497,15 +2507,25 @@ public class WifiMetricsTest extends WifiBaseTest { anqpDomainId3, NetworkDetail.HSRelease.R2, false)); scan.add(buildMockScanDetailPasspoint("PASSPOINT_Z", "AB:02:03:04:05:06", hessid3, anqpDomainId3, NetworkDetail.HSRelease.R2, true)); + // 2 R3 Passpoint APs belonging to a single provider: hessid4 + long hessid4 = 17; + int anqpDomainId4 = 2; + scan.add(buildMockScanDetailPasspoint("PASSPOINT_R3", "0C:02:03:04:05:01", hessid4, + anqpDomainId4, NetworkDetail.HSRelease.R3, true)); + scan.add(buildMockScanDetailPasspoint("PASSPOINT_R3_2", "0C:02:03:04:05:02", hessid4, + anqpDomainId4, NetworkDetail.HSRelease.R3, true)); mWifiMetrics.incrementAvailableNetworksHistograms(scan, true); dumpProtoAndDeserialize(); verifyHist(mDecodedProto.observedHotspotR1ApsInScanHistogram, 2, a(0, 2), a(1, 1)); verifyHist(mDecodedProto.observedHotspotR2ApsInScanHistogram, 2, a(2, 3), a(1, 1)); + verifyHist(mDecodedProto.observedHotspotR3ApsInScanHistogram, 2, a(0, 2), a(1, 1)); verifyHist(mDecodedProto.observedHotspotR1EssInScanHistogram, 2, a(0, 1), a(1, 1)); verifyHist(mDecodedProto.observedHotspotR2EssInScanHistogram, 1, a(1), a(2)); + verifyHist(mDecodedProto.observedHotspotR3EssInScanHistogram, 2, a(0, 1), a(1, 1)); verifyHist(mDecodedProto.observedHotspotR1ApsPerEssInScanHistogram, 1, a(2), a(1)); verifyHist(mDecodedProto.observedHotspotR2ApsPerEssInScanHistogram, 2, a(2, 3), a(1, 1)); + verifyHist(mDecodedProto.observedHotspotR3ApsPerEssInScanHistogram, 1, a(2), a(1)); // check bounds scan.clear(); @@ -2516,6 +2536,8 @@ public class WifiMetricsTest extends WifiBaseTest { i + 10, NetworkDetail.HSRelease.R1, true)); scan.add(buildMockScanDetailPasspoint("PASSPOINT_XY" + i, "AA:02:03:04:05:06", 1000 * i, i + 10, NetworkDetail.HSRelease.R2, false)); + scan.add(buildMockScanDetailPasspoint("PASSPOINT_XZ" + i, "0B:02:03:04:05:06", 101 * i, + i + 10, NetworkDetail.HSRelease.R3, false)); } mWifiMetrics.incrementAvailableNetworksHistograms(scan, true); dumpProtoAndDeserialize(); @@ -2523,10 +2545,14 @@ public class WifiMetricsTest extends WifiBaseTest { a(WifiMetrics.MAX_TOTAL_PASSPOINT_APS_BUCKET), a(1)); verifyHist(mDecodedProto.observedHotspotR2ApsInScanHistogram, 1, a(WifiMetrics.MAX_TOTAL_PASSPOINT_APS_BUCKET), a(1)); + verifyHist(mDecodedProto.observedHotspotR3ApsInScanHistogram, 1, + a(WifiMetrics.MAX_TOTAL_PASSPOINT_APS_BUCKET), a(1)); verifyHist(mDecodedProto.observedHotspotR1EssInScanHistogram, 1, a(WifiMetrics.MAX_TOTAL_PASSPOINT_UNIQUE_ESS_BUCKET), a(1)); verifyHist(mDecodedProto.observedHotspotR2EssInScanHistogram, 1, a(WifiMetrics.MAX_TOTAL_PASSPOINT_UNIQUE_ESS_BUCKET), a(1)); + verifyHist(mDecodedProto.observedHotspotR3EssInScanHistogram, 1, + a(WifiMetrics.MAX_TOTAL_PASSPOINT_UNIQUE_ESS_BUCKET), a(1)); } /** |