diff options
| author | 2021-03-29 14:59:14 +0900 | |
|---|---|---|
| committer | 2021-03-30 23:54:19 +0900 | |
| commit | 8f98eb9c08f71d4b1bd727a0686dadc261b4cb00 (patch) | |
| tree | 05388e2da567cf3b1b3eac8c451b6d19e65e5596 | |
| parent | 2c2e476bbda1f27b8d346baf246fd01d542e6016 (diff) | |
[NS08] Expose public NetworkScore API
This exposes the two bits settable by the network agents in
Android S on NetworkScore. This is meant to be extensible in
future releases, or possibly for OEM upstreams.
Test: builds
CTS-Coverage-Bug: 184037351
Bug: 167544279
Change-Id: Id7ee1bd3e2679f0bd5200d5c299f18a33b87847c
| -rw-r--r-- | packages/Connectivity/framework/api/system-current.txt | 4 | ||||
| -rw-r--r-- | packages/Connectivity/framework/src/android/net/NetworkScore.java | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/packages/Connectivity/framework/api/system-current.txt b/packages/Connectivity/framework/api/system-current.txt index 6c3b6201180c..2cae99fbb326 100644 --- a/packages/Connectivity/framework/api/system-current.txt +++ b/packages/Connectivity/framework/api/system-current.txt @@ -341,6 +341,8 @@ package android.net { method public int describeContents(); method public int getKeepConnectedReason(); method public int getLegacyInt(); + method public boolean isExiting(); + method public boolean isTransportPrimary(); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkScore> CREATOR; field public static final int KEEP_CONNECTED_FOR_HANDOVER = 1; // 0x1 @@ -350,8 +352,10 @@ package android.net { public static final class NetworkScore.Builder { ctor public NetworkScore.Builder(); method @NonNull public android.net.NetworkScore build(); + method @NonNull public android.net.NetworkScore.Builder setExiting(boolean); method @NonNull public android.net.NetworkScore.Builder setKeepConnectedReason(int); method @NonNull public android.net.NetworkScore.Builder setLegacyInt(int); + method @NonNull public android.net.NetworkScore.Builder setTransportPrimary(boolean); } public final class OemNetworkPreferences implements android.os.Parcelable { diff --git a/packages/Connectivity/framework/src/android/net/NetworkScore.java b/packages/Connectivity/framework/src/android/net/NetworkScore.java index 22663e58000a..1c235f470157 100644 --- a/packages/Connectivity/framework/src/android/net/NetworkScore.java +++ b/packages/Connectivity/framework/src/android/net/NetworkScore.java @@ -146,7 +146,7 @@ public final class NetworkScore implements Parcelable { * * @hide */ - // TODO : @SystemApi + @SystemApi public boolean isTransportPrimary() { return hasPolicy(POLICY_TRANSPORT_PRIMARY); } @@ -163,7 +163,7 @@ public final class NetworkScore implements Parcelable { * * @hide */ - // TODO : @SystemApi + @SystemApi public boolean isExiting() { return hasPolicy(POLICY_EXITING); } @@ -256,7 +256,7 @@ public final class NetworkScore implements Parcelable { * @return this builder * @hide */ - // TODO : @SystemApi + @SystemApi @NonNull public Builder setTransportPrimary(final boolean val) { if (val) { @@ -281,7 +281,7 @@ public final class NetworkScore implements Parcelable { * @return this builder * @hide */ - // TODO : @SystemApi + @SystemApi @NonNull public Builder setExiting(final boolean val) { if (val) { |