summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--service/java/com/android/server/wifi/ClientModeImpl.java3
-rw-r--r--service/java/com/android/server/wifi/WifiConfigManager.java28
-rw-r--r--service/java/com/android/server/wifi/WifiMetrics.java6
-rw-r--r--service/java/com/android/server/wifi/util/XmlUtil.java5
-rw-r--r--tests/wifitests/src/com/android/server/wifi/NetworkListStoreDataTest.java6
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java34
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiConfigStoreTest.java1
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java1
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java3
-rw-r--r--tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java1
10 files changed, 5 insertions, 83 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java
index 0a9039a6b..6c4f0e375 100644
--- a/service/java/com/android/server/wifi/ClientModeImpl.java
+++ b/service/java/com/android/server/wifi/ClientModeImpl.java
@@ -1828,9 +1828,6 @@ public class ClientModeImpl extends StateMachine {
if (config.ephemeral) {
sb.append(" ephemeral");
}
- if (config.selfAdded) {
- sb.append(" selfAdded");
- }
sb.append(" cuid=").append(config.creatorUid);
sb.append(" suid=").append(config.lastUpdateUid);
}
diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java
index 97962dd95..b76157828 100644
--- a/service/java/com/android/server/wifi/WifiConfigManager.java
+++ b/service/java/com/android/server/wifi/WifiConfigManager.java
@@ -1755,7 +1755,7 @@ public class WifiConfigManager {
if (reason == NetworkSelectionStatus.NETWORK_SELECTION_ENABLE) {
setNetworkSelectionEnabled(config);
setNetworkStatus(config, WifiConfiguration.Status.ENABLED);
- } else if (reason < NetworkSelectionStatus.DISABLED_TLS_VERSION_MISMATCH) {
+ } else if (reason < NetworkSelectionStatus.PERMANENTLY_DISABLED_STARTING_INDEX) {
setNetworkSelectionTemporarilyDisabled(config, reason);
} else {
setNetworkSelectionPermanentlyDisabled(config, reason);
@@ -1839,28 +1839,6 @@ public class WifiConfigManager {
}
/**
- * Update whether a network is currently not recommended by {@link RecommendedNetworkEvaluator}.
- *
- * @param networkId network ID of the network to be updated
- * @param notRecommended whether this network is not recommended
- * @return true if the network is updated, false otherwise
- */
- public boolean updateNetworkNotRecommended(int networkId, boolean notRecommended) {
- WifiConfiguration config = getInternalConfiguredNetwork(networkId);
- if (config == null) {
- return false;
- }
-
- config.getNetworkSelectionStatus().setNotRecommended(notRecommended);
- if (mVerboseLoggingEnabled) {
- localLog("updateNetworkRecommendation: configKey=" + config.configKey()
- + " notRecommended=" + notRecommended);
- }
- saveToStore(false);
- return true;
- }
-
- /**
* Attempt to re-enable a network for network selection, if this network was either:
* a) Previously temporarily disabled, but its disable timeout has expired, or
* b) Previously disabled because of a user switch, but is now visible to the current
@@ -1891,10 +1869,6 @@ public class WifiConfigManager {
return updateNetworkSelectionStatus(
config, NetworkSelectionStatus.NETWORK_SELECTION_ENABLE);
}
- } else if (networkStatus.isDisabledByReason(
- NetworkSelectionStatus.DISABLED_DUE_TO_USER_SWITCH)) {
- return updateNetworkSelectionStatus(
- config, NetworkSelectionStatus.NETWORK_SELECTION_ENABLE);
}
return false;
}
diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java
index 321958485..0a753e731 100644
--- a/service/java/com/android/server/wifi/WifiMetrics.java
+++ b/service/java/com/android/server/wifi/WifiMetrics.java
@@ -2933,11 +2933,7 @@ public class WifiMetrics {
mWifiLogProto.numLegacyPersonalNetworks++;
}
}
- if (config.selfAdded) {
- mWifiLogProto.numNetworksAddedByUser++;
- } else {
- mWifiLogProto.numNetworksAddedByApps++;
- }
+ mWifiLogProto.numNetworksAddedByApps++;
if (config.hiddenSSID) {
mWifiLogProto.numHiddenNetworks++;
}
diff --git a/service/java/com/android/server/wifi/util/XmlUtil.java b/service/java/com/android/server/wifi/util/XmlUtil.java
index a80aa5f4c..cf132ca70 100644
--- a/service/java/com/android/server/wifi/util/XmlUtil.java
+++ b/service/java/com/android/server/wifi/util/XmlUtil.java
@@ -337,7 +337,6 @@ public class XmlUtil {
public static final String XML_TAG_DEFAULT_GW_MAC_ADDRESS = "DefaultGwMacAddress";
public static final String XML_TAG_VALIDATED_INTERNET_ACCESS = "ValidatedInternetAccess";
public static final String XML_TAG_NO_INTERNET_ACCESS_EXPECTED = "NoInternetAccessExpected";
- public static final String XML_TAG_USER_APPROVED = "UserApproved";
public static final String XML_TAG_METERED_HINT = "MeteredHint";
public static final String XML_TAG_METERED_OVERRIDE = "MeteredOverride";
public static final String XML_TAG_USE_EXTERNAL_SCORES = "UseExternalScores";
@@ -497,7 +496,6 @@ public class XmlUtil {
XmlUtil.writeNextValue(
out, XML_TAG_NO_INTERNET_ACCESS_EXPECTED,
configuration.noInternetAccessExpected);
- XmlUtil.writeNextValue(out, XML_TAG_USER_APPROVED, configuration.userApproved);
XmlUtil.writeNextValue(out, XML_TAG_METERED_HINT, configuration.meteredHint);
XmlUtil.writeNextValue(out, XML_TAG_METERED_OVERRIDE, configuration.meteredOverride);
XmlUtil.writeNextValue(
@@ -665,9 +663,6 @@ public class XmlUtil {
case XML_TAG_NO_INTERNET_ACCESS_EXPECTED:
configuration.noInternetAccessExpected = (boolean) value;
break;
- case XML_TAG_USER_APPROVED:
- configuration.userApproved = (int) value;
- break;
case XML_TAG_METERED_HINT:
configuration.meteredHint = (boolean) value;
break;
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;