From 67a4541372684c5d0a3f834f8be76bd8d29ca7ac Mon Sep 17 00:00:00 2001 From: Peter Qiu Date: Tue, 14 Mar 2017 11:44:49 -0700 Subject: hotspot2: ignore Passpoint networks in SavedNetworkEvaluator While there, enable the Passpoint network when it is created by PasspointNetworkEvaluator to be more consistent. Bug: 36218488 Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: I72fa55a9cb6baf71e8650e10cb54b496a7be1343 --- .../wifi/hotspot2/PasspointNetworkEvaluatorTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointNetworkEvaluatorTest.java b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointNetworkEvaluatorTest.java index 7312b3334..616e2161a 100644 --- a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointNetworkEvaluatorTest.java +++ b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointNetworkEvaluatorTest.java @@ -21,6 +21,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.any; import static org.mockito.Mockito.anyInt; +import static org.mockito.Mockito.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; @@ -195,6 +196,11 @@ public class PasspointNetworkEvaluatorTest { verify(mWifiConfigManager).addOrUpdateNetwork(addedConfig.capture(), anyInt()); assertEquals(ScanResultUtil.createQuotedSSID(TEST_SSID1), addedConfig.getValue().SSID); assertEquals(TEST_FQDN1, addedConfig.getValue().FQDN); + verify(mWifiConfigManager).enableNetwork(eq(TEST_NETWORK_ID), eq(false), anyInt()); + verify(mWifiConfigManager).setNetworkCandidateScanResult( + eq(TEST_NETWORK_ID), any(ScanResult.class), anyInt()); + verify(mWifiConfigManager).updateScanDetailForNetwork( + eq(TEST_NETWORK_ID), any(ScanDetail.class)); } /** @@ -233,6 +239,11 @@ public class PasspointNetworkEvaluatorTest { verify(mWifiConfigManager).addOrUpdateNetwork(addedConfig.capture(), anyInt()); assertEquals(ScanResultUtil.createQuotedSSID(TEST_SSID1), addedConfig.getValue().SSID); assertEquals(TEST_FQDN1, addedConfig.getValue().FQDN); + verify(mWifiConfigManager).enableNetwork(eq(TEST_NETWORK_ID), eq(false), anyInt()); + verify(mWifiConfigManager).setNetworkCandidateScanResult( + eq(TEST_NETWORK_ID), any(ScanResult.class), anyInt()); + verify(mWifiConfigManager).updateScanDetailForNetwork( + eq(TEST_NETWORK_ID), any(ScanDetail.class)); } /** @@ -275,6 +286,11 @@ public class PasspointNetworkEvaluatorTest { verify(mWifiConfigManager).addOrUpdateNetwork(addedConfig.capture(), anyInt()); assertEquals(ScanResultUtil.createQuotedSSID(TEST_SSID1), addedConfig.getValue().SSID); assertEquals(TEST_FQDN1, addedConfig.getValue().FQDN); + verify(mWifiConfigManager).enableNetwork(eq(TEST_NETWORK_ID), eq(false), anyInt()); + verify(mWifiConfigManager).setNetworkCandidateScanResult( + eq(TEST_NETWORK_ID), any(ScanResult.class), anyInt()); + verify(mWifiConfigManager).updateScanDetailForNetwork( + eq(TEST_NETWORK_ID), any(ScanDetail.class)); } /** -- cgit v1.2.3