diff options
author | Hai Shalom <haishalom@google.com> | 2020-02-20 16:39:23 -0800 |
---|---|---|
committer | Hai Shalom <haishalom@google.com> | 2020-02-27 13:12:44 -0800 |
commit | b25e55d892f91decd1be0bcbf6fce592a3ea636b (patch) | |
tree | e454923efc6d1d45dff797c85e449bcc832fbaca /service | |
parent | 5d02e209b7597c589e828a8de323ce826bd36a88 (diff) |
[Passpoint] Added support for Other Home Partners matching
Added support for matching Other Home Partners as Home network
providers. Information is in PPS-MO HomeSP/OtherHomePartners/<X+>/FQDN
node, and is useful when operators become co-home providers.
Bug: 149946692
Test: atest PasspointProviderTest
Change-Id: I89219c85f366fcbd16c3c59725813174c3a9e439
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/hotspot2/ANQPMatcher.java | 8 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/hotspot2/PasspointProvider.java | 15 |
2 files changed, 21 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/hotspot2/ANQPMatcher.java b/service/java/com/android/server/wifi/hotspot2/ANQPMatcher.java index dd39174df..a920c5ec1 100644 --- a/service/java/com/android/server/wifi/hotspot2/ANQPMatcher.java +++ b/service/java/com/android/server/wifi/hotspot2/ANQPMatcher.java @@ -40,9 +40,9 @@ public class ANQPMatcher { * * @param element The Domain Name ANQP element * @param fqdn The FQDN to compare against - * @param imsiParam The IMSI parameter of the provider + * @param imsiParam The IMSI parameter of the provider (needed only for IMSI matching) * @param simImsi The IMSI from the installed SIM cards that best matched provider's - * IMSI parameter + * IMSI parameter (needed only for IMSI matching) * @return true if a match is found */ public static boolean matchDomainName(DomainNameElement element, String fqdn, @@ -56,6 +56,10 @@ public class ANQPMatcher { return true; } + if (imsiParam == null || simImsi == null) { + continue; + } + // Try to retrieve the MCC-MNC string from the domain (for 3GPP network domain) and // match against the provider's SIM credential. if (matchMccMnc(Utils.getMccMnc(Utils.splitDomain(domain)), imsiParam, simImsi)) { diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointProvider.java b/service/java/com/android/server/wifi/hotspot2/PasspointProvider.java index c8de0c499..205c71f78 100644 --- a/service/java/com/android/server/wifi/hotspot2/PasspointProvider.java +++ b/service/java/com/android/server/wifi/hotspot2/PasspointProvider.java @@ -711,6 +711,21 @@ public class PasspointProvider { return PasspointMatch.HomeProvider; } + // Other Home Partners matching. + if (mConfig.getHomeSp().getOtherHomePartners() != null) { + for (String otherHomePartner : mConfig.getHomeSp().getOtherHomePartners()) { + if (ANQPMatcher.matchDomainName( + (DomainNameElement) anqpElements.get(ANQPElementType.ANQPDomName), + otherHomePartner, null, null)) { + if (mVerboseLoggingEnabled) { + Log.d(TAG, "Other Home Partner " + otherHomePartner + + " match: HomeProvider"); + } + return PasspointMatch.HomeProvider; + } + } + } + // ANQP Roaming Consortium OI matching. long[] providerOIs = mConfig.getHomeSp().getRoamingConsortiumOis(); if (ANQPMatcher.matchRoamingConsortium( |