From f42caa9a7b9c6961af5b6bc75ab88c074ee6e4cc Mon Sep 17 00:00:00 2001 From: Hai Shalom Date: Thu, 25 Jun 2020 13:51:47 -0700 Subject: [Passpoint] Add metrics to indicate OSU provisioned profile Added a new boolean flag that indicates if the profile that is currently used for a connection was provisioned by an OSU server. Updated-PDD: TRUE Bug: 156117292 Test: atest WifiMetricsTest Test: dumpsys wifi Change-Id: Ia555f9791b15be06f4bc0765315ab34d261bcf07 --- .../com/android/server/wifi/WifiMetricsTest.java | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java index 198eb079f..4e895e488 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java @@ -1762,10 +1762,11 @@ public class WifiMetricsTest extends WifiBaseTest { assertEquals(1, mDecodedProto.connectionEvent.length); assertEquals(WifiMetricsProto.ConnectionEvent.TYPE_OPEN, mDecodedProto.connectionEvent[0].networkType); + assertFalse(mDecodedProto.connectionEvent[0].isOsuProvisioned); } /** - * Verify the ConnectionEvent is labeled with networkType passpoint correctly. + * Verify the ConnectionEvent is labeled with networkType Passpoint correctly. */ @Test public void testConnectionNetworkTypePasspoint() throws Exception { @@ -1781,6 +1782,7 @@ public class WifiMetricsTest extends WifiBaseTest { assertEquals(1, mDecodedProto.connectionEvent.length); assertEquals(WifiMetricsProto.ConnectionEvent.TYPE_PASSPOINT, mDecodedProto.connectionEvent[0].networkType); + assertFalse(mDecodedProto.connectionEvent[0].isOsuProvisioned); } /** @@ -4995,4 +4997,26 @@ public class WifiMetricsTest extends WifiBaseTest { assertEquals(2, mDecodedProto.carrierWifiMetrics.numConnectionAuthFailure); assertEquals(3, mDecodedProto.carrierWifiMetrics.numConnectionNonAuthFailure); } + + /** + * Verify the ConnectionEvent is labeled with networkType Passpoint correctly and that the OSU + * provisioned flag is set to true. + */ + @Test + public void testConnectionNetworkTypePasspointFromOsu() throws Exception { + WifiConfiguration config = WifiConfigurationTestUtil.createPasspointNetwork(); + config.updateIdentifier = "7"; + mWifiMetrics.startConnectionEvent(config, "RED", + WifiMetricsProto.ConnectionEvent.ROAM_NONE); + mWifiMetrics.endConnectionEvent( + WifiMetrics.ConnectionEvent.FAILURE_ASSOCIATION_TIMED_OUT, + WifiMetricsProto.ConnectionEvent.HLF_NONE, + WifiMetricsProto.ConnectionEvent.FAILURE_REASON_UNKNOWN); + dumpProtoAndDeserialize(); + + assertEquals(1, mDecodedProto.connectionEvent.length); + assertEquals(WifiMetricsProto.ConnectionEvent.TYPE_PASSPOINT, + mDecodedProto.connectionEvent[0].networkType); + assertTrue(mDecodedProto.connectionEvent[0].isOsuProvisioned); + } } -- cgit v1.2.3