Loading src/com/android/settings/wifi/repository/WifiHotspotRepository.java +17 −9 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static android.net.wifi.SoftApConfiguration.BAND_5GHZ; import static android.net.wifi.SoftApConfiguration.BAND_6GHZ; import static android.net.wifi.SoftApConfiguration.SECURITY_TYPE_OPEN; import static android.net.wifi.SoftApConfiguration.SECURITY_TYPE_WPA3_SAE; import static android.net.wifi.SoftApConfiguration.SECURITY_TYPE_WPA3_SAE_TRANSITION; import static android.net.wifi.WifiAvailableChannel.OP_MODE_SAP; import static android.net.wifi.WifiManager.WIFI_AP_STATE_DISABLED; import static android.net.wifi.WifiManager.WIFI_AP_STATE_ENABLED; Loading Loading @@ -343,7 +344,8 @@ public class WifiHotspotRepository { log("setSpeedType(), setPassphrase(SECURITY_TYPE_WPA3_SAE)"); configBuilder.setPassphrase(generatePassword(config), SECURITY_TYPE_WPA3_SAE); } } else if (speedType == SPEED_5GHZ) { } else { if (speedType == SPEED_5GHZ) { log("setSpeedType(), setBand(BAND_2GHZ_5GHZ)"); configBuilder.setBand(BAND_2GHZ_5GHZ); } else if (mIsDualBand) { Loading @@ -354,6 +356,12 @@ public class WifiHotspotRepository { log("setSpeedType(), setBand(BAND_2GHZ)"); configBuilder.setBand(BAND_2GHZ); } // Set the security type back to WPA2/WPA3 if we're moving from 6GHz to something else. if ((config.getBand() & BAND_6GHZ) != 0) { configBuilder.setPassphrase( generatePassword(config), SECURITY_TYPE_WPA3_SAE_TRANSITION); } } setSoftApConfiguration(configBuilder.build()); } Loading tests/unit/src/com/android/settings/wifi/repository/WifiHotspotRepositoryTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -497,6 +497,8 @@ public class WifiHotspotRepositoryTest { SparseIntArray channels = mSoftApConfigCaptor.getValue().getChannels(); assertThat(channels.get(BAND_2GHZ, CHANNEL_NOT_FOUND)).isNotEqualTo(CHANNEL_NOT_FOUND); assertThat(channels.get(BAND_2GHZ_5GHZ, CHANNEL_NOT_FOUND)).isNotEqualTo(CHANNEL_NOT_FOUND); assertThat(mSoftApConfigCaptor.getValue().getSecurityType()) .isEqualTo(SECURITY_TYPE_WPA3_SAE_TRANSITION); } @Test Loading Loading
src/com/android/settings/wifi/repository/WifiHotspotRepository.java +17 −9 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static android.net.wifi.SoftApConfiguration.BAND_5GHZ; import static android.net.wifi.SoftApConfiguration.BAND_6GHZ; import static android.net.wifi.SoftApConfiguration.SECURITY_TYPE_OPEN; import static android.net.wifi.SoftApConfiguration.SECURITY_TYPE_WPA3_SAE; import static android.net.wifi.SoftApConfiguration.SECURITY_TYPE_WPA3_SAE_TRANSITION; import static android.net.wifi.WifiAvailableChannel.OP_MODE_SAP; import static android.net.wifi.WifiManager.WIFI_AP_STATE_DISABLED; import static android.net.wifi.WifiManager.WIFI_AP_STATE_ENABLED; Loading Loading @@ -343,7 +344,8 @@ public class WifiHotspotRepository { log("setSpeedType(), setPassphrase(SECURITY_TYPE_WPA3_SAE)"); configBuilder.setPassphrase(generatePassword(config), SECURITY_TYPE_WPA3_SAE); } } else if (speedType == SPEED_5GHZ) { } else { if (speedType == SPEED_5GHZ) { log("setSpeedType(), setBand(BAND_2GHZ_5GHZ)"); configBuilder.setBand(BAND_2GHZ_5GHZ); } else if (mIsDualBand) { Loading @@ -354,6 +356,12 @@ public class WifiHotspotRepository { log("setSpeedType(), setBand(BAND_2GHZ)"); configBuilder.setBand(BAND_2GHZ); } // Set the security type back to WPA2/WPA3 if we're moving from 6GHz to something else. if ((config.getBand() & BAND_6GHZ) != 0) { configBuilder.setPassphrase( generatePassword(config), SECURITY_TYPE_WPA3_SAE_TRANSITION); } } setSoftApConfiguration(configBuilder.build()); } Loading
tests/unit/src/com/android/settings/wifi/repository/WifiHotspotRepositoryTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -497,6 +497,8 @@ public class WifiHotspotRepositoryTest { SparseIntArray channels = mSoftApConfigCaptor.getValue().getChannels(); assertThat(channels.get(BAND_2GHZ, CHANNEL_NOT_FOUND)).isNotEqualTo(CHANNEL_NOT_FOUND); assertThat(channels.get(BAND_2GHZ_5GHZ, CHANNEL_NOT_FOUND)).isNotEqualTo(CHANNEL_NOT_FOUND); assertThat(mSoftApConfigCaptor.getValue().getSecurityType()) .isEqualTo(SECURITY_TYPE_WPA3_SAE_TRANSITION); } @Test Loading