Loading packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java +26 −4 Original line number Diff line number Diff line Loading @@ -180,7 +180,8 @@ public class AccessPoint implements Comparable<AccessPoint> { public static final int SECURITY_SAE = 5; public static final int SECURITY_EAP_SUITE_B = 6; public static final int SECURITY_PSK_SAE_TRANSITION = 7; public static final int SECURITY_MAX_VAL = 8; // Has to be the last public static final int SECURITY_OWE_TRANSITION = 8; public static final int SECURITY_MAX_VAL = 9; // Has to be the last private static final int PSK_UNKNOWN = 0; private static final int PSK_WPA = 1; Loading Loading @@ -869,6 +870,12 @@ public class AccessPoint implements Comparable<AccessPoint> { return concise ? context.getString(R.string.wifi_security_short_sae) : context.getString(R.string.wifi_security_sae); } case SECURITY_OWE_TRANSITION: if (mConfig != null && getSecurity(mConfig) == SECURITY_OWE) { return concise ? context.getString(R.string.wifi_security_short_owe) : context.getString(R.string.wifi_security_owe); } return concise ? "" : context.getString(R.string.wifi_security_none); case SECURITY_OWE: return concise ? context.getString(R.string.wifi_security_short_owe) : context.getString(R.string.wifi_security_owe); Loading Loading @@ -1179,7 +1186,8 @@ public class AccessPoint implements Comparable<AccessPoint> { * Can only be called for unsecured networks. */ public void generateOpenNetworkConfig() { if ((security != SECURITY_NONE) && (security != SECURITY_OWE)) { if ((security != SECURITY_NONE) && (security != SECURITY_OWE) && (security != SECURITY_OWE_TRANSITION)) { throw new IllegalStateException(); } if (mConfig != null) Loading @@ -1187,7 +1195,7 @@ public class AccessPoint implements Comparable<AccessPoint> { mConfig = new WifiConfiguration(); mConfig.SSID = AccessPoint.convertToQuotedString(ssid); if (security == SECURITY_NONE) { if (security == SECURITY_NONE || !getWifiManager().isEasyConnectSupported()) { mConfig.allowedKeyManagement.set(KeyMgmt.NONE); } else { mConfig.allowedKeyManagement.set(KeyMgmt.OWE); Loading Loading @@ -1229,6 +1237,9 @@ public class AccessPoint implements Comparable<AccessPoint> { private static final String sPskSuffix = "," + String.valueOf(SECURITY_PSK); private static final String sSaeSuffix = "," + String.valueOf(SECURITY_SAE); private static final String sPskSaeSuffix = "," + String.valueOf(SECURITY_PSK_SAE_TRANSITION); private static final String sOweSuffix = "," + String.valueOf(SECURITY_OWE); private static final String sOpenSuffix = "," + String.valueOf(SECURITY_NONE); private static final String sOweTransSuffix = "," + String.valueOf(SECURITY_OWE_TRANSITION); private boolean isKeyEqual(String compareTo) { if (mKey == null) { Loading @@ -1243,6 +1254,14 @@ public class AccessPoint implements Comparable<AccessPoint> { compareTo.substring(0, compareTo.lastIndexOf(','))); } } if (compareTo.endsWith(sOpenSuffix) || compareTo.endsWith(sOweSuffix)) { if (mKey.endsWith(sOweTransSuffix)) { // Special handling for OWE/Open networks. If AP advertises OWE in transition mode // and we have an Open network saved, allow this connection to be established. return TextUtils.equals(mKey.substring(0, mKey.lastIndexOf(',')), compareTo.substring(0, compareTo.lastIndexOf(','))); } } return mKey.equals(compareTo); } Loading Loading @@ -1579,10 +1598,11 @@ public class AccessPoint implements Comparable<AccessPoint> { return SECURITY_EAP_SUITE_B; } else if (result.capabilities.contains("EAP")) { return SECURITY_EAP; } else if (result.capabilities.contains("OWE_TRANSITION")) { return SECURITY_OWE_TRANSITION; } else if (result.capabilities.contains("OWE")) { return SECURITY_OWE; } return SECURITY_NONE; } Loading Loading @@ -1628,6 +1648,8 @@ public class AccessPoint implements Comparable<AccessPoint> { return "OWE"; } else if (security == SECURITY_PSK_SAE_TRANSITION) { return "PSK+SAE"; } else if (security == SECURITY_OWE_TRANSITION) { return "OWE_TRANSITION"; } return "NONE"; } Loading packages/SettingsLib/src/com/android/settingslib/wifi/AccessPointPreference.java +2 −1 Original line number Diff line number Diff line Loading @@ -201,7 +201,8 @@ public class AccessPointPreference extends Preference { return; } if ((mAccessPoint.getSecurity() != AccessPoint.SECURITY_NONE) && (mAccessPoint.getSecurity() != AccessPoint.SECURITY_OWE)) { && (mAccessPoint.getSecurity() != AccessPoint.SECURITY_OWE) && (mAccessPoint.getSecurity() != AccessPoint.SECURITY_OWE_TRANSITION)) { mFrictionSld.setState(STATE_SECURED); } else if (mAccessPoint.isMetered()) { mFrictionSld.setState(STATE_METERED); Loading wifi/java/android/net/wifi/ScanResult.java +5 −0 Original line number Diff line number Diff line Loading @@ -158,6 +158,11 @@ public class ScanResult implements Parcelable { * Security key management scheme: FT_SAE. */ public static final int KEY_MGMT_FT_SAE = 11; /** * @hide * Security key management scheme: OWE in transition mode. */ public static final int KEY_MGMT_OWE_TRANSITION = 12; /** * @hide * No cipher suite. Loading Loading
packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java +26 −4 Original line number Diff line number Diff line Loading @@ -180,7 +180,8 @@ public class AccessPoint implements Comparable<AccessPoint> { public static final int SECURITY_SAE = 5; public static final int SECURITY_EAP_SUITE_B = 6; public static final int SECURITY_PSK_SAE_TRANSITION = 7; public static final int SECURITY_MAX_VAL = 8; // Has to be the last public static final int SECURITY_OWE_TRANSITION = 8; public static final int SECURITY_MAX_VAL = 9; // Has to be the last private static final int PSK_UNKNOWN = 0; private static final int PSK_WPA = 1; Loading Loading @@ -869,6 +870,12 @@ public class AccessPoint implements Comparable<AccessPoint> { return concise ? context.getString(R.string.wifi_security_short_sae) : context.getString(R.string.wifi_security_sae); } case SECURITY_OWE_TRANSITION: if (mConfig != null && getSecurity(mConfig) == SECURITY_OWE) { return concise ? context.getString(R.string.wifi_security_short_owe) : context.getString(R.string.wifi_security_owe); } return concise ? "" : context.getString(R.string.wifi_security_none); case SECURITY_OWE: return concise ? context.getString(R.string.wifi_security_short_owe) : context.getString(R.string.wifi_security_owe); Loading Loading @@ -1179,7 +1186,8 @@ public class AccessPoint implements Comparable<AccessPoint> { * Can only be called for unsecured networks. */ public void generateOpenNetworkConfig() { if ((security != SECURITY_NONE) && (security != SECURITY_OWE)) { if ((security != SECURITY_NONE) && (security != SECURITY_OWE) && (security != SECURITY_OWE_TRANSITION)) { throw new IllegalStateException(); } if (mConfig != null) Loading @@ -1187,7 +1195,7 @@ public class AccessPoint implements Comparable<AccessPoint> { mConfig = new WifiConfiguration(); mConfig.SSID = AccessPoint.convertToQuotedString(ssid); if (security == SECURITY_NONE) { if (security == SECURITY_NONE || !getWifiManager().isEasyConnectSupported()) { mConfig.allowedKeyManagement.set(KeyMgmt.NONE); } else { mConfig.allowedKeyManagement.set(KeyMgmt.OWE); Loading Loading @@ -1229,6 +1237,9 @@ public class AccessPoint implements Comparable<AccessPoint> { private static final String sPskSuffix = "," + String.valueOf(SECURITY_PSK); private static final String sSaeSuffix = "," + String.valueOf(SECURITY_SAE); private static final String sPskSaeSuffix = "," + String.valueOf(SECURITY_PSK_SAE_TRANSITION); private static final String sOweSuffix = "," + String.valueOf(SECURITY_OWE); private static final String sOpenSuffix = "," + String.valueOf(SECURITY_NONE); private static final String sOweTransSuffix = "," + String.valueOf(SECURITY_OWE_TRANSITION); private boolean isKeyEqual(String compareTo) { if (mKey == null) { Loading @@ -1243,6 +1254,14 @@ public class AccessPoint implements Comparable<AccessPoint> { compareTo.substring(0, compareTo.lastIndexOf(','))); } } if (compareTo.endsWith(sOpenSuffix) || compareTo.endsWith(sOweSuffix)) { if (mKey.endsWith(sOweTransSuffix)) { // Special handling for OWE/Open networks. If AP advertises OWE in transition mode // and we have an Open network saved, allow this connection to be established. return TextUtils.equals(mKey.substring(0, mKey.lastIndexOf(',')), compareTo.substring(0, compareTo.lastIndexOf(','))); } } return mKey.equals(compareTo); } Loading Loading @@ -1579,10 +1598,11 @@ public class AccessPoint implements Comparable<AccessPoint> { return SECURITY_EAP_SUITE_B; } else if (result.capabilities.contains("EAP")) { return SECURITY_EAP; } else if (result.capabilities.contains("OWE_TRANSITION")) { return SECURITY_OWE_TRANSITION; } else if (result.capabilities.contains("OWE")) { return SECURITY_OWE; } return SECURITY_NONE; } Loading Loading @@ -1628,6 +1648,8 @@ public class AccessPoint implements Comparable<AccessPoint> { return "OWE"; } else if (security == SECURITY_PSK_SAE_TRANSITION) { return "PSK+SAE"; } else if (security == SECURITY_OWE_TRANSITION) { return "OWE_TRANSITION"; } return "NONE"; } Loading
packages/SettingsLib/src/com/android/settingslib/wifi/AccessPointPreference.java +2 −1 Original line number Diff line number Diff line Loading @@ -201,7 +201,8 @@ public class AccessPointPreference extends Preference { return; } if ((mAccessPoint.getSecurity() != AccessPoint.SECURITY_NONE) && (mAccessPoint.getSecurity() != AccessPoint.SECURITY_OWE)) { && (mAccessPoint.getSecurity() != AccessPoint.SECURITY_OWE) && (mAccessPoint.getSecurity() != AccessPoint.SECURITY_OWE_TRANSITION)) { mFrictionSld.setState(STATE_SECURED); } else if (mAccessPoint.isMetered()) { mFrictionSld.setState(STATE_METERED); Loading
wifi/java/android/net/wifi/ScanResult.java +5 −0 Original line number Diff line number Diff line Loading @@ -158,6 +158,11 @@ public class ScanResult implements Parcelable { * Security key management scheme: FT_SAE. */ public static final int KEY_MGMT_FT_SAE = 11; /** * @hide * Security key management scheme: OWE in transition mode. */ public static final int KEY_MGMT_OWE_TRANSITION = 12; /** * @hide * No cipher suite. Loading