Loading packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java +4 −1 Original line number Diff line number Diff line Loading @@ -1766,7 +1766,10 @@ public class AccessPoint implements Comparable<AccessPoint> { if (config.allowedKeyManagement.get(KeyMgmt.OWE)) { return SECURITY_OWE; } return (config.wepKeys[0] != null) ? SECURITY_WEP : SECURITY_NONE; return (config.wepTxKeyIndex >= 0 && config.wepTxKeyIndex < config.wepKeys.length && config.wepKeys[config.wepTxKeyIndex] != null) ? SECURITY_WEP : SECURITY_NONE; } public static String securityToString(int security, int pskType) { Loading wifi/java/android/net/wifi/WifiConfiguration.java +2 −1 Original line number Diff line number Diff line Loading @@ -2428,7 +2428,8 @@ public class WifiConfiguration implements Parcelable { } else if (allowedKeyManagement.get(KeyMgmt.WPA_EAP) || allowedKeyManagement.get(KeyMgmt.IEEE8021X)) { key = SSID + KeyMgmt.strings[KeyMgmt.WPA_EAP]; } else if (wepKeys[0] != null) { } else if (wepTxKeyIndex >= 0 && wepTxKeyIndex < wepKeys.length && wepKeys[wepTxKeyIndex] != null) { key = SSID + "WEP"; } else if (allowedKeyManagement.get(KeyMgmt.OWE)) { key = SSID + KeyMgmt.strings[KeyMgmt.OWE]; Loading wifi/tests/src/android/net/wifi/WifiConfigurationTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -270,7 +270,23 @@ public class WifiConfigurationTest { config.allowedKeyManagement.clear(); assertEquals(mSsid + "WEP", config.getSsidAndSecurityTypeString()); // set WEP key and give a valid index. config.wepKeys[0] = null; config.wepKeys[2] = "TestWep"; config.wepTxKeyIndex = 2; config.allowedKeyManagement.clear(); assertEquals(mSsid + "WEP", config.getSsidAndSecurityTypeString()); // set WEP key but does not give a valid index. config.wepKeys[0] = null; config.wepKeys[2] = "TestWep"; config.wepTxKeyIndex = 0; config.allowedKeyManagement.clear(); config.allowedKeyManagement.set(KeyMgmt.OWE); assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.OWE], config.getSsidAndSecurityTypeString()); config.wepKeys[0] = null; config.wepTxKeyIndex = 0; config.allowedKeyManagement.clear(); config.allowedKeyManagement.set(KeyMgmt.OWE); assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.OWE], config.getSsidAndSecurityTypeString()); Loading Loading
packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java +4 −1 Original line number Diff line number Diff line Loading @@ -1766,7 +1766,10 @@ public class AccessPoint implements Comparable<AccessPoint> { if (config.allowedKeyManagement.get(KeyMgmt.OWE)) { return SECURITY_OWE; } return (config.wepKeys[0] != null) ? SECURITY_WEP : SECURITY_NONE; return (config.wepTxKeyIndex >= 0 && config.wepTxKeyIndex < config.wepKeys.length && config.wepKeys[config.wepTxKeyIndex] != null) ? SECURITY_WEP : SECURITY_NONE; } public static String securityToString(int security, int pskType) { Loading
wifi/java/android/net/wifi/WifiConfiguration.java +2 −1 Original line number Diff line number Diff line Loading @@ -2428,7 +2428,8 @@ public class WifiConfiguration implements Parcelable { } else if (allowedKeyManagement.get(KeyMgmt.WPA_EAP) || allowedKeyManagement.get(KeyMgmt.IEEE8021X)) { key = SSID + KeyMgmt.strings[KeyMgmt.WPA_EAP]; } else if (wepKeys[0] != null) { } else if (wepTxKeyIndex >= 0 && wepTxKeyIndex < wepKeys.length && wepKeys[wepTxKeyIndex] != null) { key = SSID + "WEP"; } else if (allowedKeyManagement.get(KeyMgmt.OWE)) { key = SSID + KeyMgmt.strings[KeyMgmt.OWE]; Loading
wifi/tests/src/android/net/wifi/WifiConfigurationTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -270,7 +270,23 @@ public class WifiConfigurationTest { config.allowedKeyManagement.clear(); assertEquals(mSsid + "WEP", config.getSsidAndSecurityTypeString()); // set WEP key and give a valid index. config.wepKeys[0] = null; config.wepKeys[2] = "TestWep"; config.wepTxKeyIndex = 2; config.allowedKeyManagement.clear(); assertEquals(mSsid + "WEP", config.getSsidAndSecurityTypeString()); // set WEP key but does not give a valid index. config.wepKeys[0] = null; config.wepKeys[2] = "TestWep"; config.wepTxKeyIndex = 0; config.allowedKeyManagement.clear(); config.allowedKeyManagement.set(KeyMgmt.OWE); assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.OWE], config.getSsidAndSecurityTypeString()); config.wepKeys[0] = null; config.wepTxKeyIndex = 0; config.allowedKeyManagement.clear(); config.allowedKeyManagement.set(KeyMgmt.OWE); assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.OWE], config.getSsidAndSecurityTypeString()); Loading