summaryrefslogtreecommitdiffstats
path: root/wifi/java/android/net/wifi/SupplicantState.java
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2011-05-27 12:10:55 -0700
committerIrfan Sheriff <isheriff@google.com>2011-06-02 11:18:00 -0700
commit319da8c4c59be36fe2e221a0aba230ef6b77a14f (patch)
treea752f9f7b46abfeb020397523b121270a90de153 /wifi/java/android/net/wifi/SupplicantState.java
parent6c2cb3061d031b5d8ccc095ecc038959d4489709 (diff)
downloadframeworks_base-319da8c4c59be36fe2e221a0aba230ef6b77a14f.zip
frameworks_base-319da8c4c59be36fe2e221a0aba230ef6b77a14f.tar.gz
frameworks_base-319da8c4c59be36fe2e221a0aba230ef6b77a14f.tar.bz2
Add new states to support wpa_supplicant 0.8
Latest supplicant introduces the INTERFACE_DISABLED state. This is entered when the interface is brought down (which is effectively done by us and tracked already through the driver stop operation) Also, added is a state for tracking authentication when supplicant acts as the SME Change-Id: I76090068d0ebba6df76f16707da559fcbd7512c5
Diffstat (limited to 'wifi/java/android/net/wifi/SupplicantState.java')
-rw-r--r--wifi/java/android/net/wifi/SupplicantState.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/wifi/java/android/net/wifi/SupplicantState.java b/wifi/java/android/net/wifi/SupplicantState.java
index 6b79210..91e685f 100644
--- a/wifi/java/android/net/wifi/SupplicantState.java
+++ b/wifi/java/android/net/wifi/SupplicantState.java
@@ -39,6 +39,15 @@ public enum SupplicantState implements Parcelable {
DISCONNECTED,
/**
+ * Interface is disabled
+ * <p/>
+ * This state is entered if the network interface is disabled.
+ * wpa_supplicant refuses any new operations that would
+ * use the radio until the interface has been enabled.
+ */
+ INTERFACE_DISABLED,
+
+ /**
* Inactive state (wpa_supplicant disabled).
* <p/>
* This state is entered if there are no enabled networks in the
@@ -57,6 +66,15 @@ public enum SupplicantState implements Parcelable {
SCANNING,
/**
+ * Trying to authenticate with a BSS/SSID
+ * <p/>
+ * This state is entered when wpa_supplicant has found a suitable BSS
+ * to authenticate with and the driver is configured to try to
+ * authenticate with this BSS.
+ */
+ AUTHENTICATING,
+
+ /**
* Trying to associate with a BSS/SSID.
* <p/>
* This state is entered when wpa_supplicant has found a suitable BSS
@@ -152,8 +170,33 @@ public enum SupplicantState implements Parcelable {
return state != UNINITIALIZED && state != INVALID;
}
+
+ /* Supplicant associating or authenticating is considered a handshake state */
+ static boolean isHandshakeState(SupplicantState state) {
+ switch(state) {
+ case AUTHENTICATING:
+ case ASSOCIATING:
+ case ASSOCIATED:
+ case FOUR_WAY_HANDSHAKE:
+ case GROUP_HANDSHAKE:
+ return true;
+ case COMPLETED:
+ case DISCONNECTED:
+ case INTERFACE_DISABLED:
+ case INACTIVE:
+ case SCANNING:
+ case DORMANT:
+ case UNINITIALIZED:
+ case INVALID:
+ return false;
+ default:
+ throw new IllegalArgumentException("Unknown supplicant state");
+ }
+ }
+
static boolean isConnecting(SupplicantState state) {
switch(state) {
+ case AUTHENTICATING:
case ASSOCIATING:
case ASSOCIATED:
case FOUR_WAY_HANDSHAKE:
@@ -161,6 +204,7 @@ public enum SupplicantState implements Parcelable {
case COMPLETED:
return true;
case DISCONNECTED:
+ case INTERFACE_DISABLED:
case INACTIVE:
case SCANNING:
case DORMANT: