summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorEcco Park <eccopark@google.com>2018-10-03 01:48:47 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-10-03 01:48:47 -0700
commit833c8f25904a158e4e5225edd94279299f1d9bc8 (patch)
tree68bd2affdab625a349ce2b1dea220c3d365ffc65 /service
parent182bebc352616e04de9f3e2f985565c869813744 (diff)
parent8d6c5e6b13a710a8df9a81db269e039421d64e0b (diff)
passpoint: skip NAI realms match in case of 3GPP element match
am: 8d6c5e6b13 Change-Id: I9c651a2f462f90f37be0eecf3ce4a38e27519e3f
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;
}