summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorvandwalle <vandwalle@google.com>2014-05-15 14:25:18 -0700
committerPierre Vandwalle <vandwalle@google.com>2014-05-15 23:27:00 +0000
commit13f48ffab8c24d18a0a83e488a9b358a730580d4 (patch)
tree0af9f798ffed9bc7aee0cd47e62d71f87be2ea21 /wifi
parent1326cfbd419ed0bbbc433c4dca1418d7f3a1577d (diff)
downloadframeworks_base-13f48ffab8c24d18a0a83e488a9b358a730580d4.zip
frameworks_base-13f48ffab8c24d18a0a83e488a9b358a730580d4.tar.gz
frameworks_base-13f48ffab8c24d18a0a83e488a9b358a730580d4.tar.bz2
autojoin fix for devices which are using the enableNEtwork API
Bug: 15000352 Change-Id: Ib8b5dfd517e48444913f0ad0e5d08749d6eaa757
Diffstat (limited to 'wifi')
-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;
}