summaryrefslogtreecommitdiffstats
path: root/wifi/java/android/net/wifi/passpoint
diff options
context:
space:
mode:
authorroger.chang <roger.chang@mediatek.com>2014-05-28 15:54:08 +0800
committerYuhao Zheng <yuhaozheng@google.com>2014-05-30 15:03:50 -0700
commit8dd64036cdaec757d3b19654a2c3c336ce902433 (patch)
treed93667d62d08b02ee3347c99d0e6b042763aa0c9 /wifi/java/android/net/wifi/passpoint
parent2157b9dcef00eac182b557b4d78cb66c31eba1bd (diff)
downloadframeworks_base-8dd64036cdaec757d3b19654a2c3c336ce902433.zip
frameworks_base-8dd64036cdaec757d3b19654a2c3c336ce902433.tar.gz
frameworks_base-8dd64036cdaec757d3b19654a2c3c336ce902433.tar.bz2
Hotspot 2.0 framework - Update implementation
1. Change API naming 2. Combine 2 constructors 3. Add comments for usage Change-Id: I13d98ed82879b46252bb86a7be7b0a5382024c72
Diffstat (limited to 'wifi/java/android/net/wifi/passpoint')
-rw-r--r--wifi/java/android/net/wifi/passpoint/WifiPasspointCredential.java403
-rw-r--r--wifi/java/android/net/wifi/passpoint/WifiPasspointDmTree.java24
-rw-r--r--wifi/java/android/net/wifi/passpoint/WifiPasspointPolicy.java24
3 files changed, 192 insertions, 259 deletions
diff --git a/wifi/java/android/net/wifi/passpoint/WifiPasspointCredential.java b/wifi/java/android/net/wifi/passpoint/WifiPasspointCredential.java
index f809abf..54ac71e 100644
--- a/wifi/java/android/net/wifi/passpoint/WifiPasspointCredential.java
+++ b/wifi/java/android/net/wifi/passpoint/WifiPasspointCredential.java
@@ -20,10 +20,13 @@ import android.net.wifi.WifiEnterpriseConfig;
import android.os.Parcelable;
import android.os.Parcel;
+import java.util.ArrayList;
import java.util.Collection;
-import java.util.Set;
+import java.util.List;
import java.util.Iterator;
import java.util.Map;
+import java.util.Set;
+
/**
* A class representing a Wi-Fi Passpoint credential.
@@ -32,64 +35,76 @@ import java.util.Map;
public class WifiPasspointCredential implements Parcelable {
private final static String TAG = "PasspointCredential";
- private String mWifiTreePath;
- private String mWifiSPFQDN;
+ private final static boolean DBG = true;
+
+ /** Wi-Fi nodes**/
+ private String mWifiSpFqdn;
+
+ /** PerProviderSubscription nodes **/
private String mCredentialName;
- private String mUpdateIdentifier;
+
+ /** SubscriptionUpdate nodes **/
+ private String mSubscriptionUpdateInterval;
private String mSubscriptionUpdateMethod;
- private WifiEnterpriseConfig mEnterpriseConfig;
+ private String mSubscriptionUpdateRestriction;
+ private String mSubscriptionUpdateURI;
+ private String mSubscriptionUpdateUsername;
+ private String mSubscriptionUpdatePassword;
+
+ /** HomeSP nodes **/
+ private String mHomeSpFqdn;
+ private String mFriendlyName;
+ private Collection<WifiPasspointDmTree.HomeOIList> mHomeOIList;
+ private Collection<WifiPasspointDmTree.OtherHomePartners> mOtherHomePartnerList;
+
+ /** SubscriptionParameters nodes**/
+ private String mCreationDate;
+ private String mExpirationDate;
+
+ /** Credential nodes **/
private String mType;
private String mInnerMethod;
private String mCertType;
private String mCertSha256Fingerprint;
+ private String mUpdateIdentifier;
private String mUsername;
private String mPasswd;
+ private String mRealm;
private String mImsi;
private String mMcc;
private String mMnc;
private String mCaRootCert;
- private String mRealm;
- private int mPriority; //User preferred priority; The smaller, the higher
- private boolean mUserPreferred = false;
- private String mHomeSpFqdn;
- private String mFriendlyName;
- private String mOtherhomepartnerFqdn;
private String mClientCert;
- private String mCreationDate;
- private String mExpirationDate;
-
- private String mSubscriptionDMAccUsername;
- private String mSubscriptionDMAccPassword;
- private String mSubscriptionUpdateInterval;
+ private boolean mCheckAaaServerCertStatus;
- private String mPolicyUpdateURI;
+ /** Policy nodes **/
+ private String mPolicyUpdateUri;
private String mPolicyUpdateInterval;
- private String mPolicyDMAccUsername;
- private String mPolicyDMAccPassword;
+ private String mPolicyUpdateUsername;
+ private String mPolicyUpdatePassword;
private String mPolicyUpdateRestriction;
private String mPolicyUpdateMethod;
-
private Collection<WifiPasspointDmTree.PreferredRoamingPartnerList> mPreferredRoamingPartnerList;
- private Collection<WifiPasspointDmTree.HomeOIList> mHomeOIList;
private Collection<WifiPasspointDmTree.MinBackhaulThresholdNetwork> mMinBackhaulThresholdNetwork;
- private Collection<WifiPasspointDmTree.RequiredProtoPortTuple> mRequiredProtoPortTuple;
private Collection<WifiPasspointDmTree.SPExclusionList> mSpExclusionList;
+ private Collection<WifiPasspointDmTree.RequiredProtoPortTuple> mRequiredProtoPortTuple;
private String mMaxBssLoad;
- private boolean mIsMachineRemediation;
-
- private String mAAACertURL;
- private String mAAASha256Fingerprint;
+ /** CrednetialPriority node **/
+ private int mCrednetialPriority;
- private String mSubscriptionUpdateRestriction;
- private String mSubscriptionUpdateURI;
+ /** AAAServerTrustRoot nodes **/
+ private String mAaaCertUrl;
+ private String mAaaSha256Fingerprint;
- private boolean mCheckAaaServerCertStatus;
+ /** Others **/
+ private boolean mIsMachineRemediation;
+ private boolean mUserPreferred = false;
+ private String mWifiTreePath;
+ private WifiEnterpriseConfig mEnterpriseConfig;
/** @hide */
- public WifiPasspointCredential() {
-
- }
+ public WifiPasspointCredential() {}
/**
* Constructor
@@ -114,84 +129,6 @@ public class WifiPasspointCredential implements Parcelable {
public WifiPasspointCredential(String type,
String caroot,
String clientcert,
- WifiPasspointDmTree.SpFqdn sp,
- WifiPasspointDmTree.CredentialInfo credinfo) {
-
- if (credinfo == null) {
- return;
- }
-
- mType = type;
- mCaRootCert = caroot;
- mClientCert = clientcert;
-
- mWifiSPFQDN = sp.nodeName;
- mUpdateIdentifier = sp.perProviderSubscription.UpdateIdentifier;
-
- mCredentialName = credinfo.nodeName;
- Set set = credinfo.homeSP.otherHomePartners.entrySet();
- Iterator i = set.iterator();
- if (i.hasNext()) {
- Map.Entry entry3 = (Map.Entry) i.next();
- WifiPasspointDmTree.OtherHomePartners ohp = (WifiPasspointDmTree.OtherHomePartners) entry3.getValue();
- mOtherhomepartnerFqdn = ohp.FQDN;
- }
-
- set = credinfo.aAAServerTrustRoot.entrySet();
- i = set.iterator();
- if (i.hasNext()) {
- Map.Entry entry3 = (Map.Entry) i.next();
- WifiPasspointDmTree.AAAServerTrustRoot aaa = (WifiPasspointDmTree.AAAServerTrustRoot) entry3.getValue();
- mAAACertURL = aaa.CertURL;
- mAAASha256Fingerprint = aaa.CertSHA256Fingerprint;
- }
-
- mCertType = credinfo.credential.digitalCertificate.CertificateType;
- mCertSha256Fingerprint = credinfo.credential.digitalCertificate.CertSHA256Fingerprint;
- mUsername = credinfo.credential.usernamePassword.Username;
- mPasswd = credinfo.credential.usernamePassword.Password;
- mIsMachineRemediation = credinfo.credential.usernamePassword.MachineManaged;
- mInnerMethod = credinfo.credential.usernamePassword.eAPMethod.InnerMethod;
- mImsi = credinfo.credential.sim.IMSI;
- mCreationDate = credinfo.credential.CreationDate;
- mExpirationDate = credinfo.credential.ExpirationDate;
- mRealm = credinfo.credential.Realm;
-
- if (credinfo.credentialPriority == null) {
- credinfo.credentialPriority = "128";
- }
- mPriority = Integer.parseInt(credinfo.credentialPriority);
-
- mHomeSpFqdn = credinfo.homeSP.FQDN;
-
- mSubscriptionUpdateInterval = credinfo.subscriptionUpdate.UpdateInterval;
- mSubscriptionUpdateMethod = credinfo.subscriptionUpdate.UpdateMethod;
- mSubscriptionUpdateRestriction = credinfo.subscriptionUpdate.Restriction;
- mSubscriptionUpdateURI = credinfo.subscriptionUpdate.URI;
- mSubscriptionDMAccUsername = credinfo.subscriptionUpdate.usernamePassword.Username;
- mSubscriptionDMAccPassword = credinfo.subscriptionUpdate.usernamePassword.Password;
-
- mPolicyUpdateURI = credinfo.policy.policyUpdate.URI;
- mPolicyUpdateInterval = credinfo.policy.policyUpdate.UpdateInterval;
- mPolicyDMAccUsername = credinfo.policy.policyUpdate.usernamePassword.Username;
- mPolicyDMAccPassword = credinfo.policy.policyUpdate.usernamePassword.Password;
- mPolicyUpdateRestriction = credinfo.policy.policyUpdate.Restriction;
- mPolicyUpdateMethod = credinfo.policy.policyUpdate.UpdateMethod;
- mPreferredRoamingPartnerList = credinfo.policy.preferredRoamingPartnerList.values();
- mMinBackhaulThresholdNetwork = credinfo.policy.minBackhaulThreshold.values();
- mRequiredProtoPortTuple = credinfo.policy.requiredProtoPortTuple.values();
- mMaxBssLoad = credinfo.policy.maximumBSSLoadValue;
- mSpExclusionList = credinfo.policy.sPExclusionList.values();
-
- mHomeOIList = credinfo.homeSP.homeOIList.values();
- mFriendlyName = credinfo.homeSP.FriendlyName;
- mCheckAaaServerCertStatus = credinfo.credential.CheckAAAServerCertStatus;
- }
-
- /** @hide */
- public WifiPasspointCredential(String type,
- String caroot,
- String clientcert,
String mcc,
String mnc,
WifiPasspointDmTree.SpFqdn sp,
@@ -205,25 +142,19 @@ public class WifiPasspointCredential implements Parcelable {
mCaRootCert = caroot;
mClientCert = clientcert;
- mWifiSPFQDN = sp.nodeName;
+ mWifiSpFqdn = sp.nodeName;
mUpdateIdentifier = sp.perProviderSubscription.UpdateIdentifier;
mCredentialName = credinfo.nodeName;
- Set set = credinfo.homeSP.otherHomePartners.entrySet();
- Iterator i = set.iterator();
- if (i.hasNext()) {
- Map.Entry entry3 = (Map.Entry) i.next();
- WifiPasspointDmTree.OtherHomePartners ohp = (WifiPasspointDmTree.OtherHomePartners) entry3.getValue();
- mOtherhomepartnerFqdn = ohp.FQDN;
- }
+ mOtherHomePartnerList = credinfo.homeSP.otherHomePartners.values();
- set = credinfo.aAAServerTrustRoot.entrySet();
- i = set.iterator();
+ Set set = credinfo.aAAServerTrustRoot.entrySet();
+ Iterator i = set.iterator();
if (i.hasNext()) {
Map.Entry entry3 = (Map.Entry) i.next();
WifiPasspointDmTree.AAAServerTrustRoot aaa = (WifiPasspointDmTree.AAAServerTrustRoot) entry3.getValue();
- mAAACertURL = aaa.CertURL;
- mAAASha256Fingerprint = aaa.CertSHA256Fingerprint;
+ mAaaCertUrl = aaa.CertURL;
+ mAaaSha256Fingerprint = aaa.CertSHA256Fingerprint;
}
mCertType = credinfo.credential.digitalCertificate.CertificateType;
@@ -240,22 +171,24 @@ public class WifiPasspointCredential implements Parcelable {
mRealm = credinfo.credential.Realm;
if (credinfo.credentialPriority == null) {
- credinfo.credentialPriority = "128";
+ mCrednetialPriority = 128;
+ } else {
+ mCrednetialPriority = Integer.parseInt(credinfo.credentialPriority);
}
- mPriority = Integer.parseInt(credinfo.credentialPriority);
mHomeSpFqdn = credinfo.homeSP.FQDN;
+ mSubscriptionUpdateInterval = credinfo.subscriptionUpdate.UpdateInterval;
mSubscriptionUpdateMethod = credinfo.subscriptionUpdate.UpdateMethod;
mSubscriptionUpdateRestriction = credinfo.subscriptionUpdate.Restriction;
mSubscriptionUpdateURI = credinfo.subscriptionUpdate.URI;
- mSubscriptionDMAccUsername = credinfo.subscriptionUpdate.usernamePassword.Username;
- mSubscriptionDMAccPassword = credinfo.subscriptionUpdate.usernamePassword.Password;
+ mSubscriptionUpdateUsername = credinfo.subscriptionUpdate.usernamePassword.Username;
+ mSubscriptionUpdatePassword = credinfo.subscriptionUpdate.usernamePassword.Password;
- mPolicyUpdateURI = credinfo.policy.policyUpdate.URI;
+ mPolicyUpdateUri = credinfo.policy.policyUpdate.URI;
mPolicyUpdateInterval = credinfo.policy.policyUpdate.UpdateInterval;
- mPolicyDMAccUsername = credinfo.policy.policyUpdate.usernamePassword.Username;
- mPolicyDMAccPassword = credinfo.policy.policyUpdate.usernamePassword.Password;
+ mPolicyUpdateUsername = credinfo.policy.policyUpdate.usernamePassword.Username;
+ mPolicyUpdatePassword = credinfo.policy.policyUpdate.usernamePassword.Password;
mPolicyUpdateRestriction = credinfo.policy.policyUpdate.Restriction;
mPolicyUpdateMethod = credinfo.policy.policyUpdate.UpdateMethod;
mPreferredRoamingPartnerList = credinfo.policy.preferredRoamingPartnerList.values();
@@ -266,6 +199,7 @@ public class WifiPasspointCredential implements Parcelable {
mHomeOIList = credinfo.homeSP.homeOIList.values();
mFriendlyName = credinfo.homeSP.FriendlyName;
+ mCheckAaaServerCertStatus = credinfo.credential.CheckAAAServerCertStatus;
}
/** @hide */
@@ -284,8 +218,8 @@ public class WifiPasspointCredential implements Parcelable {
}
/** @hide */
- public String getWifiSPFQDN() {
- return mWifiSPFQDN;
+ public String getWifiSpFqdn() {
+ return mWifiSpFqdn;
}
/** @hide */
@@ -294,7 +228,7 @@ public class WifiPasspointCredential implements Parcelable {
}
/** @hide */
- public String getEapMethodStr() {
+ public String getType() {
return mType;
}
@@ -384,14 +318,14 @@ public class WifiPasspointCredential implements Parcelable {
return 0;
}
- return mPriority;
+ return mCrednetialPriority;
}
/**
* Get the fully qualified domain name (FQDN) of this Passpoint credential.
* @return FQDN
*/
- public String getFqdn() {
+ public String getHomeSpFqdn() {
return mHomeSpFqdn;
}
@@ -405,23 +339,23 @@ public class WifiPasspointCredential implements Parcelable {
/** @hide */
- public String getOtherhomepartners() {
- return mOtherhomepartnerFqdn;
+ public Collection<WifiPasspointDmTree.OtherHomePartners> getOtherHomePartnerList() {
+ return mOtherHomePartnerList;
}
/** @hide */
- public String getSubscriptionDMAccUsername() {
- return mSubscriptionDMAccUsername;
+ public String getSubscriptionUpdateUsername() {
+ return mSubscriptionUpdateUsername;
}
/** @hide */
- public String getSubscriptionDMAccPassword() {
- return mSubscriptionDMAccPassword;
+ public String getSubscriptionUpdatePassword() {
+ return mSubscriptionUpdatePassword;
}
/** @hide */
- public String getPolicyUpdateURI() {
- return mPolicyUpdateURI;
+ public String getPolicyUpdateUri() {
+ return mPolicyUpdateUri;
}
/** @hide */
@@ -430,13 +364,13 @@ public class WifiPasspointCredential implements Parcelable {
}
/** @hide */
- public String getPolicyDMAccUsername() {
- return mPolicyDMAccUsername;
+ public String getPolicyUpdateUsername() {
+ return mPolicyUpdateUsername;
}
/** @hide */
- public String getPolicyDMAccPassword() {
- return mPolicyDMAccPassword;
+ public String getPolicyUpdatePassword() {
+ return mPolicyUpdatePassword;
}
/** @hide */
@@ -465,12 +399,12 @@ public class WifiPasspointCredential implements Parcelable {
}
/** @hide */
- public Collection<WifiPasspointDmTree.PreferredRoamingPartnerList> getPrpList() {
+ public Collection<WifiPasspointDmTree.PreferredRoamingPartnerList> getPreferredRoamingPartnerList() {
return mPreferredRoamingPartnerList;
}
/** @hide */
- public Collection<WifiPasspointDmTree.HomeOIList> getHomeOIList() {
+ public Collection<WifiPasspointDmTree.HomeOIList> getHomeOiList() {
return mHomeOIList;
}
@@ -495,13 +429,13 @@ public class WifiPasspointCredential implements Parcelable {
}
/** @hide */
- public String getAAACertURL() {
- return mAAACertURL;
+ public String getAaaCertUrl() {
+ return mAaaCertUrl;
}
/** @hide */
- public String getAAASha256Fingerprint() {
- return mAAASha256Fingerprint;
+ public String getAaaSha256Fingerprint() {
+ return mAaaSha256Fingerprint;
}
/** @hide */
@@ -578,72 +512,75 @@ public class WifiPasspointCredential implements Parcelable {
StringBuffer sb = new StringBuffer();
String none = "<none>";
- sb.append(", UpdateIdentifier: ")
- .append(mUpdateIdentifier == null ? none : mUpdateIdentifier).
- append(", SubscriptionUpdateMethod: ")
- .append(mSubscriptionUpdateMethod == null ? none : mSubscriptionUpdateMethod).
- append(", Type: ").append(mType == null ? none : mType).
- append(", Username: ").append(mUsername == null ? none : mUsername).
- append(", Passwd: ").append(mPasswd == null ? none : mPasswd).
- append(", SubDMAccUsername: ")
- .append(mSubscriptionDMAccUsername == null ? none : mSubscriptionDMAccUsername).
- append(", SubDMAccPassword: ")
- .append(mSubscriptionDMAccPassword == null ? none : mSubscriptionDMAccPassword).
- append(", PolDMAccUsername: ")
- .append(mPolicyDMAccUsername == null ? none : mPolicyDMAccUsername).
- append(", PolDMAccPassword: ")
- .append(mPolicyDMAccPassword == null ? none : mPolicyDMAccPassword).
- append(", Imsi: ").append(mImsi == null ? none : mImsi).
- append(", Mcc: ").append(mMcc == null ? none : mMcc).
- append(", Mnc: ").append(mMnc == null ? none : mMnc).
- append(", CaRootCert: ").append(mCaRootCert == null ? none : mCaRootCert).
- append(", Realm: ").append(mRealm == null ? none : mRealm).
- append(", Priority: ").append(mPriority).
- append(", Fqdn: ").append(mHomeSpFqdn == null ? none : mHomeSpFqdn).
- append(", Otherhomepartners: ")
- .append(mOtherhomepartnerFqdn == null ? none : mOtherhomepartnerFqdn).
- append(", ExpirationDate: ")
- .append(mExpirationDate == null ? none : mExpirationDate).
- append(", MaxBssLoad: ").append(mMaxBssLoad == null ? none : mMaxBssLoad).
- append(", SPExclusionList: ").append(mSpExclusionList);
-
- if (mPreferredRoamingPartnerList != null) {
- sb.append("PreferredRoamingPartnerList:");
- for (WifiPasspointDmTree.PreferredRoamingPartnerList prpListItem : mPreferredRoamingPartnerList) {
- sb.append("[fqdnmatch:").append(prpListItem.FQDN_Match).
- append(", priority:").append(prpListItem.Priority).
- append(", country:").append(prpListItem.Country).append("]");
+ if (!DBG) {
+ sb.append(none);
+ } else {
+ sb.append(", UpdateIdentifier: ")
+ .append(mUpdateIdentifier == null ? none : mUpdateIdentifier)
+ .append(", SubscriptionUpdateMethod: ")
+ .append(mSubscriptionUpdateMethod == null ? none : mSubscriptionUpdateMethod)
+ .append(", Type: ").append(mType == null ? none : mType)
+ .append(", Username: ").append(mUsername == null ? none : mUsername)
+ .append(", Passwd: ").append(mPasswd == null ? none : mPasswd)
+ .append(", SubDMAccUsername: ")
+ .append(mSubscriptionUpdateUsername == null ? none : mSubscriptionUpdateUsername)
+ .append(", SubDMAccPassword: ")
+ .append(mSubscriptionUpdatePassword == null ? none : mSubscriptionUpdatePassword)
+ .append(", PolDMAccUsername: ")
+ .append(mPolicyUpdateUsername == null ? none : mPolicyUpdateUsername)
+ .append(", PolDMAccPassword: ")
+ .append(mPolicyUpdatePassword == null ? none : mPolicyUpdatePassword)
+ .append(", Imsi: ").append(mImsi == null ? none : mImsi)
+ .append(", Mcc: ").append(mMcc == null ? none : mMcc)
+ .append(", Mnc: ").append(mMnc == null ? none : mMnc)
+ .append(", CaRootCert: ").append(mCaRootCert == null ? none : mCaRootCert)
+ .append(", Realm: ").append(mRealm == null ? none : mRealm)
+ .append(", Priority: ").append(mCrednetialPriority)
+ .append(", Fqdn: ").append(mHomeSpFqdn == null ? none : mHomeSpFqdn)
+ .append(", Otherhomepartners: ")
+ .append(mOtherHomePartnerList == null ? none : mOtherHomePartnerList)
+ .append(", ExpirationDate: ")
+ .append(mExpirationDate == null ? none : mExpirationDate)
+ .append(", MaxBssLoad: ").append(mMaxBssLoad == null ? none : mMaxBssLoad)
+ .append(", SPExclusionList: ").append(mSpExclusionList);
+
+ if (mPreferredRoamingPartnerList != null) {
+ sb.append("PreferredRoamingPartnerList:");
+ for (WifiPasspointDmTree.PreferredRoamingPartnerList prpListItem : mPreferredRoamingPartnerList) {
+ sb.append("[fqdnmatch:").append(prpListItem.FQDN_Match).
+ append(", priority:").append(prpListItem.Priority).
+ append(", country:").append(prpListItem.Country).append("]");
+ }
}
- }
- if (mHomeOIList != null) {
- sb.append("HomeOIList:");
- for (WifiPasspointDmTree.HomeOIList HomeOIListItem : mHomeOIList) {
- sb.append("[HomeOI:").append(HomeOIListItem.HomeOI).
- append(", HomeOIRequired:").append(HomeOIListItem.HomeOIRequired).
- append("]");
+ if (mHomeOIList != null) {
+ sb.append("HomeOIList:");
+ for (WifiPasspointDmTree.HomeOIList HomeOIListItem : mHomeOIList) {
+ sb.append("[HomeOI:").append(HomeOIListItem.HomeOI).
+ append(", HomeOIRequired:").append(HomeOIListItem.HomeOIRequired).
+ append("]");
+ }
}
- }
- if (mMinBackhaulThresholdNetwork != null) {
- sb.append("BackHaulThreshold:");
- for (WifiPasspointDmTree.MinBackhaulThresholdNetwork BhtListItem : mMinBackhaulThresholdNetwork) {
- sb.append("[networkType:").append(BhtListItem.NetworkType).
- append(", dlBandwidth:").append(BhtListItem.DLBandwidth).
- append(", ulBandwidth:").append(BhtListItem.ULBandwidth).
- append("]");
+ if (mMinBackhaulThresholdNetwork != null) {
+ sb.append("BackHaulThreshold:");
+ for (WifiPasspointDmTree.MinBackhaulThresholdNetwork BhtListItem : mMinBackhaulThresholdNetwork) {
+ sb.append("[networkType:").append(BhtListItem.NetworkType).
+ append(", dlBandwidth:").append(BhtListItem.DLBandwidth).
+ append(", ulBandwidth:").append(BhtListItem.ULBandwidth).
+ append("]");
+ }
}
- }
- if (mRequiredProtoPortTuple != null) {
- sb.append("WifiMORequiredProtoPortTupleList:");
- for (WifiPasspointDmTree.RequiredProtoPortTuple RpptListItem : mRequiredProtoPortTuple) {
- sb.append("[IPProtocol:").append(RpptListItem.IPProtocol).
- append(", PortNumber:").append(RpptListItem.PortNumber).
- append("]");
+ if (mRequiredProtoPortTuple != null) {
+ sb.append("WifiMORequiredProtoPortTupleList:");
+ for (WifiPasspointDmTree.RequiredProtoPortTuple RpptListItem : mRequiredProtoPortTuple) {
+ sb.append("[IPProtocol:").append(RpptListItem.IPProtocol).
+ append(", PortNumber:").append(RpptListItem.PortNumber).
+ append("]");
+ }
}
}
-
return sb.toString();
}
@@ -654,19 +591,22 @@ public class WifiPasspointCredential implements Parcelable {
/** Implement the Parcelable interface {@hide} */
public void writeToParcel(Parcel dest, int flags) {
+ dest.writeString(mWifiSpFqdn);
+ dest.writeString(mCredentialName);
dest.writeString(mType);
- dest.writeString(mUsername);
- dest.writeString(mPasswd);
- dest.writeString(mImsi);
- dest.writeString(mMcc);
- dest.writeString(mMnc);
- dest.writeString(mCaRootCert);
- dest.writeString(mRealm);
- dest.writeInt(mPriority);
+ dest.writeInt(mCrednetialPriority);
dest.writeString(mHomeSpFqdn);
- dest.writeString(mOtherhomepartnerFqdn);
- dest.writeString(mClientCert);
- dest.writeString(mExpirationDate);
+ dest.writeString(mRealm);
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ public void readFromParcel(Parcel in) {
+ mWifiSpFqdn = in.readString();
+ mCredentialName = in.readString();
+ mType = in.readString();
+ mCrednetialPriority = in.readInt();
+ mHomeSpFqdn = in.readString();
+ mRealm = in.readString();
}
/** Implement the Parcelable interface {@hide} */
@@ -674,19 +614,12 @@ public class WifiPasspointCredential implements Parcelable {
new Creator<WifiPasspointCredential>() {
public WifiPasspointCredential createFromParcel(Parcel in) {
WifiPasspointCredential pc = new WifiPasspointCredential();
+ pc.mWifiSpFqdn = in.readString();
+ pc.mCredentialName = in.readString();
pc.mType = in.readString();
- pc.mUsername = in.readString();
- pc.mPasswd = in.readString();
- pc.mImsi = in.readString();
- pc.mMcc = in.readString();
- pc.mMnc = in.readString();
- pc.mCaRootCert = in.readString();
- pc.mRealm = in.readString();
- pc.mPriority = in.readInt();
+ pc.mCrednetialPriority = in.readInt();
pc.mHomeSpFqdn = in.readString();
- pc.mOtherhomepartnerFqdn = in.readString();
- pc.mClientCert = in.readString();
- pc.mExpirationDate = in.readString();
+ pc.mRealm = in.readString();
return pc;
}
@@ -699,9 +632,9 @@ public class WifiPasspointCredential implements Parcelable {
public int compareTo(WifiPasspointCredential another) {
//The smaller the higher
- if (mPriority < another.mPriority) {
+ if (mCrednetialPriority < another.mCrednetialPriority) {
return -1;
- } else if (mPriority == another.mPriority) {
+ } else if (mCrednetialPriority == another.mCrednetialPriority) {
return this.mType.compareTo(another.mType);
} else {
return 1;
diff --git a/wifi/java/android/net/wifi/passpoint/WifiPasspointDmTree.java b/wifi/java/android/net/wifi/passpoint/WifiPasspointDmTree.java
index 9ff1973..bbf5fc6 100644
--- a/wifi/java/android/net/wifi/passpoint/WifiPasspointDmTree.java
+++ b/wifi/java/android/net/wifi/passpoint/WifiPasspointDmTree.java
@@ -25,19 +25,17 @@ import java.util.HashMap;
/**
* Required Mobile Device Management Tree Structure
*
- * +----------+
- * | ./(Root) |
- * +----+-----+
- * |
- * +---------+ | +---------+ +---------+
- * | DevInfo |-----------+---------| Wi-Fi |---|SP FQDN* |
- * +---------+ | +---------+ +---------+
- * +---------+ |
- * |DevDetail|-----------+
- * +---------+
- *
- * For example,
- * ./Wi-Fi/wi-fi.org/PerproviderSubscription/Cred01/Policy/PreferredRoamingPartnerList/Roa01/FQDN_Math
+ * +----------+
+ * | ./(Root) |
+ * +----+-----+
+ * |
+ * +---------+ | +---------+ +---------+
+ * | DevInfo |-----------+---------| Wi-Fi |--|SP FQDN* |
+ * +---------+ | +---------+ +---------+
+ * +---------+ | |
+ * |DevDetail|-----------+ +-----------------------+
+ * +---------+ |PerproviderSubscription|--<X>+
+ * +-----------------------+
*
* This class contains all nodes start from Wi-Fi
* @hide
diff --git a/wifi/java/android/net/wifi/passpoint/WifiPasspointPolicy.java b/wifi/java/android/net/wifi/passpoint/WifiPasspointPolicy.java
index 5f76562..9fccf0a 100644
--- a/wifi/java/android/net/wifi/passpoint/WifiPasspointPolicy.java
+++ b/wifi/java/android/net/wifi/passpoint/WifiPasspointPolicy.java
@@ -35,7 +35,7 @@ public class WifiPasspointPolicy implements Parcelable {
public static final int UNRESTRICTED = 2;
private String mName;
- private int mSubscriptionPriority;
+ private int mCredentialPriority;
private int mRoamingPriority;
private String mBssid;
private String mSsid;
@@ -44,11 +44,13 @@ public class WifiPasspointPolicy implements Parcelable {
private boolean mIsHomeSp;
/** @hide */
- public WifiPasspointPolicy(String name, int priority, String ssid,
+ public WifiPasspointPolicy(String name, String ssid,
String bssid, WifiPasspointCredential pc,
int restriction, boolean ishomesp) {
mName = name;
- mSubscriptionPriority = priority;
+ if (pc != null) {
+ mCredentialPriority = pc.getPriority();
+ }
//PerProviderSubscription/<X+>/Policy/PreferredRoamingPartnerList/<X+>/Priority
mRoamingPriority = 128; //default priority value of 128
mSsid = ssid;
@@ -102,8 +104,8 @@ public class WifiPasspointPolicy implements Parcelable {
}
/** @hide */
- public void setSubscriptionPriority(int priority) {
- mSubscriptionPriority = priority;
+ public void setCredentialPriority(int priority) {
+ mCredentialPriority = priority;
}
/** @hide */
@@ -111,8 +113,8 @@ public class WifiPasspointPolicy implements Parcelable {
mRoamingPriority = priority;
}
- public int getSubscriptionPriority() {
- return mSubscriptionPriority;
+ public int getCredentialPriority() {
+ return mCredentialPriority;
}
public int getRoamingPriority() {
@@ -132,11 +134,11 @@ public class WifiPasspointPolicy implements Parcelable {
return -1;
} else if ((this.mIsHomeSp == true && another.getHomeSp() == true)) {
Log.d(TAG, "both HomeSP");
- //if both home sp, compare subscription priority
- if (this.mSubscriptionPriority < another.getSubscriptionPriority()) {
+ //if both home sp, compare credential priority
+ if (this.mCredentialPriority < another.getCredentialPriority()) {
Log.d(TAG, "this priority is higher");
return -1;
- } else if (this.mSubscriptionPriority == another.getSubscriptionPriority()) {
+ } else if (this.mCredentialPriority == another.getCredentialPriority()) {
Log.d(TAG, "both priorities equal");
//if priority still the same, compare name(ssid)
if (this.mName.compareTo(another.mName) != 0) {
@@ -192,7 +194,7 @@ public class WifiPasspointPolicy implements Parcelable {
@Override
/** @hide */
public String toString() {
- return "PasspointPolicy: name=" + mName + " SubscriptionPriority=" + mSubscriptionPriority +
+ return "PasspointPolicy: name=" + mName + " CredentialPriority=" + mCredentialPriority +
" mRoamingPriority" + mRoamingPriority +
" ssid=" + mSsid + " restriction=" + mRestriction +
" ishomesp=" + mIsHomeSp + " Credential=" + mCredential;