Lines Matching refs:config

39      * Helper method to check if the provided |config| corresponds to a PSK network or not.
41 public static boolean isConfigForPskNetwork(WifiConfiguration config) {
42 return config.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.WPA_PSK);
46 * Helper method to check if the provided |config| corresponds to a EAP network or not.
48 public static boolean isConfigForEapNetwork(WifiConfiguration config) {
49 return (config.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.WPA_EAP)
50 || config.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.IEEE8021X));
54 * Helper method to check if the provided |config| corresponds to a WEP network or not.
56 public static boolean isConfigForWepNetwork(WifiConfiguration config) {
57 return (config.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.NONE)
58 && hasAnyValidWepKey(config.wepKeys));
62 * Helper method to check if the provided |config| corresponds to an open network or not.
64 public static boolean isConfigForOpenNetwork(WifiConfiguration config) {
65 return !(isConfigForWepNetwork(config) || isConfigForPskNetwork(config)
66 || isConfigForEapNetwork(config));
70 public static String getPrintableSsid(WifiConfiguration config) {
71 if (config.SSID == null) return "";
72 final int length = config.SSID.length();
73 if (length > 2 && (config.SSID.charAt(0) == '"') && config.SSID.charAt(length - 1) == '"') {
74 return config.SSID.substring(1, length - 1);
76 return config.SSID;
80 public static String removeDoubleQuotes(WifiConfiguration config) {
81 if (config.SSID == null) return null;
82 final int length = config.SSID.length();
83 if ((length > 1) && (config.SSID.charAt(0) == '"')
84 && (config.SSID.charAt(length - 1) == '"')) {
85 return config.SSID.substring(1, length - 1);
87 return config.SSID;