From 4f36f56f5aa23888db7e2e3feb70eeb4bcac12e0 Mon Sep 17 00:00:00 2001 From: xshu Date: Tue, 10 Mar 2020 13:46:56 -0700 Subject: [PATCH] CTS - feature support API for MAC randomization and PNO scans Bug: 151117962 Test: atest WifiManagerTest Change-Id: Icf2580fbea514af9d524a5f384a1b6834d1d08bb --- .../android/net/wifi/cts/WifiManagerTest.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java b/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java index e89f17566d..f4c20e3072 100644 --- a/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java +++ b/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java @@ -1422,6 +1422,39 @@ public class WifiManagerTest extends AndroidTestCase { } } + /** + * Tests {@link WifiManager#isApMacRandomizationSupported()} does not crash. + */ + public void testIsApMacRandomizationSupported() throws Exception { + if (!WifiFeature.isWifiSupported(getContext())) { + // skip the test if WiFi is not supported + return; + } + mWifiManager.isApMacRandomizationSupported(); + } + + /** + * Tests {@link WifiManager#isConnectedMacRandomizationSupported()} does not crash. + */ + public void testIsConnectedMacRandomizationSupported() throws Exception { + if (!WifiFeature.isWifiSupported(getContext())) { + // skip the test if WiFi is not supported + return; + } + mWifiManager.isConnectedMacRandomizationSupported(); + } + + /** + * Tests {@link WifiManager#isPreferredNetworkOffloadSupported()} does not crash. + */ + public void testIsPreferredNetworkOffloadSupported() throws Exception { + if (!WifiFeature.isWifiSupported(getContext())) { + // skip the test if WiFi is not supported + return; + } + mWifiManager.isPreferredNetworkOffloadSupported(); + } + private static class TestTrafficStateCallback implements WifiManager.TrafficStateCallback { private final Object mLock; public boolean onStateChangedCalled = false;