From 4352b9988dd2280928e11fe2ab9de0f676fc9c29 Mon Sep 17 00:00:00 2001 From: Sohani Rao Date: Mon, 6 Feb 2017 14:02:17 -0800 Subject: Introduce Authentication Failure reason codes In order to differentiate between various reasons for authentication failure, add reason codes. These will be hidden since we don't intend to have API change. Bug: 33245941 Test: Unit test Change-Id: I7222520df18e54d684ba9e50ff95be5d46a7d70c --- wifi/java/android/net/wifi/WifiManager.java | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java index 824c436ac9fd..b79ecdd40d90 100644 --- a/wifi/java/android/net/wifi/WifiManager.java +++ b/wifi/java/android/net/wifi/WifiManager.java @@ -81,6 +81,34 @@ public class WifiManager { */ public static final int ERROR_AUTHENTICATING = 1; + /** + * The reason code if there is no error during authentication. + * It could also imply that there no authentication in progress, + * this reason code also serves as a reset value. + * @hide + */ + public static final int ERROR_AUTH_FAILURE_NONE = 0; + + /** + * The reason code if there was a timeout authenticating. + * @hide + */ + public static final int ERROR_AUTH_FAILURE_TIMEOUT = 1; + + /** + * The reason code if there was a wrong password while + * authenticating. + * @hide + */ + public static final int ERROR_AUTH_FAILURE_WRONG_PSWD = 2; + + /** + * The reason code if there was EAP failure while + * authenticating. + * @hide + */ + public static final int ERROR_AUTH_FAILURE_EAP_FAILURE = 3; + /** * Broadcast intent action indicating whether Wi-Fi scanning is allowed currently * @hide @@ -496,6 +524,16 @@ public class WifiManager { */ public static final String EXTRA_SUPPLICANT_ERROR = "supplicantError"; + /** + * The lookup key for a {@link SupplicantState} describing the supplicant + * error reason if any + * Retrieve with + * {@link android.content.Intent#getIntExtra(String, int)}. + * @see #ERROR_AUTH_FAILURE_#REASON_CODE + * @hide + */ + public static final String EXTRA_SUPPLICANT_ERROR_REASON = "supplicantErrorReason"; + /** * Broadcast intent action indicating that the configured networks changed. * This can be as a result of adding/updating/deleting a network. If -- cgit v1.2.3-59-g8ed1b