Merge "Make MatchAllNetworkSpecifier constructor @SystemApi"

This commit is contained in:
Aaron Huang
2019-12-25 08:07:00 +00:00
committed by Gerrit Code Review
2 changed files with 14 additions and 2 deletions

View File

@@ -4350,6 +4350,13 @@ package android.net {
method public void setValidatedPrivateDnsServers(@NonNull java.util.Collection<java.net.InetAddress>); method public void setValidatedPrivateDnsServers(@NonNull java.util.Collection<java.net.InetAddress>);
} }
public final class MatchAllNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
ctor public MatchAllNetworkSpecifier();
method public int describeContents();
method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.net.MatchAllNetworkSpecifier> CREATOR;
}
public class Network implements android.os.Parcelable { public class Network implements android.os.Parcelable {
ctor public Network(@NonNull android.net.Network); ctor public Network(@NonNull android.net.Network);
method @NonNull public android.net.Network getPrivateDnsBypassingCopy(); method @NonNull public android.net.Network getPrivateDnsBypassingCopy();

View File

@@ -16,6 +16,8 @@
package android.net; package android.net;
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
@@ -27,10 +29,12 @@ import android.os.Parcelable;
* *
* @hide * @hide
*/ */
@SystemApi
public final class MatchAllNetworkSpecifier extends NetworkSpecifier implements Parcelable { public final class MatchAllNetworkSpecifier extends NetworkSpecifier implements Parcelable {
/** /**
* Utility method which verifies that the ns argument is not a MatchAllNetworkSpecifier and * Utility method which verifies that the ns argument is not a MatchAllNetworkSpecifier and
* throws an IllegalArgumentException if it is. * throws an IllegalArgumentException if it is.
* @hide
*/ */
public static void checkNotMatchAllNetworkSpecifier(NetworkSpecifier ns) { public static void checkNotMatchAllNetworkSpecifier(NetworkSpecifier ns) {
if (ns instanceof MatchAllNetworkSpecifier) { if (ns instanceof MatchAllNetworkSpecifier) {
@@ -38,6 +42,7 @@ public final class MatchAllNetworkSpecifier extends NetworkSpecifier implements
} }
} }
/** @hide */
public boolean satisfiedBy(NetworkSpecifier other) { public boolean satisfiedBy(NetworkSpecifier other) {
/* /*
* The method is called by a NetworkRequest to see if it is satisfied by a proposed * The method is called by a NetworkRequest to see if it is satisfied by a proposed
@@ -64,11 +69,11 @@ public final class MatchAllNetworkSpecifier extends NetworkSpecifier implements
} }
@Override @Override
public void writeToParcel(Parcel dest, int flags) { public void writeToParcel(@NonNull Parcel dest, int flags) {
// Nothing to write. // Nothing to write.
} }
public static final @android.annotation.NonNull Parcelable.Creator<MatchAllNetworkSpecifier> CREATOR = public static final @NonNull Parcelable.Creator<MatchAllNetworkSpecifier> CREATOR =
new Parcelable.Creator<MatchAllNetworkSpecifier>() { new Parcelable.Creator<MatchAllNetworkSpecifier>() {
public MatchAllNetworkSpecifier createFromParcel(Parcel in) { public MatchAllNetworkSpecifier createFromParcel(Parcel in) {
return new MatchAllNetworkSpecifier(); return new MatchAllNetworkSpecifier();