diff options
author | Cody Kesting <ckesting@google.com> | 2020-04-14 17:26:25 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2020-04-14 17:26:25 +0000 |
commit | 1ddd60a6cc7e5e5126fcb8d83dabf8ae80602245 (patch) | |
tree | 74dc5e388d7fd442ee497f46a2a33580c574abf0 | |
parent | 00d06e5becd285025a3825c6ed1c8791457aab47 (diff) | |
parent | 1152eaf9c0ba8e0d63a8b233aa86621509e1e83d (diff) | |
download | ike-1ddd60a6cc7e5e5126fcb8d83dabf8ae80602245.tar.gz |
Merge "Make EapAkaPrimeConfigs have the correct methodType."
-rw-r--r-- | src/java/android/net/eap/EapSessionConfig.java | 9 | ||||
-rw-r--r-- | tests/iketests/src/java/android/net/eap/EapSessionConfigTest.java | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/java/android/net/eap/EapSessionConfig.java b/src/java/android/net/eap/EapSessionConfig.java index 7a7ee8f6..0deb1576 100644 --- a/src/java/android/net/eap/EapSessionConfig.java +++ b/src/java/android/net/eap/EapSessionConfig.java @@ -303,7 +303,12 @@ public final class EapSessionConfig { /** @hide */ @VisibleForTesting public EapAkaConfig(int subId, @UiccAppType int apptype) { - super(EAP_TYPE_AKA, subId, apptype); + this(EAP_TYPE_AKA, subId, apptype); + } + + /** @hide */ + EapAkaConfig(int methodType, int subId, @UiccAppType int apptype) { + super(methodType, subId, apptype); } } @@ -323,7 +328,7 @@ public final class EapSessionConfig { @UiccAppType int apptype, @NonNull String networkName, boolean allowMismatchedNetworkNames) { - super(subId, apptype); + super(EAP_TYPE_AKA_PRIME, subId, apptype); if (networkName == null) { throw new IllegalArgumentException("NetworkName was null"); diff --git a/tests/iketests/src/java/android/net/eap/EapSessionConfigTest.java b/tests/iketests/src/java/android/net/eap/EapSessionConfigTest.java index eed32e3e..cfa6cbfc 100644 --- a/tests/iketests/src/java/android/net/eap/EapSessionConfigTest.java +++ b/tests/iketests/src/java/android/net/eap/EapSessionConfigTest.java @@ -72,6 +72,7 @@ public class EapSessionConfigTest { assertArrayEquals(DEFAULT_IDENTITY, result.eapIdentity); EapMethodConfig eapMethodConfig = result.eapConfigs.get(EAP_TYPE_AKA); + assertEquals(EAP_TYPE_AKA, eapMethodConfig.methodType); EapAkaConfig eapAkaConfig = (EapAkaConfig) eapMethodConfig; assertEquals(SUB_ID, eapAkaConfig.subId); assertEquals(APPTYPE_USIM, eapAkaConfig.apptype); @@ -87,6 +88,7 @@ public class EapSessionConfigTest { assertEquals(DEFAULT_IDENTITY, result.eapIdentity); EapMethodConfig eapMethodConfig = result.eapConfigs.get(EAP_TYPE_AKA_PRIME); + assertEquals(EAP_TYPE_AKA_PRIME, eapMethodConfig.methodType); EapAkaPrimeConfig eapAkaPrimeConfig = (EapAkaPrimeConfig) eapMethodConfig; assertEquals(SUB_ID, eapAkaPrimeConfig.subId); assertEquals(APPTYPE_USIM, eapAkaPrimeConfig.apptype); @@ -100,6 +102,7 @@ public class EapSessionConfigTest { new EapSessionConfig.Builder().setEapMsChapV2Config(USERNAME, PASSWORD).build(); EapMsChapV2Config config = (EapMsChapV2Config) result.eapConfigs.get(EAP_TYPE_MSCHAP_V2); + assertEquals(EAP_TYPE_MSCHAP_V2, config.methodType); assertEquals(USERNAME, config.username); assertEquals(PASSWORD, config.password); } |