summaryrefslogtreecommitdiffstats
path: root/wifi/java
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2011-02-17 11:49:57 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-02-17 11:49:57 -0800
commit7cb0d07fcf03150ecd04cc5c2573923dae72a366 (patch)
tree5a2b2a5aa59e85b104113ccdda73870505ac306d /wifi/java
parentf653aa7e6e4d79dae191596551bfb5df4df6d6e5 (diff)
parentec8d23af7372204f068aebaa1bfae87dc9260e23 (diff)
downloadframeworks_base-7cb0d07fcf03150ecd04cc5c2573923dae72a366.zip
frameworks_base-7cb0d07fcf03150ecd04cc5c2573923dae72a366.tar.gz
frameworks_base-7cb0d07fcf03150ecd04cc5c2573923dae72a366.tar.bz2
Merge "Add WPA support for soft Ap"
Diffstat (limited to 'wifi/java')
-rw-r--r--wifi/java/android/net/wifi/WifiConfiguration.java23
1 files changed, 22 insertions, 1 deletions
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java
index d5fb63e..28a5bc6 100644
--- a/wifi/java/android/net/wifi/WifiConfiguration.java
+++ b/wifi/java/android/net/wifi/WifiConfiguration.java
@@ -107,9 +107,16 @@ public class WifiConfiguration implements Parcelable {
* generated WEP keys. */
public static final int IEEE8021X = 3;
+ /** WPA2 pre-shared key for use with soft access point
+ * (requires {@code preSharedKey} to be specified).
+ * @hide
+ */
+ public static final int WPA2_PSK = 4;
+
public static final String varName = "key_mgmt";
- public static final String[] strings = { "NONE", "WPA_PSK", "WPA_EAP", "IEEE8021X" };
+ public static final String[] strings = { "NONE", "WPA_PSK", "WPA_EAP", "IEEE8021X",
+ "WPA2_PSK" };
}
/**
@@ -480,6 +487,20 @@ public class WifiConfiguration implements Parcelable {
dest.writeInt(nextSetBit);
}
+ /** @hide */
+ public int getAuthType() {
+ if (allowedKeyManagement.get(KeyMgmt.WPA_PSK)) {
+ return KeyMgmt.WPA_PSK;
+ } else if (allowedKeyManagement.get(KeyMgmt.WPA2_PSK)) {
+ return KeyMgmt.WPA2_PSK;
+ } else if (allowedKeyManagement.get(KeyMgmt.WPA_EAP)) {
+ return KeyMgmt.WPA_EAP;
+ } else if (allowedKeyManagement.get(KeyMgmt.IEEE8021X)) {
+ return KeyMgmt.IEEE8021X;
+ }
+ return KeyMgmt.NONE;
+ }
+
/** Implement the Parcelable interface {@hide} */
public int describeContents() {
return 0;