[WPA3] Fix connectivity issues with PSK-SAE Transtion mode
Fix two reported issues regarding PSK-SAE transition mode: 1. When phone supports SAE, creating a manual saved network with PSK and manually connecting would cause the phone to connect but Settings does not display any connected AP. Phone would not autoconnect. 2. When phone doesn't support SAE, phone cannot connect to an AP in PSK-SAE Transition mode because the framework always targets the highest security. Bug: 132278271 Test: Connect to WPA2 network Test: Connect to WPA3 network (w/capable phone) Test: Connect to WPA2/3 Transition w/SAE capable phone Test: Connect to WPA2/3 Transition w/SAE not-capable phone Change-Id: I371bcb4b2cccfc8684ecb5db3a768524f7354598
This commit is contained in:
@@ -42,7 +42,6 @@ import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.FeatureFlagUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
@@ -582,6 +581,25 @@ public class WifiConfigController implements TextWatcher,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Special handling for WPA2/WPA3 in Transition mode: The key SECURITY_PSK_SAE_TRANSITION is
|
||||
* a pseudo key which results by the scan results, but never appears in the saved networks.
|
||||
* A saved network is either WPA3 for supporting devices or WPA2 for non-supporting devices.
|
||||
*
|
||||
* @param accessPointSecurity Access point current security type
|
||||
* @return Converted security type (if required)
|
||||
*/
|
||||
private int convertSecurityTypeForMatching(int accessPointSecurity) {
|
||||
if (accessPointSecurity == AccessPoint.SECURITY_PSK_SAE_TRANSITION) {
|
||||
if (mWifiManager.isWpa3SaeSupported()) {
|
||||
return AccessPoint.SECURITY_SAE;
|
||||
} else {
|
||||
return AccessPoint.SECURITY_PSK;
|
||||
}
|
||||
}
|
||||
return accessPointSecurity;
|
||||
}
|
||||
|
||||
public WifiConfiguration getConfig() {
|
||||
if (mMode == WifiConfigUiBase.MODE_VIEW) {
|
||||
return null;
|
||||
@@ -604,6 +622,8 @@ public class WifiConfigController implements TextWatcher,
|
||||
|
||||
config.shared = mSharedCheckBox.isChecked();
|
||||
|
||||
mAccessPointSecurity = convertSecurityTypeForMatching(mAccessPointSecurity);
|
||||
|
||||
switch (mAccessPointSecurity) {
|
||||
case AccessPoint.SECURITY_NONE:
|
||||
config.allowedKeyManagement.set(KeyMgmt.NONE);
|
||||
|
Reference in New Issue
Block a user