diff options
author | Isaac Chiou <isaacchiou@google.com> | 2020-09-16 14:48:09 +0800 |
---|---|---|
committer | Isaac Chiou <isaacchiou@google.com> | 2020-12-10 20:26:30 +0800 |
commit | 48b6f8616fbc08825837ea420456cf17871dcd20 (patch) | |
tree | 5bc66b5624c547f8016a93075c3989a7c97a4aa0 /wifi | |
parent | ea748be0c9ff5f3a132a6c37755c5d867c1bc8a5 (diff) |
Wifi: Disable network when detecting carrier eap error
Disable network temporarily when detecting carrier eap error
Bug: 148940011
Test: atest FrameworksWifiTests
Test: make sure network can be disabled when detecting carrier eap error
Change-Id: Ide5f8b2a084ce3d72b6ba820393b9fb9b22aff0f
Diffstat (limited to 'wifi')
-rw-r--r-- | wifi/api/system-current.txt | 2 | ||||
-rw-r--r-- | wifi/java/android/net/wifi/WifiConfiguration.java | 32 |
2 files changed, 30 insertions, 4 deletions
diff --git a/wifi/api/system-current.txt b/wifi/api/system-current.txt index eba744330a2e..5a4a88645f01 100644 --- a/wifi/api/system-current.txt +++ b/wifi/api/system-current.txt @@ -393,6 +393,8 @@ package android.net.wifi { method @Deprecated public boolean hasEverConnected(); field @Deprecated public static final int DISABLED_ASSOCIATION_REJECTION = 1; // 0x1 field @Deprecated public static final int DISABLED_AUTHENTICATION_FAILURE = 2; // 0x2 + field @Deprecated public static final int DISABLED_AUTHENTICATION_FAILURE_CARRIER_SPECIFIC = 10; // 0xa + field @Deprecated public static final int DISABLED_AUTHENTICATION_FAILURE_GENERIC = 2; // 0x2 field @Deprecated public static final int DISABLED_AUTHENTICATION_NO_CREDENTIALS = 5; // 0x5 field @Deprecated public static final int DISABLED_AUTHENTICATION_NO_SUBSCRIPTION = 9; // 0x9 field @Deprecated public static final int DISABLED_BY_WIFI_MANAGER = 7; // 0x7 diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java index 271a73943425..0009eced1295 100644 --- a/wifi/java/android/net/wifi/WifiConfiguration.java +++ b/wifi/java/android/net/wifi/WifiConfiguration.java @@ -1388,7 +1388,9 @@ public class WifiConfiguration implements Parcelable { DISABLED_NO_INTERNET_PERMANENT, DISABLED_BY_WIFI_MANAGER, DISABLED_BY_WRONG_PASSWORD, - DISABLED_AUTHENTICATION_NO_SUBSCRIPTION}) + DISABLED_AUTHENTICATION_NO_SUBSCRIPTION, + DISABLED_AUTHENTICATION_FAILURE_GENERIC, + DISABLED_AUTHENTICATION_FAILURE_CARRIER_SPECIFIC}) public @interface NetworkSelectionDisableReason {} // Quality Network disabled reasons @@ -1401,8 +1403,16 @@ public class WifiConfiguration implements Parcelable { public static final int NETWORK_SELECTION_DISABLED_STARTING_INDEX = 1; /** This network is temporarily disabled because of multiple association rejections. */ public static final int DISABLED_ASSOCIATION_REJECTION = 1; - /** This network is temporarily disabled because of multiple authentication failure. */ - public static final int DISABLED_AUTHENTICATION_FAILURE = 2; + /** This network is disabled due to generic authentication failure. */ + public static final int DISABLED_AUTHENTICATION_FAILURE_GENERIC = 2; + /** Separate DISABLED_AUTHENTICATION_FAILURE into DISABLED_AUTHENTICATION_FAILURE_GENERIC + * and DISABLED_AUTHENTICATION_FAILURE_CARRIER_SPECIFIC + * @deprecated Use the {@link #DISABLED_AUTHENTICATION_FAILURE_GENERIC} constant + * (which is the same value). + */ + @Deprecated + public static final int DISABLED_AUTHENTICATION_FAILURE = + DISABLED_AUTHENTICATION_FAILURE_GENERIC; /** This network is temporarily disabled because of multiple DHCP failure. */ public static final int DISABLED_DHCP_FAILURE = 3; /** This network is temporarily disabled because it has no Internet access. */ @@ -1420,11 +1430,13 @@ public class WifiConfiguration implements Parcelable { public static final int DISABLED_BY_WRONG_PASSWORD = 8; /** This network is permanently disabled because service is not subscribed. */ public static final int DISABLED_AUTHENTICATION_NO_SUBSCRIPTION = 9; + /** This network is disabled due to carrier specific EAP failure. */ + public static final int DISABLED_AUTHENTICATION_FAILURE_CARRIER_SPECIFIC = 10; /** * All other disable reasons should be strictly less than this value. * @hide */ - public static final int NETWORK_SELECTION_DISABLED_MAX = 10; + public static final int NETWORK_SELECTION_DISABLED_MAX = 11; /** * Get an integer that is equal to the maximum integer value of all the @@ -1564,6 +1576,18 @@ public class WifiConfiguration implements Parcelable { 1, Integer.MAX_VALUE)); + reasons.append(DISABLED_AUTHENTICATION_FAILURE_GENERIC, + new DisableReasonInfo( + "NETWORK_SELECTION_DISABLED_AUTHENTICATION_FAILURE_GENERIC", + 5, + 5 * 60 * 1000)); + + reasons.append(DISABLED_AUTHENTICATION_FAILURE_CARRIER_SPECIFIC, + new DisableReasonInfo( + "NETWORK_SELECTION_DISABLED_AUTHENTICATION_FAILURE_CARRIER_SPECIFIC", + 1, + Integer.MAX_VALUE)); + return reasons; } |