From 8d6c5e6b13a710a8df9a81db269e039421d64e0b Mon Sep 17 00:00:00 2001 From: Ecco Park Date: Tue, 26 Jun 2018 14:27:01 -0700 Subject: passpoint: skip NAI realms match in case of 3GPP element match From O, EAP-AKA/SIM for T-mobile has been broken with Boingo AP. For Boingo AP, NAI realm ANQP element doesn't contain realm matching PLMN ID(MNC/MCC) from SIM on the device. Because of this, current design can't find the Boingo AP as roaming partner with T-mobile even though 3GPP Celluar Network ANQP element is already matched with MCC/MNC from SIM on the device. In case of 3GPP element match, it is considered as roaming partner regardless of NAI realm match Bug: 80527981 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: live test with OSU AP Change-Id: Iedb9b26873779070c0b08a0b4ff3c4e96a5bdcb9 Signed-off-by: Ecco Park (cherry picked from commit d085366918fa9a1db977993eb859e790180508aa) --- .../server/wifi/hotspot2/PasspointProvider.java | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'service') diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointProvider.java b/service/java/com/android/server/wifi/hotspot2/PasspointProvider.java index f86a938d7..6d09a29ca 100644 --- a/service/java/com/android/server/wifi/hotspot2/PasspointProvider.java +++ b/service/java/com/android/server/wifi/hotspot2/PasspointProvider.java @@ -259,24 +259,32 @@ public class PasspointProvider { */ public PasspointMatch match(Map anqpElements, RoamingConsortium roamingConsortium) { - PasspointMatch providerMatch = matchProvider(anqpElements, roamingConsortium); + PasspointMatch providerMatch = matchProviderExceptFor3GPP(anqpElements, roamingConsortium); + + // 3GPP Network matching. + if (providerMatch == PasspointMatch.None && ANQPMatcher.matchThreeGPPNetwork( + (ThreeGPPNetworkElement) anqpElements.get(ANQPElementType.ANQP3GPPNetwork), + mImsiParameter, mMatchingSIMImsiList)) { + return PasspointMatch.RoamingProvider; + } // Perform authentication match against the NAI Realm. int authMatch = ANQPMatcher.matchNAIRealm( (NAIRealmElement) anqpElements.get(ANQPElementType.ANQPNAIRealm), mConfig.getCredential().getRealm(), mEAPMethodID, mAuthParam); - // Auth mismatch, demote provider match. + // In case of Auth mismatch, demote provider match. if (authMatch == AuthMatch.NONE) { return PasspointMatch.None; } - // No realm match, return provider match as is. + // In case of no realm match, return provider match as is. if ((authMatch & AuthMatch.REALM) == 0) { return providerMatch; } - // Realm match, promote provider match to roaming if no other provider match is found. + // Promote the provider match to roaming provider if provider match is not found, but NAI + // realm is matched. return providerMatch == PasspointMatch.None ? PasspointMatch.RoamingProvider : providerMatch; } @@ -454,13 +462,14 @@ public class PasspointProvider { } /** - * Perform a provider match based on the given ANQP elements. + * Perform a provider match based on the given ANQP elements except for matching 3GPP Network. * * @param anqpElements List of ANQP elements * @param roamingConsortium Roaming Consortium information element from the AP * @return {@link PasspointMatch} */ - private PasspointMatch matchProvider(Map anqpElements, + private PasspointMatch matchProviderExceptFor3GPP( + Map anqpElements, RoamingConsortium roamingConsortium) { // Domain name matching. if (ANQPMatcher.matchDomainName( @@ -489,12 +498,6 @@ public class PasspointProvider { } } - // 3GPP Network matching. - if (ANQPMatcher.matchThreeGPPNetwork( - (ThreeGPPNetworkElement) anqpElements.get(ANQPElementType.ANQP3GPPNetwork), - mImsiParameter, mMatchingSIMImsiList)) { - return PasspointMatch.RoamingProvider; - } return PasspointMatch.None; } -- cgit v1.2.3