diff options
author | Hai Shalom <haishalom@google.com> | 2020-06-25 13:51:47 -0700 |
---|---|---|
committer | Hai Shalom <haishalom@google.com> | 2020-06-26 10:21:49 -0700 |
commit | f42caa9a7b9c6961af5b6bc75ab88c074ee6e4cc (patch) | |
tree | 356232ddfa64874c6df678f23dae6965a23e28ed /tests | |
parent | 6f1aafe2d4b979cf64ab7a5150a021f977cfed37 (diff) |
[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
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java | 26 |
1 files changed, 25 insertions, 1 deletions
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); + } } |