Remove the constant boundary for permanently disabling configs
Use the timeout value == Integer.MAX_VALUE as the signal to
permanently disabling config.
Bug: 171993750
Test: atest com.android.server.wifi
Change-Id: Icaf3485da80e870719686ef1f1ef7d8001886856
diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java
index a6bba9a..f632eea 100644
--- a/service/java/com/android/server/wifi/WifiConfigManager.java
+++ b/service/java/com/android/server/wifi/WifiConfigManager.java
@@ -1757,7 +1757,7 @@
if (reason == NetworkSelectionStatus.DISABLED_NONE) {
setNetworkSelectionEnabled(config);
setNetworkStatus(config, WifiConfiguration.Status.ENABLED);
- } else if (reason < NetworkSelectionStatus.PERMANENTLY_DISABLED_STARTING_INDEX) {
+ } else if (getNetworkSelectionDisableTimeoutMillis(reason) < Integer.MAX_VALUE) {
setNetworkSelectionTemporarilyDisabled(config, reason);
} else {
setNetworkSelectionPermanentlyDisabled(config, reason);
diff --git a/service/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java b/service/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
index 59f7dde..0bf7fc3 100644
--- a/service/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
+++ b/service/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
@@ -5434,7 +5434,8 @@
NetworkSelectionStatus.INVALID_NETWORK_SELECTION_DISABLE_TIMESTAMP,
retrievedDisableTime);
verifyUpdateNetworkStatus(retrievedNetwork, WifiConfiguration.Status.ENABLED);
- } else if (reason < NetworkSelectionStatus.PERMANENTLY_DISABLED_STARTING_INDEX) {
+ } else if (mWifiConfigManager.getNetworkSelectionDisableTimeoutMillis(reason)
+ < Integer.MAX_VALUE) {
// For temporarily disabled networks, we need to ensure that the current status remains
// until the threshold is crossed.
assertEquals(temporaryDisableReasonCounter, retrievedDisableReasonCounter);