Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb4a3fc1 authored by Les Lee's avatar Les Lee Committed by Automerger Merge Worker
Browse files

Merge "wifi: Support SAE_TRANSITION when converting to WifiConfiguration" into...

Merge "wifi: Support SAE_TRANSITION when converting to WifiConfiguration" into rvc-qpr-dev am: bae844a1

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12360937

Change-Id: If25400b053a00679b5ebc28945701090468f83ad
parents 6f148d8f bae844a1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -533,6 +533,7 @@ public final class SoftApConfiguration implements Parcelable {
                wifiConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
                break;
            case SECURITY_TYPE_WPA2_PSK:
            case SECURITY_TYPE_WPA3_SAE_TRANSITION:
                wifiConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA2_PSK);
                break;
            default:
+11 −6
Original line number Diff line number Diff line
@@ -282,12 +282,6 @@ public class SoftApConfigurationTest {
                .build();

        assertNull(band_6g_config.toWifiConfiguration());
        SoftApConfiguration sae_transition_config = new SoftApConfiguration.Builder()
                .setPassphrase("secretsecret",
                        SoftApConfiguration.SECURITY_TYPE_WPA3_SAE_TRANSITION)
                .build();

        assertNull(sae_transition_config.toWifiConfiguration());
    }

    @Test
@@ -330,5 +324,16 @@ public class SoftApConfigurationTest {
        assertThat(wifiConfig_2g5g.apBand).isEqualTo(WifiConfiguration.AP_BAND_ANY);
        assertThat(wifiConfig_2g5g.apChannel).isEqualTo(0);
        assertThat(wifiConfig_2g5g.hiddenSSID).isEqualTo(true);

        SoftApConfiguration softApConfig_sae_transition = new SoftApConfiguration.Builder()
                .setPassphrase("secretsecret",
                SoftApConfiguration.SECURITY_TYPE_WPA3_SAE_TRANSITION)
                .build();

        WifiConfiguration wifiConfig_sae_transition =
                softApConfig_sae_transition.toWifiConfiguration();
        assertThat(wifiConfig_sae_transition.getAuthType())
                .isEqualTo(WifiConfiguration.KeyMgmt.WPA2_PSK);
        assertThat(wifiConfig_sae_transition.preSharedKey).isEqualTo("secretsecret");
    }
}