diff options
| author | 2021-03-23 16:17:37 +0800 | |
|---|---|---|
| committer | 2021-03-25 08:15:09 +0000 | |
| commit | 5aea42137f6caf3cc402eb1b10915ea563ec00a6 (patch) | |
| tree | 18438e8395d220fb7f7d45324d5d4725cb2707c6 | |
| parent | 4eca6d0c5ce7f54adfcf042cd5c6d6e1704edfcd (diff) | |
Expose NetworkScore to external caller
NetworkScore will be a part of mainline module, so the external
callers cannot call its hidden APIs. Expose needed APIs to
the external callers.
CTS-Coverage-Bug: 182963397
Bug: 182963397
Test: m
Change-Id: Iddf8c71a5f51a40bc6ff78626b3e8ee530d1b7eb
Merged-In: Iddf8c71a5f51a40bc6ff78626b3e8ee530d1b7eb
(cherry-picked from ag/13947595)
| -rw-r--r-- | packages/Connectivity/framework/api/system-current.txt | 13 | ||||
| -rw-r--r-- | packages/Connectivity/framework/src/android/net/NetworkScore.java | 5 |
2 files changed, 17 insertions, 1 deletions
diff --git a/packages/Connectivity/framework/api/system-current.txt b/packages/Connectivity/framework/api/system-current.txt index 703fca408f7a..8c1fae91eb42 100644 --- a/packages/Connectivity/framework/api/system-current.txt +++ b/packages/Connectivity/framework/api/system-current.txt @@ -316,6 +316,19 @@ package android.net { method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_SIGNAL_STRENGTH_WAKEUP) public android.net.NetworkRequest.Builder setSignalStrength(int); } + public final class NetworkScore implements android.os.Parcelable { + method public int describeContents(); + method public int getLegacyInt(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkScore> CREATOR; + } + + public static final class NetworkScore.Builder { + ctor public NetworkScore.Builder(); + method @NonNull public android.net.NetworkScore build(); + method @NonNull public android.net.NetworkScore.Builder setLegacyInt(int); + } + public final class OemNetworkPreferences implements android.os.Parcelable { method public int describeContents(); method @NonNull public java.util.Map<java.lang.String,java.lang.Integer> getNetworkPreferences(); diff --git a/packages/Connectivity/framework/src/android/net/NetworkScore.java b/packages/Connectivity/framework/src/android/net/NetworkScore.java index eadcb2d0a7f4..65849930fa4a 100644 --- a/packages/Connectivity/framework/src/android/net/NetworkScore.java +++ b/packages/Connectivity/framework/src/android/net/NetworkScore.java @@ -17,6 +17,7 @@ package android.net; import android.annotation.NonNull; +import android.annotation.SystemApi; import android.os.Parcel; import android.os.Parcelable; @@ -29,7 +30,7 @@ import com.android.internal.annotations.VisibleForTesting; * network is considered for a particular use. * @hide */ -// TODO : @SystemApi when the implementation is complete +@SystemApi public final class NetworkScore implements Parcelable { // This will be removed soon. Do *NOT* depend on it for any new code that is not part of // a migration. @@ -62,6 +63,8 @@ public final class NetworkScore implements Parcelable { /** * @return whether this score has a particular policy. + * + * @hide */ @VisibleForTesting public boolean hasPolicy(final int policy) { |