From 13f48ffab8c24d18a0a83e488a9b358a730580d4 Mon Sep 17 00:00:00 2001 From: vandwalle Date: Thu, 15 May 2014 14:25:18 -0700 Subject: autojoin fix for devices which are using the enableNEtwork API Bug: 15000352 Change-Id: Ib8b5dfd517e48444913f0ad0e5d08749d6eaa757 --- wifi/java/android/net/wifi/WifiConfiguration.java | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'wifi') 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; } -- cgit v1.1