Merge changes I6260695b,I88f00ca4

* changes:
  Expose clearCapabilities for mainline module
  Expose NetworkSpecifier methods as SystemApi
This commit is contained in:
Treehugger Robot
2020-01-09 03:43:57 +00:00
committed by Gerrit Code Review
4 changed files with 26 additions and 3 deletions

View File

@@ -29160,6 +29160,7 @@ package android.net {
method public android.net.NetworkRequest.Builder addCapability(int);
method public android.net.NetworkRequest.Builder addTransportType(int);
method public android.net.NetworkRequest build();
method @NonNull public android.net.NetworkRequest.Builder clearCapabilities();
method public android.net.NetworkRequest.Builder removeCapability(int);
method public android.net.NetworkRequest.Builder removeTransportType(int);
method public android.net.NetworkRequest.Builder setNetworkSpecifier(String);

View File

@@ -4376,6 +4376,7 @@ package android.net {
public final class MatchAllNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
ctor public MatchAllNetworkSpecifier();
method public int describeContents();
method public boolean satisfiedBy(android.net.NetworkSpecifier);
method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.net.MatchAllNetworkSpecifier> CREATOR;
}
@@ -4439,6 +4440,12 @@ package android.net {
method public void updateScores(@NonNull java.util.List<android.net.ScoredNetwork>);
}
public abstract class NetworkSpecifier {
method public void assertValidFromUid(int);
method @Nullable public android.net.NetworkSpecifier redact();
method public abstract boolean satisfiedBy(@Nullable android.net.NetworkSpecifier);
}
public class NetworkStack {
field public static final String PERMISSION_MAINLINE_NETWORK_STACK = "android.permission.MAINLINE_NETWORK_STACK";
}
@@ -4509,6 +4516,7 @@ package android.net {
public final class StringNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
ctor public StringNetworkSpecifier(@NonNull String);
method public int describeContents();
method public boolean satisfiedBy(android.net.NetworkSpecifier);
method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.net.StringNetworkSpecifier> CREATOR;
field @NonNull public final String specifier;
@@ -5382,6 +5390,10 @@ package android.net.wifi {
field public int numUsage;
}
public final class WifiNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
method public boolean satisfiedBy(android.net.NetworkSpecifier);
}
public class WifiScanner {
method @Deprecated public void configureWifiChange(int, int, int, int, int, android.net.wifi.WifiScanner.BssidInfo[]);
method @Deprecated public void configureWifiChange(android.net.wifi.WifiScanner.WifiChangeSettings);
@@ -5546,6 +5558,10 @@ package android.net.wifi.aware {
method @Deprecated public android.net.NetworkSpecifier createNetworkSpecifierPmk(@NonNull android.net.wifi.aware.PeerHandle, @NonNull byte[]);
}
public final class WifiAwareNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
method public boolean satisfiedBy(android.net.NetworkSpecifier);
}
public static final class WifiAwareNetworkSpecifier.Builder {
method @NonNull public android.net.wifi.aware.WifiAwareNetworkSpecifier.Builder setPmk(@NonNull byte[]);
}

View File

@@ -247,9 +247,8 @@ public class NetworkRequest implements Parcelable {
* removing even the capabilities that are set by default when the object is constructed.
*
* @return The builder to facilitate chaining.
* @hide
*/
@UnsupportedAppUsage
@NonNull
public Builder clearCapabilities() {
mNetworkCapabilities.clearAll();
return this;

View File

@@ -16,6 +16,9 @@
package android.net;
import android.annotation.Nullable;
import android.annotation.SystemApi;
/**
* Describes specific properties of a requested network for use in a {@link NetworkRequest}.
*
@@ -31,7 +34,8 @@ public abstract class NetworkSpecifier {
*
* @hide
*/
public abstract boolean satisfiedBy(NetworkSpecifier other);
@SystemApi
public abstract boolean satisfiedBy(@Nullable NetworkSpecifier other);
/**
* Optional method which can be overridden by concrete implementations of NetworkSpecifier to
@@ -45,6 +49,7 @@ public abstract class NetworkSpecifier {
*
* @hide
*/
@SystemApi
public void assertValidFromUid(int requestorUid) {
// empty
}
@@ -68,6 +73,8 @@ public abstract class NetworkSpecifier {
*
* @hide
*/
@SystemApi
@Nullable
public NetworkSpecifier redact() {
// TODO (b/122160111): convert default to null once all platform NetworkSpecifiers
// implement this method.