Merge "Add additional SystemApi for NetworkStack"
This commit is contained in:
@@ -3081,7 +3081,12 @@ package android.net {
|
||||
method public void onTetheringStarted();
|
||||
}
|
||||
|
||||
public final class IpPrefix implements android.os.Parcelable {
|
||||
ctor public IpPrefix(java.net.InetAddress, int);
|
||||
}
|
||||
|
||||
public class LinkAddress implements android.os.Parcelable {
|
||||
ctor public LinkAddress(java.net.InetAddress, int, int, int);
|
||||
ctor public LinkAddress(java.net.InetAddress, int);
|
||||
ctor public LinkAddress(String);
|
||||
method public boolean isGlobalPreferred();
|
||||
@@ -3092,9 +3097,12 @@ package android.net {
|
||||
|
||||
public final class LinkProperties implements android.os.Parcelable {
|
||||
ctor public LinkProperties();
|
||||
ctor public LinkProperties(android.net.LinkProperties);
|
||||
method public boolean addDnsServer(java.net.InetAddress);
|
||||
method public boolean addRoute(android.net.RouteInfo);
|
||||
method public void clear();
|
||||
method @Nullable public android.net.IpPrefix getNat64Prefix();
|
||||
method public java.util.List<java.net.InetAddress> getPcscfServers();
|
||||
method public String getTcpBufferSizes();
|
||||
method public java.util.List<java.net.InetAddress> getValidatedPrivateDnsServers();
|
||||
method public boolean hasGlobalIPv6Address();
|
||||
@@ -3112,6 +3120,8 @@ package android.net {
|
||||
method public void setInterfaceName(String);
|
||||
method public void setLinkAddresses(java.util.Collection<android.net.LinkAddress>);
|
||||
method public void setMtu(int);
|
||||
method public void setNat64Prefix(android.net.IpPrefix);
|
||||
method public void setPcscfServers(java.util.Collection<java.net.InetAddress>);
|
||||
method public void setPrivateDnsServerName(@Nullable String);
|
||||
method public void setTcpBufferSizes(String);
|
||||
method public void setUsePrivateDns(boolean);
|
||||
@@ -3166,6 +3176,7 @@ package android.net {
|
||||
}
|
||||
|
||||
public final class RouteInfo implements android.os.Parcelable {
|
||||
ctor public RouteInfo(android.net.IpPrefix, java.net.InetAddress, String, int);
|
||||
method public int getType();
|
||||
field public static final int RTN_THROW = 9; // 0x9
|
||||
field public static final int RTN_UNICAST = 1; // 0x1
|
||||
@@ -3299,6 +3310,7 @@ package android.net.metrics {
|
||||
}
|
||||
|
||||
public class IpConnectivityLog {
|
||||
ctor public IpConnectivityLog();
|
||||
method public boolean log(long, android.net.metrics.IpConnectivityLog.Event);
|
||||
method public boolean log(String, android.net.metrics.IpConnectivityLog.Event);
|
||||
method public boolean log(android.net.Network, int[], android.net.metrics.IpConnectivityLog.Event);
|
||||
@@ -3347,6 +3359,20 @@ package android.net.metrics {
|
||||
field public static final int NETWORK_VALIDATION_FAILED = 3; // 0x3
|
||||
}
|
||||
|
||||
public final class RaEvent implements android.net.metrics.IpConnectivityLog.Event {
|
||||
}
|
||||
|
||||
public static class RaEvent.Builder {
|
||||
ctor public RaEvent.Builder();
|
||||
method public android.net.metrics.RaEvent build();
|
||||
method public android.net.metrics.RaEvent.Builder updateDnsslLifetime(long);
|
||||
method public android.net.metrics.RaEvent.Builder updatePrefixPreferredLifetime(long);
|
||||
method public android.net.metrics.RaEvent.Builder updatePrefixValidLifetime(long);
|
||||
method public android.net.metrics.RaEvent.Builder updateRdnssLifetime(long);
|
||||
method public android.net.metrics.RaEvent.Builder updateRouteInfoLifetime(long);
|
||||
method public android.net.metrics.RaEvent.Builder updateRouterLifetime(long);
|
||||
}
|
||||
|
||||
public final class ValidationProbeEvent implements android.net.metrics.IpConnectivityLog.Event {
|
||||
method public static String getProbeName(int);
|
||||
field public static final int DNS_FAILURE = 0; // 0x0
|
||||
|
||||
@@ -611,11 +611,16 @@ package android.net {
|
||||
field public static final String EXTRA_CAPTIVE_PORTAL_USER_AGENT = "android.net.extra.CAPTIVE_PORTAL_USER_AGENT";
|
||||
}
|
||||
|
||||
public final class IpPrefix implements android.os.Parcelable {
|
||||
ctor public IpPrefix(java.net.InetAddress, int);
|
||||
}
|
||||
|
||||
public final class IpSecManager {
|
||||
field public static final int INVALID_SECURITY_PARAMETER_INDEX = 0; // 0x0
|
||||
}
|
||||
|
||||
public class LinkAddress implements android.os.Parcelable {
|
||||
ctor public LinkAddress(java.net.InetAddress, int, int, int);
|
||||
method public boolean isGlobalPreferred();
|
||||
method public boolean isIPv4();
|
||||
method public boolean isIPv6();
|
||||
@@ -623,7 +628,10 @@ package android.net {
|
||||
}
|
||||
|
||||
public final class LinkProperties implements android.os.Parcelable {
|
||||
ctor public LinkProperties(android.net.LinkProperties);
|
||||
method public boolean addDnsServer(java.net.InetAddress);
|
||||
method @Nullable public android.net.IpPrefix getNat64Prefix();
|
||||
method public java.util.List<java.net.InetAddress> getPcscfServers();
|
||||
method public String getTcpBufferSizes();
|
||||
method public java.util.List<java.net.InetAddress> getValidatedPrivateDnsServers();
|
||||
method public boolean hasGlobalIPv6Address();
|
||||
@@ -635,6 +643,8 @@ package android.net {
|
||||
method public boolean isReachable(java.net.InetAddress);
|
||||
method public boolean removeDnsServer(java.net.InetAddress);
|
||||
method public boolean removeRoute(android.net.RouteInfo);
|
||||
method public void setNat64Prefix(android.net.IpPrefix);
|
||||
method public void setPcscfServers(java.util.Collection<java.net.InetAddress>);
|
||||
method public void setPrivateDnsServerName(@Nullable String);
|
||||
method public void setTcpBufferSizes(String);
|
||||
method public void setUsePrivateDns(boolean);
|
||||
@@ -652,6 +662,7 @@ package android.net {
|
||||
}
|
||||
|
||||
public final class RouteInfo implements android.os.Parcelable {
|
||||
ctor public RouteInfo(android.net.IpPrefix, java.net.InetAddress, String, int);
|
||||
method public int getType();
|
||||
field public static final int RTN_THROW = 9; // 0x9
|
||||
field public static final int RTN_UNICAST = 1; // 0x1
|
||||
@@ -738,6 +749,7 @@ package android.net.metrics {
|
||||
}
|
||||
|
||||
public class IpConnectivityLog {
|
||||
ctor public IpConnectivityLog();
|
||||
method public boolean log(long, android.net.metrics.IpConnectivityLog.Event);
|
||||
method public boolean log(String, android.net.metrics.IpConnectivityLog.Event);
|
||||
method public boolean log(android.net.Network, int[], android.net.metrics.IpConnectivityLog.Event);
|
||||
@@ -786,6 +798,20 @@ package android.net.metrics {
|
||||
field public static final int NETWORK_VALIDATION_FAILED = 3; // 0x3
|
||||
}
|
||||
|
||||
public final class RaEvent implements android.net.metrics.IpConnectivityLog.Event {
|
||||
}
|
||||
|
||||
public static class RaEvent.Builder {
|
||||
ctor public RaEvent.Builder();
|
||||
method public android.net.metrics.RaEvent build();
|
||||
method public android.net.metrics.RaEvent.Builder updateDnsslLifetime(long);
|
||||
method public android.net.metrics.RaEvent.Builder updatePrefixPreferredLifetime(long);
|
||||
method public android.net.metrics.RaEvent.Builder updatePrefixValidLifetime(long);
|
||||
method public android.net.metrics.RaEvent.Builder updateRdnssLifetime(long);
|
||||
method public android.net.metrics.RaEvent.Builder updateRouteInfoLifetime(long);
|
||||
method public android.net.metrics.RaEvent.Builder updateRouterLifetime(long);
|
||||
}
|
||||
|
||||
public final class ValidationProbeEvent implements android.net.metrics.IpConnectivityLog.Event {
|
||||
method public static String getProbeName(int);
|
||||
field public static final int DNS_FAILURE = 0; // 0x0
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package android.net;
|
||||
|
||||
import android.annotation.SystemApi;
|
||||
import android.annotation.TestApi;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Pair;
|
||||
@@ -83,6 +85,8 @@ public final class IpPrefix implements Parcelable {
|
||||
* @param prefixLength the prefix length. Must be >= 0 and <= (32 or 128) (IPv4 or IPv6).
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public IpPrefix(InetAddress address, int prefixLength) {
|
||||
// We don't reuse the (byte[], int) constructor because it calls clone() on the byte array,
|
||||
// which is unnecessary because getAddress() already returns a clone.
|
||||
|
||||
@@ -162,6 +162,8 @@ public class LinkAddress implements Parcelable {
|
||||
* {@link OsConstants#RT_SCOPE_LINK} or {@link OsConstants#RT_SCOPE_SITE}).
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public LinkAddress(InetAddress address, int prefixLength, int flags, int scope) {
|
||||
init(address, prefixLength, flags, scope);
|
||||
}
|
||||
|
||||
@@ -174,7 +174,8 @@ public final class LinkProperties implements Parcelable {
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public LinkProperties(LinkProperties source) {
|
||||
if (source != null) {
|
||||
mIfaceName = source.mIfaceName;
|
||||
@@ -576,6 +577,8 @@ public final class LinkProperties implements Parcelable {
|
||||
* @param addresses The {@link Collection} of PCSCF servers to set in this object.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public void setPcscfServers(Collection<InetAddress> pcscfServers) {
|
||||
mPcscfs.clear();
|
||||
for (InetAddress pcscfServer: pcscfServers) {
|
||||
@@ -590,6 +593,8 @@ public final class LinkProperties implements Parcelable {
|
||||
* this link.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public List<InetAddress> getPcscfServers() {
|
||||
return Collections.unmodifiableList(mPcscfs);
|
||||
}
|
||||
@@ -781,6 +786,8 @@ public final class LinkProperties implements Parcelable {
|
||||
* @return the NAT64 prefix.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public @Nullable IpPrefix getNat64Prefix() {
|
||||
return mNat64Prefix;
|
||||
}
|
||||
@@ -794,6 +801,8 @@ public final class LinkProperties implements Parcelable {
|
||||
* @param prefix the NAT64 prefix.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public void setNat64Prefix(IpPrefix prefix) {
|
||||
if (prefix != null && prefix.getPrefixLength() != 96) {
|
||||
throw new IllegalArgumentException("Only 96-bit prefixes are supported: " + prefix);
|
||||
|
||||
@@ -110,6 +110,8 @@ public final class RouteInfo implements Parcelable {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public RouteInfo(IpPrefix destination, InetAddress gateway, String iface, int type) {
|
||||
switch (type) {
|
||||
case RTN_UNICAST:
|
||||
|
||||
@@ -18,7 +18,6 @@ package android.net.metrics;
|
||||
|
||||
import android.annotation.SystemApi;
|
||||
import android.annotation.TestApi;
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import android.net.ConnectivityMetricsEvent;
|
||||
import android.net.IIpConnectivityMetrics;
|
||||
import android.net.Network;
|
||||
@@ -51,7 +50,8 @@ public class IpConnectivityLog {
|
||||
public interface Event extends Parcelable {}
|
||||
|
||||
/** @hide */
|
||||
@UnsupportedAppUsage
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public IpConnectivityLog() {
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
|
||||
package android.net.metrics;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import android.annotation.SystemApi;
|
||||
import android.annotation.TestApi;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
@@ -24,19 +25,28 @@ import android.os.Parcelable;
|
||||
* An event logged when the APF packet socket receives an RA packet.
|
||||
* {@hide}
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public final class RaEvent implements IpConnectivityLog.Event {
|
||||
|
||||
public static final long NO_LIFETIME = -1L;
|
||||
private static final long NO_LIFETIME = -1L;
|
||||
|
||||
// Lifetime in seconds of options found in a single RA packet.
|
||||
// When an option is not set, the value of the associated field is -1;
|
||||
/** @hide */
|
||||
public final long routerLifetime;
|
||||
/** @hide */
|
||||
public final long prefixValidLifetime;
|
||||
/** @hide */
|
||||
public final long prefixPreferredLifetime;
|
||||
/** @hide */
|
||||
public final long routeInfoLifetime;
|
||||
/** @hide */
|
||||
public final long rdnssLifetime;
|
||||
/** @hide */
|
||||
public final long dnsslLifetime;
|
||||
|
||||
/** @hide */
|
||||
public RaEvent(long routerLifetime, long prefixValidLifetime, long prefixPreferredLifetime,
|
||||
long routeInfoLifetime, long rdnssLifetime, long dnsslLifetime) {
|
||||
this.routerLifetime = routerLifetime;
|
||||
@@ -47,6 +57,7 @@ public final class RaEvent implements IpConnectivityLog.Event {
|
||||
this.dnsslLifetime = dnsslLifetime;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
private RaEvent(Parcel in) {
|
||||
routerLifetime = in.readLong();
|
||||
prefixValidLifetime = in.readLong();
|
||||
@@ -56,6 +67,7 @@ public final class RaEvent implements IpConnectivityLog.Event {
|
||||
dnsslLifetime = in.readLong();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeLong(routerLifetime);
|
||||
@@ -66,6 +78,7 @@ public final class RaEvent implements IpConnectivityLog.Event {
|
||||
out.writeLong(dnsslLifetime);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
@@ -83,6 +96,7 @@ public final class RaEvent implements IpConnectivityLog.Event {
|
||||
.toString();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final Parcelable.Creator<RaEvent> CREATOR = new Parcelable.Creator<RaEvent>() {
|
||||
public RaEvent createFromParcel(Parcel in) {
|
||||
return new RaEvent(in);
|
||||
@@ -102,47 +116,39 @@ public final class RaEvent implements IpConnectivityLog.Event {
|
||||
long rdnssLifetime = NO_LIFETIME;
|
||||
long dnsslLifetime = NO_LIFETIME;
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public RaEvent build() {
|
||||
return new RaEvent(routerLifetime, prefixValidLifetime, prefixPreferredLifetime,
|
||||
routeInfoLifetime, rdnssLifetime, dnsslLifetime);
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public Builder updateRouterLifetime(long lifetime) {
|
||||
routerLifetime = updateLifetime(routerLifetime, lifetime);
|
||||
return this;
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public Builder updatePrefixValidLifetime(long lifetime) {
|
||||
prefixValidLifetime = updateLifetime(prefixValidLifetime, lifetime);
|
||||
return this;
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public Builder updatePrefixPreferredLifetime(long lifetime) {
|
||||
prefixPreferredLifetime = updateLifetime(prefixPreferredLifetime, lifetime);
|
||||
return this;
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public Builder updateRouteInfoLifetime(long lifetime) {
|
||||
routeInfoLifetime = updateLifetime(routeInfoLifetime, lifetime);
|
||||
return this;
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public Builder updateRdnssLifetime(long lifetime) {
|
||||
rdnssLifetime = updateLifetime(rdnssLifetime, lifetime);
|
||||
return this;
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public Builder updateDnsslLifetime(long lifetime) {
|
||||
dnsslLifetime = updateLifetime(dnsslLifetime, lifetime);
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user