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

Commit 50a17725 authored by lesl's avatar lesl
Browse files

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
parent 2287185d
Loading
Loading
Loading
Loading
+0 −5
Original line number Original line Diff line number Diff line
@@ -33,7 +33,6 @@ import com.android.internal.util.Preconditions;


import java.lang.annotation.Retention;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.RetentionPolicy;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.StandardCharsets;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.ArrayList;
import java.util.List;
import java.util.List;
@@ -767,10 +766,6 @@ public final class SoftApConfiguration implements Parcelable {
                }
                }
            } else {
            } else {
                Preconditions.checkStringNotEmpty(passphrase);
                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
                if (securityType == SECURITY_TYPE_WPA2_PSK
                        || securityType == SECURITY_TYPE_WPA3_SAE_TRANSITION) {
                        || securityType == SECURITY_TYPE_WPA3_SAE_TRANSITION) {
                    if (passphrase.length() < PSK_MIN_LEN || passphrase.length() > PSK_MAX_LEN) {
                    if (passphrase.length() < PSK_MIN_LEN || passphrase.length() > PSK_MAX_LEN) {