summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvandwalle <vandwalle@google.com>2014-05-16 00:21:28 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-05-16 00:21:29 +0000
commit6c536eac59adf6e11694ba3800222ad03fe93d1f (patch)
tree323ca9ee6d8d6d4513a60698c591c48b3b86154f
parent9f297023611a2e1d65b8bd0c729abda6988ac114 (diff)
parent13f48ffab8c24d18a0a83e488a9b358a730580d4 (diff)
downloadframeworks_base-6c536eac59adf6e11694ba3800222ad03fe93d1f.zip
frameworks_base-6c536eac59adf6e11694ba3800222ad03fe93d1f.tar.gz
frameworks_base-6c536eac59adf6e11694ba3800222ad03fe93d1f.tar.bz2
Merge "autojoin fix for devices which are using the enableNEtwork API"
-rw-r--r--wifi/java/android/net/wifi/WifiConfiguration.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java
index f22e8a9..e73cce1 100644
--- a/wifi/java/android/net/wifi/WifiConfiguration.java
+++ b/wifi/java/android/net/wifi/WifiConfiguration.java
@@ -802,8 +802,28 @@ public class WifiConfiguration implements Parcelable {
return configKey(false);
}
+ /** @hide
+ * return the config key string based on a scan result
+ */
+ static public String configKey(ScanResult result) {
+ String key = "\"" + result.SSID + "\"";
+
+ if (result.capabilities.contains("WEP")) {
+ key = key + "-WEP";
+ }
+
+ if (result.capabilities.contains("PSK")) {
+ key = key + "-" + KeyMgmt.strings[KeyMgmt.WPA_PSK];
+ }
- /** Implement the Parcelable interface {@hide} */
+ if (result.capabilities.contains("EAP")) {
+ key = key + "-" + KeyMgmt.strings[KeyMgmt.WPA_EAP];
+ }
+
+ return key;
+ }
+
+ /** Implement the Parcelable interface {@hide} */
public int describeContents() {
return 0;
}