From f8dbd216c8d49473b195077f3d3519fc3f7fde18 Mon Sep 17 00:00:00 2001 From: Peter Qiu Date: Tue, 28 Feb 2017 15:12:16 -0800 Subject: [PATCH] hotspot2: expose string constants for cert type and auth methods So that we can use these constants in WifiService and the apps as well in the future. While there, remove auth method "CHAP" from the supported list, since it is currenlty not supported by WifiService. Bug: 34206769 Test: make -j32 Change-Id: Icadc3b13f2b135d51445d336116fbba86e96b70f --- .../net/wifi/hotspot2/pps/Credential.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/wifi/java/android/net/wifi/hotspot2/pps/Credential.java b/wifi/java/android/net/wifi/hotspot2/pps/Credential.java index 620759df8f1d7..23888411c1b21 100644 --- a/wifi/java/android/net/wifi/hotspot2/pps/Credential.java +++ b/wifi/java/android/net/wifi/hotspot2/pps/Credential.java @@ -121,13 +121,23 @@ public final class Credential implements Parcelable { */ private static final int MAX_PASSWORD_BYTES = 255; + /** + * Supported authentication methods. + * @hide + */ + public static final String AUTH_METHOD_PAP = "PAP"; + /** @hide */ + public static final String AUTH_METHOD_MSCHAP = "MS-CHAP"; + /** @hide */ + public static final String AUTH_METHOD_MSCHAPV2 = "MS-CHAP-V2"; + /** * Supported Non-EAP inner methods. Refer to * Credential/UsernamePassword/EAPMethod/InnerEAPType in Hotspot 2.0 Release 2 Technical * Specification Section 9.1 for more info. */ - private static final Set SUPPORTED_AUTH = - new HashSet(Arrays.asList("PAP", "CHAP", "MS-CHAP", "MS-CHAP-V2")); + private static final Set SUPPORTED_AUTH = new HashSet( + Arrays.asList(AUTH_METHOD_PAP, AUTH_METHOD_MSCHAP, AUTH_METHOD_MSCHAPV2)); /** * Username of the credential. @@ -348,8 +358,9 @@ public final class Credential implements Parcelable { public static final class CertificateCredential implements Parcelable { /** * Supported certificate types. + * @hide */ - private static final String CERT_TYPE_X509V3 = "x509v3"; + public static final String CERT_TYPE_X509V3 = "x509v3"; /** * Certificate SHA-256 fingerprint length.