Connect to OWE Wi-Fi network when QR code has no password

- Since there is no password for Wi-Fi security in OPEN and OWE, try to connect to one of them

Bug: 360377330
Flag: EXEMPT bugfix
Test: Manual testing
atest -c WifiDppQrCodeScannerFragmentTest

Change-Id: Ia0a59e099b724170ad993df8b4246b94e0da392c
This commit is contained in:
Weng Su
2024-10-14 07:02:18 +08:00
parent 30526d9858
commit efe8d52f77
2 changed files with 46 additions and 10 deletions

View File

@@ -16,6 +16,11 @@
package com.android.settings.wifi.dpp;
import static com.android.wifitrackerlib.WifiEntry.SECURITY_NONE;
import static com.android.wifitrackerlib.WifiEntry.SECURITY_OWE;
import static com.android.wifitrackerlib.WifiEntry.SECURITY_PSK;
import static com.android.wifitrackerlib.WifiEntry.SECURITY_SAE;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.anyInt;
@@ -148,4 +153,24 @@ public class WifiDppQrCodeScannerFragmentTest {
verify(mActivity).setResult(eq(Activity.RESULT_OK), any());
verify(mActivity).finish();
}
@Test
public void isSecurityMatched_securityNotMatch_returnFalse() {
assertThat(mFragment.isSecurityMatched(SECURITY_NONE, SECURITY_PSK)).isFalse();
}
@Test
public void isSecurityMatched_securityMatch_returnTrue() {
assertThat(mFragment.isSecurityMatched(SECURITY_PSK, SECURITY_PSK)).isTrue();
}
@Test
public void isSecurityMatched_tryPskSaeTransition_returnTrue() {
assertThat(mFragment.isSecurityMatched(SECURITY_SAE, SECURITY_PSK)).isTrue();
}
@Test
public void isSecurityMatched_noPasswordSecurity_returnTrue() {
assertThat(mFragment.isSecurityMatched(SECURITY_NONE, SECURITY_OWE)).isTrue();
}
}