wifi: Move SAP passphrase ascii encodable check to wifi-service

Add new overlay config to allow OEM bypass SAP passphrase ascii
encodable check since it depends on HAL and driver.

Bug: 168688691
Test: atest FrameworksWifiApiTests
Test: Manual test to add non ascii passphrase
Change-Id: If573acece96faf59c7804c6178d0f0200164f88e
Merged-In: If573acece96faf59c7804c6178d0f0200164f88e
This commit is contained in:
lesl
2020-09-28 20:10:25 +08:00
committed by Les Lee
parent 570d10320b
commit deb4384198

View File

@@ -32,7 +32,6 @@ import com.android.internal.util.Preconditions;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
@@ -712,10 +711,6 @@ public final class SoftApConfiguration implements Parcelable {
}
} else {
Preconditions.checkStringNotEmpty(passphrase);
final CharsetEncoder asciiEncoder = StandardCharsets.US_ASCII.newEncoder();
if (!asciiEncoder.canEncode(passphrase)) {
throw new IllegalArgumentException("passphrase not ASCII encodable");
}
if (securityType == SECURITY_TYPE_WPA2_PSK
|| securityType == SECURITY_TYPE_WPA3_SAE_TRANSITION) {
if (passphrase.length() < PSK_MIN_LEN || passphrase.length() > PSK_MAX_LEN) {