From 15532c07b405b7cf2594bd0cd03005741b3abd45 Mon Sep 17 00:00:00 2001 From: Hai Shalom Date: Tue, 15 Sep 2020 15:32:11 -0700 Subject: [PATCH] [Passpoint] Unhide HomeSP APIs used for matching Unhide HomeSP APIs used for profile matching: setOtherHomePartners getOtherHomePartners setMatchAnyOis getMatchAnyOis setMatchAllOis getMatchAllOis This will allow apps to program these values and take advantage of the new matching logic implemented in the framework. Bug: 168652313 Test: atest HomeSpTest Change-Id: Ibba74d21526125f4be5d541656f8ed2a580cdad7 --- api/current.txt | 6 ++ wifi/api/current.txt | 6 ++ .../android/net/wifi/hotspot2/pps/HomeSp.java | 59 ++++++++++++++----- 3 files changed, 57 insertions(+), 14 deletions(-) diff --git a/api/current.txt b/api/current.txt index 0f4cffc9427b6..8b62fc43c8e3a 100644 --- a/api/current.txt +++ b/api/current.txt @@ -32002,9 +32002,15 @@ package android.net.wifi.hotspot2.pps { method public int describeContents(); method public String getFqdn(); method public String getFriendlyName(); + method @Nullable public long[] getMatchAllOis(); + method @Nullable public long[] getMatchAnyOis(); + method @Nullable public String[] getOtherHomePartners(); method public long[] getRoamingConsortiumOis(); method public void setFqdn(String); method public void setFriendlyName(String); + method public void setMatchAllOis(@Nullable long[]); + method public void setMatchAnyOis(@Nullable long[]); + method public void setOtherHomePartners(@Nullable String[]); method public void setRoamingConsortiumOis(long[]); method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator CREATOR; diff --git a/wifi/api/current.txt b/wifi/api/current.txt index 3f5c673eeb81c..1c297e7058dd2 100644 --- a/wifi/api/current.txt +++ b/wifi/api/current.txt @@ -798,9 +798,15 @@ package android.net.wifi.hotspot2.pps { method public int describeContents(); method public String getFqdn(); method public String getFriendlyName(); + method @Nullable public long[] getMatchAllOis(); + method @Nullable public long[] getMatchAnyOis(); + method @Nullable public String[] getOtherHomePartners(); method public long[] getRoamingConsortiumOis(); method public void setFqdn(String); method public void setFriendlyName(String); + method public void setMatchAllOis(@Nullable long[]); + method public void setMatchAnyOis(@Nullable long[]); + method public void setOtherHomePartners(@Nullable String[]); method public void setRoamingConsortiumOis(long[]); method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator CREATOR; diff --git a/wifi/java/android/net/wifi/hotspot2/pps/HomeSp.java b/wifi/java/android/net/wifi/hotspot2/pps/HomeSp.java index 8f34579f6a5dd..35a8ff6095e0d 100644 --- a/wifi/java/android/net/wifi/hotspot2/pps/HomeSp.java +++ b/wifi/java/android/net/wifi/hotspot2/pps/HomeSp.java @@ -16,6 +16,7 @@ package android.net.wifi.hotspot2.pps; +import android.annotation.Nullable; import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; @@ -139,16 +140,26 @@ public final class HomeSp implements Parcelable { * (MO) tree for more detail. */ private long[] mMatchAllOis = null; + /** - * @hide + * Set a list of HomeOIs such that all OIs in the list must match an OI in the Roaming + * Consortium advertised by a hotspot operator. The list set by this API will have precedence + * over {@link #setMatchAnyOis(long[])}, meaning the list set in {@link #setMatchAnyOis(long[])} + * will only be used for matching if the list set by this API is null or empty. + * + * @param matchAllOis An array of longs containing the HomeOIs */ - public void setMatchAllOis(long[] matchAllOis) { + public void setMatchAllOis(@Nullable long[] matchAllOis) { mMatchAllOis = matchAllOis; } + /** - * @hide + * Get the list of HomeOIs such that all OIs in the list must match an OI in the Roaming + * Consortium advertised by a hotspot operator. + * + * @return An array of longs containing the HomeOIs */ - public long[] getMatchAllOis() { + public @Nullable long[] getMatchAllOis() { return mMatchAllOis; } @@ -159,23 +170,34 @@ public final class HomeSp implements Parcelable { * of that Hotspot provider (e.g. successful authentication with such Hotspot * is possible). * - * {@link #mMatchAllOIs} will have precedence over this one, meaning this list will - * only be used for matching if {@link #mMatchAllOIs} is null or empty. + * The list set by {@link #setMatchAllOis(long[])} will have precedence over this one, meaning + * this list will only be used for matching if the list set by {@link #setMatchAllOis(long[])} + * is null or empty. * * Refer to HomeSP/HomeOIList subtree in PerProviderSubscription (PPS) Management Object * (MO) tree for more detail. */ private long[] mMatchAnyOis = null; + /** - * @hide + * Set a list of HomeOIs such that any OI in the list matches an OI in the Roaming Consortium + * advertised by a hotspot operator. The list set by {@link #setMatchAllOis(long[])} + * will have precedence over this API, meaning this list will only be used for matching if the + * list set by {@link #setMatchAllOis(long[])} is null or empty. + * + * @param matchAnyOis An array of longs containing the HomeOIs */ - public void setMatchAnyOis(long[] matchAnyOis) { + public void setMatchAnyOis(@Nullable long[] matchAnyOis) { mMatchAnyOis = matchAnyOis; } + /** - * @hide + * Get a list of HomeOIs such that any OI in the list matches an OI in the Roaming Consortium + * advertised by a hotspot operator. + * + * @return An array of longs containing the HomeOIs */ - public long[] getMatchAnyOis() { + public @Nullable long[] getMatchAnyOis() { return mMatchAnyOis; } @@ -186,16 +208,25 @@ public final class HomeSp implements Parcelable { * operator merges between the providers. */ private String[] mOtherHomePartners = null; + /** - * @hide + * Set the list of FQDN (Fully Qualified Domain Name) of other Home partner providers. + * + * @param otherHomePartners Array of Strings containing the FQDNs of other Home partner + * providers */ - public void setOtherHomePartners(String[] otherHomePartners) { + public void setOtherHomePartners(@Nullable String[] otherHomePartners) { mOtherHomePartners = otherHomePartners; } + /** - * @hide + * Get the list of FQDN (Fully Qualified Domain Name) of other Home partner providers set in + * the profile. + * + * @return Array of Strings containing the FQDNs of other Home partner providers set in the + * profile */ - public String[] getOtherHomePartners() { + public @Nullable String[] getOtherHomePartners() { return mOtherHomePartners; }