summaryrefslogtreecommitdiff
path: root/wifi/java
diff options
context:
space:
mode:
authorHai Shalom <haishalom@google.com>2020-07-15 18:30:49 -0700
committerHai Shalom <haishalom@google.com>2020-08-12 21:28:08 +0000
commitc527eed1235d0fa81286e08d857e5b31a7d265c8 (patch)
tree7d400c1796bf1b67a99a67c1429664ba7fd10593 /wifi/java
parentca28a90bec0180c09ab215442e6edb9bf5e9d217 (diff)
[Passpoint] Changes to Unique ID
Modify Unique ID calculation to use only FQDN for HomeSP hash and modify the hash of the Credential to produce an identical hash for user credential changes, except for username which will result in a different hash, and generate a different hash for SIM credential, Cert credential and realm changes. The result would allow multiple profiles with SIM credential or Cert credential for the same network and overwrite profiles with updates to the user credentials with changes other than the username. Bug: 161008339 Test: atest com.android.server.wifi Test: atest PasspointConfigurationTest CredentialTest Test: Install an OSU profile, then install R1 profile for the same network (HomeSP has a different friendly name), verify the OSU profile has been overwritten Change-Id: Ice11158078b5b86c721747b0d67ecfb09731a3c5 Merged-In: Ice11158078b5b86c721747b0d67ecfb09731a3c5
Diffstat (limited to 'wifi/java')
-rw-r--r--wifi/java/android/net/wifi/hotspot2/pps/Credential.java13
-rw-r--r--wifi/java/android/net/wifi/hotspot2/pps/HomeSp.java4
2 files changed, 13 insertions, 4 deletions
diff --git a/wifi/java/android/net/wifi/hotspot2/pps/Credential.java b/wifi/java/android/net/wifi/hotspot2/pps/Credential.java
index fa806e7797cd..282757ac5a14 100644
--- a/wifi/java/android/net/wifi/hotspot2/pps/Credential.java
+++ b/wifi/java/android/net/wifi/hotspot2/pps/Credential.java
@@ -448,6 +448,16 @@ public final class Credential implements Parcelable {
return new UserCredential[size];
}
};
+
+ /**
+ * Get a unique identifier for UserCredential.
+ *
+ * @hide
+ * @return a Unique identifier for a UserCredential object
+ */
+ public int getUniqueId() {
+ return Objects.hash(mUsername);
+ }
}
private UserCredential mUserCredential = null;
/**
@@ -1037,7 +1047,8 @@ public final class Credential implements Parcelable {
* @return a Unique identifier for a Credential object
*/
public int getUniqueId() {
- return Objects.hash(mUserCredential, mCertCredential, mSimCredential, mRealm);
+ return Objects.hash(mUserCredential != null ? mUserCredential.getUniqueId() : 0,
+ mCertCredential, mSimCredential, mRealm);
}
@Override
diff --git a/wifi/java/android/net/wifi/hotspot2/pps/HomeSp.java b/wifi/java/android/net/wifi/hotspot2/pps/HomeSp.java
index 224c4bed9d5b..8f34579f6a5d 100644
--- a/wifi/java/android/net/wifi/hotspot2/pps/HomeSp.java
+++ b/wifi/java/android/net/wifi/hotspot2/pps/HomeSp.java
@@ -313,9 +313,7 @@ public final class HomeSp implements Parcelable {
* @return a Unique identifier for a HomeSp object
*/
public int getUniqueId() {
- return Objects.hash(mFqdn, mFriendlyName, mHomeNetworkIds, Arrays.hashCode(mMatchAllOis),
- Arrays.hashCode(mMatchAnyOis), Arrays.hashCode(mOtherHomePartners),
- Arrays.hashCode(mRoamingConsortiumOis));
+ return Objects.hash(mFqdn);
}