summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorEcco Park <eccopark@google.com>2018-06-26 14:27:01 -0700
committerEcco Park <eccopark@google.com>2018-10-01 16:12:13 -0700
commit8d6c5e6b13a710a8df9a81db269e039421d64e0b (patch)
tree13573b3c0cd1ba70e79c160cd796c0a56a731cf1 /service
parentc442cac03988b303a1151a774cc291a89ed1dad1 (diff)
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 <eccopark@google.com> (cherry picked from commit d085366918fa9a1db977993eb859e790180508aa)
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/hotspot2/PasspointProvider.java27
1 files changed, 15 insertions, 12 deletions
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<ANQPElementType, ANQPElement> 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<ANQPElementType, ANQPElement> anqpElements,
+ private PasspointMatch matchProviderExceptFor3GPP(
+ Map<ANQPElementType, ANQPElement> 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;
}