Merge "Add additional SystemApi for NetworkStack"
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user