Expose WifiConfig.setSecurityParams as public API

Also expose associated SECURITY_TYPE_* constants.

Bug: 143614759
Test: compiles
Change-Id: I39419052791942ed86d3156a5cba1e0e2003098a
This commit is contained in:
David Su
2020-01-21 14:15:42 -08:00
parent 4cbe6852f5
commit 592f8d52ac
2 changed files with 35 additions and 16 deletions

View File

@@ -30728,9 +30728,19 @@ package android.net.wifi {
method @Deprecated @NonNull public android.net.MacAddress getRandomizedMacAddress();
method @Deprecated public boolean isPasspoint();
method @Deprecated public void setHttpProxy(android.net.ProxyInfo);
method @Deprecated public void setSecurityParams(int);
method public void writeToParcel(android.os.Parcel, int);
field @Deprecated public String BSSID;
field @Deprecated public String FQDN;
field @Deprecated public static final int SECURITY_TYPE_EAP = 3; // 0x3
field @Deprecated public static final int SECURITY_TYPE_EAP_SUITE_B = 5; // 0x5
field @Deprecated public static final int SECURITY_TYPE_OPEN = 0; // 0x0
field @Deprecated public static final int SECURITY_TYPE_OWE = 6; // 0x6
field @Deprecated public static final int SECURITY_TYPE_PSK = 2; // 0x2
field @Deprecated public static final int SECURITY_TYPE_SAE = 4; // 0x4
field @Deprecated public static final int SECURITY_TYPE_WAPI_CERT = 8; // 0x8
field @Deprecated public static final int SECURITY_TYPE_WAPI_PSK = 7; // 0x7
field @Deprecated public static final int SECURITY_TYPE_WEP = 1; // 0x1
field @Deprecated public String SSID;
field @Deprecated @NonNull public java.util.BitSet allowedAuthAlgorithms;
field @Deprecated @NonNull public java.util.BitSet allowedGroupCiphers;

View File

@@ -402,29 +402,29 @@ public class WifiConfiguration implements Parcelable {
public static final String[] strings = { "current", "disabled", "enabled" };
}
/**
* Security types we support.
*/
/** @hide */
/** Security type for an open network. */
public static final int SECURITY_TYPE_OPEN = 0;
/** @hide */
/** Security type for a WEP network. */
public static final int SECURITY_TYPE_WEP = 1;
/** @hide */
/** Security type for a PSK network. */
public static final int SECURITY_TYPE_PSK = 2;
/** @hide */
/** Security type for an EAP network. */
public static final int SECURITY_TYPE_EAP = 3;
/** @hide */
/** Security type for an SAE network. */
public static final int SECURITY_TYPE_SAE = 4;
/** @hide */
/** Security type for an EAP Suite B network. */
public static final int SECURITY_TYPE_EAP_SUITE_B = 5;
/** @hide */
/** Security type for an OWE network. */
public static final int SECURITY_TYPE_OWE = 6;
/** @hide */
/** Security type for a WAPI PSK network. */
public static final int SECURITY_TYPE_WAPI_PSK = 7;
/** @hide */
/** Security type for a WAPI Certificate network. */
public static final int SECURITY_TYPE_WAPI_CERT = 8;
/** @hide */
/**
* Security types we support.
* @hide
*/
@Retention(RetentionPolicy.SOURCE)
@IntDef(prefix = { "SECURITY_TYPE_" }, value = {
SECURITY_TYPE_OPEN,
@@ -440,10 +440,19 @@ public class WifiConfiguration implements Parcelable {
public @interface SecurityType {}
/**
* @hide
* Set security params (sets the various bitsets exposed in WifiConfiguration).
* Set the various security params to correspond to the provided security type.
* This is accomplished by setting the various BitSets exposed in WifiConfiguration.
*
* @param securityType One of the security types from {@link SecurityType}.
* @param securityType One of the following security types:
* {@link #SECURITY_TYPE_OPEN},
* {@link #SECURITY_TYPE_WEP},
* {@link #SECURITY_TYPE_PSK},
* {@link #SECURITY_TYPE_EAP},
* {@link #SECURITY_TYPE_SAE},
* {@link #SECURITY_TYPE_EAP_SUITE_B},
* {@link #SECURITY_TYPE_OWE},
* {@link #SECURITY_TYPE_WAPI_PSK}, or
* {@link #SECURITY_TYPE_WAPI_CERT}
*/
public void setSecurityParams(@SecurityType int securityType) {
// Clear all the bitsets.