diff options
author | David Su <dysu@google.com> | 2019-10-28 17:41:51 -0700 |
---|---|---|
committer | David Su <dysu@google.com> | 2019-11-25 11:23:08 -0800 |
commit | 56c2e61f20de962dbcd743ef441086671b5001f0 (patch) | |
tree | 591c9a8051ee041a45685aeb46074e5f59dadfe2 /tests | |
parent | 45b0cbb5501b28deedd7e8ab47f54271b41f4185 (diff) |
Remove unused WifiConfiguration fields
- NetworkSelectionStatus.mNotRecommended
- userApproved
- selfAdded
These fields are no longer set by anyone, removing.
Bug: 143892601
Test: atest FrameworksWifiTests
Change-Id: Ib93b8d5ec9a6bb9a5f4fd650b5b39e7bf87eb462
Diffstat (limited to 'tests')
6 files changed, 3 insertions, 43 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/NetworkListStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/NetworkListStoreDataTest.java index 0d829d9cd..69b7017eb 100644 --- a/tests/wifitests/src/com/android/server/wifi/NetworkListStoreDataTest.java +++ b/tests/wifitests/src/com/android/server/wifi/NetworkListStoreDataTest.java @@ -46,7 +46,6 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.nio.charset.StandardCharsets; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; /** @@ -89,7 +88,6 @@ public class NetworkListStoreDataTest extends WifiBaseTest { + "<null name=\"DefaultGwMacAddress\" />\n" + "<boolean name=\"ValidatedInternetAccess\" value=\"false\" />\n" + "<boolean name=\"NoInternetAccessExpected\" value=\"false\" />\n" - + "<int name=\"UserApproved\" value=\"0\" />\n" + "<boolean name=\"MeteredHint\" value=\"false\" />\n" + "<int name=\"MeteredOverride\" value=\"2\" />\n" + "<boolean name=\"UseExternalScores\" value=\"false\" />\n" @@ -146,7 +144,6 @@ public class NetworkListStoreDataTest extends WifiBaseTest { + "<null name=\"DefaultGwMacAddress\" />\n" + "<boolean name=\"ValidatedInternetAccess\" value=\"false\" />\n" + "<boolean name=\"NoInternetAccessExpected\" value=\"false\" />\n" - + "<int name=\"UserApproved\" value=\"0\" />\n" + "<boolean name=\"MeteredHint\" value=\"false\" />\n" + "<int name=\"MeteredOverride\" value=\"0\" />\n" + "<boolean name=\"UseExternalScores\" value=\"false\" />\n" @@ -340,7 +337,7 @@ public class NetworkListStoreDataTest extends WifiBaseTest { List<WifiConfiguration> networkList = getTestNetworksConfig(true /* shared */); mNetworkListSharedStoreData.setConfigurations(networkList); byte[] expectedData = getTestNetworksXmlBytes(networkList.get(0), networkList.get(1)); - assertTrue(Arrays.equals(expectedData, serializeData())); + assertArrayEquals(expectedData, serializeData()); } /** @@ -385,7 +382,6 @@ public class NetworkListStoreDataTest extends WifiBaseTest { + "<null name=\"DefaultGwMacAddress\" />\n" + "<boolean name=\"ValidatedInternetAccess\" value=\"false\" />\n" + "<boolean name=\"NoInternetAccessExpected\" value=\"false\" />\n" - + "<int name=\"UserApproved\" value=\"0\" />\n" + "<boolean name=\"MeteredHint\" value=\"false\" />\n" + "<boolean name=\"UseExternalScores\" value=\"false\" />\n" + "<int name=\"NumAssociation\" value=\"0\" />\n" diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java index f1ea4c457..b62bb12db 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java @@ -1121,38 +1121,6 @@ public class WifiConfigManagerTest extends WifiBaseTest { result.getNetworkId(), NetworkSelectionStatus.DISABLED_AUTHENTICATION_FAILURE, 1); } - /** - * Verifies that {@link WifiConfigManager#updateNetworkNotRecommended(int, boolean)} correctly - * updates the {@link NetworkSelectionStatus#mNotRecommended} bit. - */ - @Test - public void testUpdateNetworkNotRecommended() { - WifiConfiguration openNetwork = WifiConfigurationTestUtil.createOpenNetwork(); - - NetworkUpdateResult result = verifyAddNetworkToWifiConfigManager(openNetwork); - - // First retrieve the configuration and check this it does not have this bit set - WifiConfiguration retrievedNetwork = mWifiConfigManager.getConfiguredNetwork(result.netId); - - assertFalse(retrievedNetwork.getNetworkSelectionStatus().isNotRecommended()); - - // Update the network to be not recommended; - assertTrue(mWifiConfigManager.updateNetworkNotRecommended( - result.netId, true /* notRecommended*/)); - - retrievedNetwork = mWifiConfigManager.getConfiguredNetwork(result.netId); - - assertTrue(retrievedNetwork.getNetworkSelectionStatus().isNotRecommended()); - - // Update the network to no longer be not recommended - assertTrue(mWifiConfigManager.updateNetworkNotRecommended( - result.netId, false/* notRecommended*/)); - - retrievedNetwork = mWifiConfigManager.getConfiguredNetwork(result.netId); - - assertFalse(retrievedNetwork.getNetworkSelectionStatus().isNotRecommended()); - } - private void verifyDisableNetwork(NetworkUpdateResult result, int reason) { // First set it to enabled. verifyUpdateNetworkSelectionStatus( @@ -5458,7 +5426,7 @@ public class WifiConfigManagerTest extends WifiBaseTest { NetworkSelectionStatus.INVALID_NETWORK_SELECTION_DISABLE_TIMESTAMP, retrievedDisableTime); verifyUpdateNetworkStatus(retrievedNetwork, WifiConfiguration.Status.ENABLED); - } else if (reason < NetworkSelectionStatus.DISABLED_TLS_VERSION_MISMATCH) { + } else if (reason < NetworkSelectionStatus.PERMANENTLY_DISABLED_STARTING_INDEX) { // For temporarily disabled networks, we need to ensure that the current status remains // until the threshold is crossed. assertEquals(temporaryDisableReasonCounter, retrievedDisableReasonCounter); diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreTest.java index 814dc6134..7be1d3895 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreTest.java @@ -99,7 +99,6 @@ public class WifiConfigStoreTest extends WifiBaseTest { + "<null name=\"DefaultGwMacAddress\" />\n" + "<boolean name=\"ValidatedInternetAccess\" value=\"false\" />\n" + "<boolean name=\"NoInternetAccessExpected\" value=\"false\" />\n" - + "<int name=\"UserApproved\" value=\"0\" />\n" + "<boolean name=\"MeteredHint\" value=\"false\" />\n" + "<int name=\"MeteredOverride\" value=\"0\" />\n" + "<boolean name=\"UseExternalScores\" value=\"false\" />\n" diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java index 9e2783e1b..3450f8f0d 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java @@ -586,7 +586,6 @@ public class WifiConfigurationTestUtil { assertEquals(expected.defaultGwMacAddress, actual.defaultGwMacAddress); assertEquals(expected.validatedInternetAccess, actual.validatedInternetAccess); assertEquals(expected.noInternetAccessExpected, actual.noInternetAccessExpected); - assertEquals(expected.userApproved, actual.userApproved); assertEquals(expected.meteredHint, actual.meteredHint); assertEquals(expected.meteredOverride, actual.meteredOverride); assertEquals(expected.useExternalScores, actual.useExternalScores); diff --git a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java index 7ba3dbf95..b55735f8e 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java @@ -282,7 +282,7 @@ public class WifiMetricsTest extends WifiBaseTest { + NUM_WPA3_PERSONAL_NETWORKS + NUM_WPA3_ENTERPRISE_NETWORKS; private static final int NUM_HIDDEN_NETWORKS = NUM_OPEN_NETWORKS; private static final int NUM_PASSPOINT_NETWORKS = NUM_LEGACY_ENTERPRISE_NETWORKS; - private static final int NUM_NETWORKS_ADDED_BY_USER = 1; + private static final int NUM_NETWORKS_ADDED_BY_USER = 0; private static final int NUM_NETWORKS_ADDED_BY_APPS = NUM_SAVED_NETWORKS - NUM_NETWORKS_ADDED_BY_USER; private static final boolean TEST_VAL_IS_LOCATION_ENABLED = true; @@ -523,7 +523,6 @@ public class WifiMetricsTest extends WifiBaseTest { for (int i = 0; i < NUM_WPA3_ENTERPRISE_NETWORKS; i++) { testSavedNetworks.add(WifiConfigurationTestUtil.createEapSuiteBNetwork()); } - testSavedNetworks.get(0).selfAdded = true; testSavedNetworks.get(0).macRandomizationSetting = WifiConfiguration.RANDOMIZATION_NONE; return testSavedNetworks; } diff --git a/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java b/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java index d4cdeb0cd..b0b80cbc9 100644 --- a/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java +++ b/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java @@ -228,7 +228,6 @@ public class XmlUtilTest extends WifiBaseTest { configuration.requirePMF = true; configuration.validatedInternetAccess = true; configuration.noInternetAccessExpected = true; - configuration.userApproved = WifiConfiguration.USER_UNSPECIFIED; configuration.meteredHint = true; configuration.useExternalScores = true; configuration.numAssociation = 5; |