diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-08-28 20:22:44 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-08-28 20:22:44 +0000 |
commit | e7588d9fa3e2661ff0505172c96f5626c3016a91 (patch) | |
tree | dc3b2265d9e77876f5740f239d398debd86b7b34 /service | |
parent | e8b5da4cd4f31ee92095648dd1c9a0cd0483869e (diff) | |
parent | 07969aeeab3a0caebef26d1b2921d53845101f56 (diff) |
Merge "Change system language, passpoint R2 failed to connect" into qt-qpr1-dev
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/hotspot2/OsuServerConnection.java | 20 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/hotspot2/PasspointProvisioner.java | 2 |
2 files changed, 10 insertions, 12 deletions
diff --git a/service/java/com/android/server/wifi/hotspot2/OsuServerConnection.java b/service/java/com/android/server/wifi/hotspot2/OsuServerConnection.java index 94f584f72..92560932c 100644 --- a/service/java/com/android/server/wifi/hotspot2/OsuServerConnection.java +++ b/service/java/com/android/server/wifi/hotspot2/OsuServerConnection.java @@ -188,27 +188,25 @@ public class OsuServerConnection { * Validates the service provider by comparing its identities found in OSU Server cert * to the friendlyName obtained from ANQP exchange that is displayed to the user. * - * @param locale a {@link Locale} object used for matching the friendly name in - * subjectAltName section of the certificate along with - * {@param friendlyName}. - * @param friendlyName a string of the friendly name used for finding the same name in - * subjectAltName section of the certificate. + * @param friendlyNames the friendly names used for finding the same name in + * subjectAltName section of the certificate, which is a map of language + * codes from ISO-639 and names. * @return boolean true if friendlyName shows up as one of the identities in the cert */ - public boolean validateProvider(Locale locale, - String friendlyName) { + public boolean validateProvider( + Map<String, String> friendlyNames) { - if (locale == null || TextUtils.isEmpty(friendlyName)) { + if (friendlyNames.size() == 0) { return false; } for (Pair<Locale, String> identity : ServiceProviderVerifier.getProviderNames( mTrustManager.getProviderCert())) { - if (identity.first == null) continue; + if (identity.first == null || TextUtils.isEmpty(identity.second)) continue; // Compare the language code for ISO-639. - if (identity.first.getISO3Language().equals(locale.getISO3Language()) && - TextUtils.equals(identity.second, friendlyName)) { + if (TextUtils.equals(identity.second, + friendlyNames.get(identity.first.getISO3Language()))) { if (mVerboseLoggingEnabled) { Log.v(TAG, "OSU certificate is valid for " + identity.first.getISO3Language() + "/" + identity.second); diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointProvisioner.java b/service/java/com/android/server/wifi/hotspot2/PasspointProvisioner.java index bdd035fe4..137d9fa19 100644 --- a/service/java/com/android/server/wifi/hotspot2/PasspointProvisioner.java +++ b/service/java/com/android/server/wifi/hotspot2/PasspointProvisioner.java @@ -366,7 +366,7 @@ public class PasspointProvisioner { return; } if (!mOsuServerConnection.validateProvider( - Locale.getDefault(), mOsuProvider.getFriendlyName())) { + mOsuProvider.getFriendlyNameList())) { Log.e(TAG, "OSU Server certificate does not have the one matched with the selected " + "Service Name: " |