Merge "Add @UnsupportedAppUsage annotations"
am: d717c04b12 Change-Id: I8f8c9106b494caa6dc5ad405111f2a285a01e49f
This commit is contained in:
@@ -22,6 +22,7 @@ import android.annotation.SdkConstant;
|
|||||||
import android.annotation.SdkConstant.SdkConstantType;
|
import android.annotation.SdkConstant.SdkConstantType;
|
||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
import android.annotation.SystemService;
|
import android.annotation.SystemService;
|
||||||
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -311,6 +312,7 @@ public class ConnectivityManager {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
|
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static final String INET_CONDITION_ACTION =
|
public static final String INET_CONDITION_ACTION =
|
||||||
"android.net.conn.INET_CONDITION_ACTION";
|
"android.net.conn.INET_CONDITION_ACTION";
|
||||||
|
|
||||||
@@ -325,6 +327,7 @@ public class ConnectivityManager {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
|
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static final String ACTION_TETHER_STATE_CHANGED =
|
public static final String ACTION_TETHER_STATE_CHANGED =
|
||||||
"android.net.conn.TETHER_STATE_CHANGED";
|
"android.net.conn.TETHER_STATE_CHANGED";
|
||||||
|
|
||||||
@@ -333,6 +336,7 @@ public class ConnectivityManager {
|
|||||||
* gives a String[] listing all the interfaces configured for
|
* gives a String[] listing all the interfaces configured for
|
||||||
* tethering and currently available for tethering.
|
* tethering and currently available for tethering.
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static final String EXTRA_AVAILABLE_TETHER = "availableArray";
|
public static final String EXTRA_AVAILABLE_TETHER = "availableArray";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -347,6 +351,7 @@ public class ConnectivityManager {
|
|||||||
* gives a String[] listing all the interfaces currently tethered
|
* gives a String[] listing all the interfaces currently tethered
|
||||||
* (ie, has DHCPv4 support and packets potentially forwarded/NATed)
|
* (ie, has DHCPv4 support and packets potentially forwarded/NATed)
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static final String EXTRA_ACTIVE_TETHER = "tetherArray";
|
public static final String EXTRA_ACTIVE_TETHER = "tetherArray";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -355,6 +360,7 @@ public class ConnectivityManager {
|
|||||||
* failed. Use {@link #getLastTetherError} to find the error code
|
* failed. Use {@link #getLastTetherError} to find the error code
|
||||||
* for any interfaces listed here.
|
* for any interfaces listed here.
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static final String EXTRA_ERRORED_TETHER = "erroredArray";
|
public static final String EXTRA_ERRORED_TETHER = "erroredArray";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -459,6 +465,7 @@ public class ConnectivityManager {
|
|||||||
* The absence of a connection type.
|
* The absence of a connection type.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static final int TYPE_NONE = -1;
|
public static final int TYPE_NONE = -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -575,6 +582,7 @@ public class ConnectivityManager {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static final int TYPE_MOBILE_FOTA = 10;
|
public static final int TYPE_MOBILE_FOTA = 10;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -583,6 +591,7 @@ public class ConnectivityManager {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static final int TYPE_MOBILE_IMS = 11;
|
public static final int TYPE_MOBILE_IMS = 11;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -591,6 +600,7 @@ public class ConnectivityManager {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static final int TYPE_MOBILE_CBS = 12;
|
public static final int TYPE_MOBILE_CBS = 12;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -600,6 +610,7 @@ public class ConnectivityManager {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static final int TYPE_WIFI_P2P = 13;
|
public static final int TYPE_WIFI_P2P = 13;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -608,6 +619,7 @@ public class ConnectivityManager {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static final int TYPE_MOBILE_IA = 14;
|
public static final int TYPE_MOBILE_IA = 14;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -617,6 +629,7 @@ public class ConnectivityManager {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static final int TYPE_MOBILE_EMERGENCY = 15;
|
public static final int TYPE_MOBILE_EMERGENCY = 15;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -625,6 +638,7 @@ public class ConnectivityManager {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static final int TYPE_PROXY = 16;
|
public static final int TYPE_PROXY = 16;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -707,6 +721,7 @@ public class ConnectivityManager {
|
|||||||
*/
|
*/
|
||||||
public static final String PRIVATE_DNS_DEFAULT_MODE_FALLBACK = PRIVATE_DNS_MODE_OPPORTUNISTIC;
|
public static final String PRIVATE_DNS_DEFAULT_MODE_FALLBACK = PRIVATE_DNS_MODE_OPPORTUNISTIC;
|
||||||
|
|
||||||
|
@UnsupportedAppUsage
|
||||||
private final IConnectivityManager mService;
|
private final IConnectivityManager mService;
|
||||||
/**
|
/**
|
||||||
* A kludge to facilitate static access where a Context pointer isn't available, like in the
|
* A kludge to facilitate static access where a Context pointer isn't available, like in the
|
||||||
@@ -743,6 +758,7 @@ public class ConnectivityManager {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static String getNetworkTypeName(int type) {
|
public static String getNetworkTypeName(int type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case TYPE_NONE:
|
case TYPE_NONE:
|
||||||
@@ -797,6 +813,7 @@ public class ConnectivityManager {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static boolean isNetworkTypeMobile(int networkType) {
|
public static boolean isNetworkTypeMobile(int networkType) {
|
||||||
switch (networkType) {
|
switch (networkType) {
|
||||||
case TYPE_MOBILE:
|
case TYPE_MOBILE:
|
||||||
@@ -1010,6 +1027,7 @@ public class ConnectivityManager {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@RequiresPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL)
|
@RequiresPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL)
|
||||||
|
@UnsupportedAppUsage
|
||||||
public NetworkInfo getActiveNetworkInfoForUid(int uid) {
|
public NetworkInfo getActiveNetworkInfoForUid(int uid) {
|
||||||
return getActiveNetworkInfoForUid(uid, false);
|
return getActiveNetworkInfoForUid(uid, false);
|
||||||
}
|
}
|
||||||
@@ -1107,6 +1125,7 @@ public class ConnectivityManager {
|
|||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
||||||
|
@UnsupportedAppUsage
|
||||||
public Network getNetworkForType(int networkType) {
|
public Network getNetworkForType(int networkType) {
|
||||||
try {
|
try {
|
||||||
return mService.getNetworkForType(networkType);
|
return mService.getNetworkForType(networkType);
|
||||||
@@ -1135,6 +1154,7 @@ public class ConnectivityManager {
|
|||||||
* the Networks that applications run by the given user will use by default.
|
* the Networks that applications run by the given user will use by default.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public NetworkCapabilities[] getDefaultNetworkCapabilitiesForUser(int userId) {
|
public NetworkCapabilities[] getDefaultNetworkCapabilitiesForUser(int userId) {
|
||||||
try {
|
try {
|
||||||
return mService.getDefaultNetworkCapabilitiesForUser(userId);
|
return mService.getDefaultNetworkCapabilitiesForUser(userId);
|
||||||
@@ -1153,6 +1173,7 @@ public class ConnectivityManager {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
||||||
|
@UnsupportedAppUsage
|
||||||
public LinkProperties getActiveLinkProperties() {
|
public LinkProperties getActiveLinkProperties() {
|
||||||
try {
|
try {
|
||||||
return mService.getActiveLinkProperties();
|
return mService.getActiveLinkProperties();
|
||||||
@@ -1177,6 +1198,7 @@ public class ConnectivityManager {
|
|||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
||||||
|
@UnsupportedAppUsage
|
||||||
public LinkProperties getLinkProperties(int networkType) {
|
public LinkProperties getLinkProperties(int networkType) {
|
||||||
try {
|
try {
|
||||||
return mService.getLinkPropertiesForType(networkType);
|
return mService.getLinkPropertiesForType(networkType);
|
||||||
@@ -1332,6 +1354,7 @@ public class ConnectivityManager {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UnsupportedAppUsage
|
||||||
private NetworkCapabilities networkCapabilitiesForFeature(int networkType, String feature) {
|
private NetworkCapabilities networkCapabilitiesForFeature(int networkType, String feature) {
|
||||||
if (networkType == TYPE_MOBILE) {
|
if (networkType == TYPE_MOBILE) {
|
||||||
switch (feature) {
|
switch (feature) {
|
||||||
@@ -1495,6 +1518,7 @@ public class ConnectivityManager {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UnsupportedAppUsage
|
||||||
private static final HashMap<NetworkCapabilities, LegacyRequest> sLegacyRequests =
|
private static final HashMap<NetworkCapabilities, LegacyRequest> sLegacyRequests =
|
||||||
new HashMap<>();
|
new HashMap<>();
|
||||||
|
|
||||||
@@ -1523,6 +1547,7 @@ public class ConnectivityManager {
|
|||||||
Log.d(TAG, "expireRequest with " + ourSeqNum + ", " + sequenceNum);
|
Log.d(TAG, "expireRequest with " + ourSeqNum + ", " + sequenceNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UnsupportedAppUsage
|
||||||
private NetworkRequest requestNetworkForFeatureLocked(NetworkCapabilities netCap) {
|
private NetworkRequest requestNetworkForFeatureLocked(NetworkCapabilities netCap) {
|
||||||
int delay = -1;
|
int delay = -1;
|
||||||
int type = legacyTypeForNetworkCapabilities(netCap);
|
int type = legacyTypeForNetworkCapabilities(netCap);
|
||||||
@@ -1552,6 +1577,7 @@ public class ConnectivityManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UnsupportedAppUsage
|
||||||
private boolean removeRequestForFeature(NetworkCapabilities netCap) {
|
private boolean removeRequestForFeature(NetworkCapabilities netCap) {
|
||||||
final LegacyRequest l;
|
final LegacyRequest l;
|
||||||
synchronized (sLegacyRequests) {
|
synchronized (sLegacyRequests) {
|
||||||
@@ -1619,10 +1645,13 @@ public class ConnectivityManager {
|
|||||||
/** @hide */
|
/** @hide */
|
||||||
public static class PacketKeepaliveCallback {
|
public static class PacketKeepaliveCallback {
|
||||||
/** The requested keepalive was successfully started. */
|
/** The requested keepalive was successfully started. */
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void onStarted() {}
|
public void onStarted() {}
|
||||||
/** The keepalive was successfully stopped. */
|
/** The keepalive was successfully stopped. */
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void onStopped() {}
|
public void onStopped() {}
|
||||||
/** An error occurred. */
|
/** An error occurred. */
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void onError(int error) {}
|
public void onError(int error) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1689,6 +1718,7 @@ public class ConnectivityManager {
|
|||||||
mLooper.quit();
|
mLooper.quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void stop() {
|
public void stop() {
|
||||||
try {
|
try {
|
||||||
mService.stopKeepalive(mNetwork, mSlot);
|
mService.stopKeepalive(mNetwork, mSlot);
|
||||||
@@ -1744,6 +1774,7 @@ public class ConnectivityManager {
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public PacketKeepalive startNattKeepalive(
|
public PacketKeepalive startNattKeepalive(
|
||||||
Network network, int intervalSeconds, PacketKeepaliveCallback callback,
|
Network network, int intervalSeconds, PacketKeepaliveCallback callback,
|
||||||
InetAddress srcAddr, int srcPort, InetAddress dstAddr) {
|
InetAddress srcAddr, int srcPort, InetAddress dstAddr) {
|
||||||
@@ -1805,6 +1836,7 @@ public class ConnectivityManager {
|
|||||||
* {@link #bindProcessToNetwork} API.
|
* {@link #bindProcessToNetwork} API.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean requestRouteToHostAddress(int networkType, InetAddress hostAddress) {
|
public boolean requestRouteToHostAddress(int networkType, InetAddress hostAddress) {
|
||||||
checkLegacyRoutingApiAccess();
|
checkLegacyRoutingApiAccess();
|
||||||
try {
|
try {
|
||||||
@@ -1848,12 +1880,14 @@ public class ConnectivityManager {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void setBackgroundDataSetting(boolean allowBackgroundData) {
|
public void setBackgroundDataSetting(boolean allowBackgroundData) {
|
||||||
// ignored
|
// ignored
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@hide} */
|
/** {@hide} */
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public NetworkQuotaInfo getActiveNetworkQuotaInfo() {
|
public NetworkQuotaInfo getActiveNetworkQuotaInfo() {
|
||||||
try {
|
try {
|
||||||
return mService.getActiveNetworkQuotaInfo();
|
return mService.getActiveNetworkQuotaInfo();
|
||||||
@@ -1867,6 +1901,7 @@ public class ConnectivityManager {
|
|||||||
* @deprecated Talk to TelephonyManager directly
|
* @deprecated Talk to TelephonyManager directly
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean getMobileDataEnabled() {
|
public boolean getMobileDataEnabled() {
|
||||||
IBinder b = ServiceManager.getService(Context.TELEPHONY_SERVICE);
|
IBinder b = ServiceManager.getService(Context.TELEPHONY_SERVICE);
|
||||||
if (b != null) {
|
if (b != null) {
|
||||||
@@ -1986,6 +2021,7 @@ public class ConnectivityManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** {@hide} */
|
/** {@hide} */
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static ConnectivityManager from(Context context) {
|
public static ConnectivityManager from(Context context) {
|
||||||
return (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
return (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
}
|
}
|
||||||
@@ -2036,6 +2072,7 @@ public class ConnectivityManager {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
private static ConnectivityManager getInstance() {
|
private static ConnectivityManager getInstance() {
|
||||||
if (getInstanceOrNull() == null) {
|
if (getInstanceOrNull() == null) {
|
||||||
throw new IllegalStateException("No ConnectivityManager yet constructed");
|
throw new IllegalStateException("No ConnectivityManager yet constructed");
|
||||||
@@ -2052,6 +2089,7 @@ public class ConnectivityManager {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
||||||
|
@UnsupportedAppUsage
|
||||||
public String[] getTetherableIfaces() {
|
public String[] getTetherableIfaces() {
|
||||||
try {
|
try {
|
||||||
return mService.getTetherableIfaces();
|
return mService.getTetherableIfaces();
|
||||||
@@ -2068,6 +2106,7 @@ public class ConnectivityManager {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
||||||
|
@UnsupportedAppUsage
|
||||||
public String[] getTetheredIfaces() {
|
public String[] getTetheredIfaces() {
|
||||||
try {
|
try {
|
||||||
return mService.getTetheredIfaces();
|
return mService.getTetheredIfaces();
|
||||||
@@ -2090,6 +2129,7 @@ public class ConnectivityManager {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
||||||
|
@UnsupportedAppUsage
|
||||||
public String[] getTetheringErroredIfaces() {
|
public String[] getTetheringErroredIfaces() {
|
||||||
try {
|
try {
|
||||||
return mService.getTetheringErroredIfaces();
|
return mService.getTetheringErroredIfaces();
|
||||||
@@ -2136,6 +2176,7 @@ public class ConnectivityManager {
|
|||||||
*
|
*
|
||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public int tether(String iface) {
|
public int tether(String iface) {
|
||||||
try {
|
try {
|
||||||
String pkgName = mContext.getOpPackageName();
|
String pkgName = mContext.getOpPackageName();
|
||||||
@@ -2164,6 +2205,7 @@ public class ConnectivityManager {
|
|||||||
*
|
*
|
||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public int untether(String iface) {
|
public int untether(String iface) {
|
||||||
try {
|
try {
|
||||||
String pkgName = mContext.getOpPackageName();
|
String pkgName = mContext.getOpPackageName();
|
||||||
@@ -2317,6 +2359,7 @@ public class ConnectivityManager {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
||||||
|
@UnsupportedAppUsage
|
||||||
public String[] getTetherableUsbRegexs() {
|
public String[] getTetherableUsbRegexs() {
|
||||||
try {
|
try {
|
||||||
return mService.getTetherableUsbRegexs();
|
return mService.getTetherableUsbRegexs();
|
||||||
@@ -2336,6 +2379,7 @@ public class ConnectivityManager {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
||||||
|
@UnsupportedAppUsage
|
||||||
public String[] getTetherableWifiRegexs() {
|
public String[] getTetherableWifiRegexs() {
|
||||||
try {
|
try {
|
||||||
return mService.getTetherableWifiRegexs();
|
return mService.getTetherableWifiRegexs();
|
||||||
@@ -2355,6 +2399,7 @@ public class ConnectivityManager {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
||||||
|
@UnsupportedAppUsage
|
||||||
public String[] getTetherableBluetoothRegexs() {
|
public String[] getTetherableBluetoothRegexs() {
|
||||||
try {
|
try {
|
||||||
return mService.getTetherableBluetoothRegexs();
|
return mService.getTetherableBluetoothRegexs();
|
||||||
@@ -2380,6 +2425,7 @@ public class ConnectivityManager {
|
|||||||
*
|
*
|
||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public int setUsbTethering(boolean enable) {
|
public int setUsbTethering(boolean enable) {
|
||||||
try {
|
try {
|
||||||
String pkgName = mContext.getOpPackageName();
|
String pkgName = mContext.getOpPackageName();
|
||||||
@@ -2426,6 +2472,7 @@ public class ConnectivityManager {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
||||||
|
@UnsupportedAppUsage
|
||||||
public int getLastTetherError(String iface) {
|
public int getLastTetherError(String iface) {
|
||||||
try {
|
try {
|
||||||
return mService.getLastTetherError(iface);
|
return mService.getLastTetherError(iface);
|
||||||
@@ -2579,6 +2626,7 @@ public class ConnectivityManager {
|
|||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean isNetworkSupported(int networkType) {
|
public boolean isNetworkSupported(int networkType) {
|
||||||
try {
|
try {
|
||||||
return mService.isNetworkSupported(networkType);
|
return mService.isNetworkSupported(networkType);
|
||||||
@@ -2680,6 +2728,7 @@ public class ConnectivityManager {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@RequiresPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL)
|
@RequiresPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL)
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void setAirplaneMode(boolean enable) {
|
public void setAirplaneMode(boolean enable) {
|
||||||
try {
|
try {
|
||||||
mService.setAirplaneMode(enable);
|
mService.setAirplaneMode(enable);
|
||||||
@@ -2689,6 +2738,7 @@ public class ConnectivityManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** {@hide} */
|
/** {@hide} */
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void registerNetworkFactory(Messenger messenger, String name) {
|
public void registerNetworkFactory(Messenger messenger, String name) {
|
||||||
try {
|
try {
|
||||||
mService.registerNetworkFactory(messenger, name);
|
mService.registerNetworkFactory(messenger, name);
|
||||||
@@ -2698,6 +2748,7 @@ public class ConnectivityManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** {@hide} */
|
/** {@hide} */
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void unregisterNetworkFactory(Messenger messenger) {
|
public void unregisterNetworkFactory(Messenger messenger) {
|
||||||
try {
|
try {
|
||||||
mService.unregisterNetworkFactory(messenger);
|
mService.unregisterNetworkFactory(messenger);
|
||||||
@@ -3786,6 +3837,7 @@ public class ConnectivityManager {
|
|||||||
* @deprecated This is strictly for legacy usage to support {@link #startUsingNetworkFeature}.
|
* @deprecated This is strictly for legacy usage to support {@link #startUsingNetworkFeature}.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static boolean setProcessDefaultNetworkForHostResolution(Network network) {
|
public static boolean setProcessDefaultNetworkForHostResolution(Network network) {
|
||||||
return NetworkUtils.bindProcessToNetworkForHostResolution(
|
return NetworkUtils.bindProcessToNetworkForHostResolution(
|
||||||
network == null ? NETID_UNSET : network.netId);
|
network == null ? NETID_UNSET : network.netId);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.net.StaticIpConfiguration;
|
import android.net.StaticIpConfiguration;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
@@ -32,6 +33,7 @@ public class IpConfiguration implements Parcelable {
|
|||||||
public enum IpAssignment {
|
public enum IpAssignment {
|
||||||
/* Use statically configured IP settings. Configuration can be accessed
|
/* Use statically configured IP settings. Configuration can be accessed
|
||||||
* with staticIpConfiguration */
|
* with staticIpConfiguration */
|
||||||
|
@UnsupportedAppUsage
|
||||||
STATIC,
|
STATIC,
|
||||||
/* Use dynamically configured IP settigns */
|
/* Use dynamically configured IP settigns */
|
||||||
DHCP,
|
DHCP,
|
||||||
@@ -47,6 +49,7 @@ public class IpConfiguration implements Parcelable {
|
|||||||
public enum ProxySettings {
|
public enum ProxySettings {
|
||||||
/* No proxy is to be used. Any existing proxy settings
|
/* No proxy is to be used. Any existing proxy settings
|
||||||
* should be cleared. */
|
* should be cleared. */
|
||||||
|
@UnsupportedAppUsage
|
||||||
NONE,
|
NONE,
|
||||||
/* Use statically configured proxy. Configuration can be accessed
|
/* Use statically configured proxy. Configuration can be accessed
|
||||||
* with httpProxy. */
|
* with httpProxy. */
|
||||||
@@ -61,6 +64,7 @@ public class IpConfiguration implements Parcelable {
|
|||||||
|
|
||||||
public ProxySettings proxySettings;
|
public ProxySettings proxySettings;
|
||||||
|
|
||||||
|
@UnsupportedAppUsage
|
||||||
public ProxyInfo httpProxy;
|
public ProxyInfo httpProxy;
|
||||||
|
|
||||||
private void init(IpAssignment ipAssignment,
|
private void init(IpAssignment ipAssignment,
|
||||||
@@ -79,6 +83,7 @@ public class IpConfiguration implements Parcelable {
|
|||||||
init(IpAssignment.UNASSIGNED, ProxySettings.UNASSIGNED, null, null);
|
init(IpAssignment.UNASSIGNED, ProxySettings.UNASSIGNED, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UnsupportedAppUsage
|
||||||
public IpConfiguration(IpAssignment ipAssignment,
|
public IpConfiguration(IpAssignment ipAssignment,
|
||||||
ProxySettings proxySettings,
|
ProxySettings proxySettings,
|
||||||
StaticIpConfiguration staticIpConfiguration,
|
StaticIpConfiguration staticIpConfiguration,
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import static android.system.OsConstants.RT_SCOPE_LINK;
|
|||||||
import static android.system.OsConstants.RT_SCOPE_SITE;
|
import static android.system.OsConstants.RT_SCOPE_SITE;
|
||||||
import static android.system.OsConstants.RT_SCOPE_UNIVERSE;
|
import static android.system.OsConstants.RT_SCOPE_UNIVERSE;
|
||||||
|
|
||||||
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.util.Pair;
|
import android.util.Pair;
|
||||||
@@ -54,11 +55,13 @@ public class LinkAddress implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* IPv4 or IPv6 address.
|
* IPv4 or IPv6 address.
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
private InetAddress address;
|
private InetAddress address;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prefix length.
|
* Prefix length.
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
private int prefixLength;
|
private int prefixLength;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -112,6 +115,7 @@ public class LinkAddress implements Parcelable {
|
|||||||
* @return true if the address is IPv6.
|
* @return true if the address is IPv6.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean isIPv6() {
|
public boolean isIPv6() {
|
||||||
return address instanceof Inet6Address;
|
return address instanceof Inet6Address;
|
||||||
}
|
}
|
||||||
@@ -163,6 +167,7 @@ public class LinkAddress implements Parcelable {
|
|||||||
* @param prefixLength The prefix length.
|
* @param prefixLength The prefix length.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public LinkAddress(InetAddress address, int prefixLength) {
|
public LinkAddress(InetAddress address, int prefixLength) {
|
||||||
this(address, prefixLength, 0, 0);
|
this(address, prefixLength, 0, 0);
|
||||||
this.scope = scopeForUnicastAddress(address);
|
this.scope = scopeForUnicastAddress(address);
|
||||||
@@ -185,6 +190,7 @@ public class LinkAddress implements Parcelable {
|
|||||||
* @param string The string to parse.
|
* @param string The string to parse.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public LinkAddress(String address) {
|
public LinkAddress(String address) {
|
||||||
this(address, 0, 0);
|
this(address, 0, 0);
|
||||||
this.scope = scopeForUnicastAddress(this.address);
|
this.scope = scopeForUnicastAddress(this.address);
|
||||||
@@ -255,6 +261,7 @@ public class LinkAddress implements Parcelable {
|
|||||||
* otherwise.
|
* otherwise.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean isSameAddressAs(LinkAddress other) {
|
public boolean isSameAddressAs(LinkAddress other) {
|
||||||
return address.equals(other.address) && prefixLength == other.prefixLength;
|
return address.equals(other.address) && prefixLength == other.prefixLength;
|
||||||
}
|
}
|
||||||
@@ -278,6 +285,7 @@ public class LinkAddress implements Parcelable {
|
|||||||
* TODO: Delete all callers and remove in favour of getPrefixLength().
|
* TODO: Delete all callers and remove in favour of getPrefixLength().
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public int getNetworkPrefixLength() {
|
public int getNetworkPrefixLength() {
|
||||||
return getPrefixLength();
|
return getPrefixLength();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package android.net;
|
|||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@@ -48,6 +49,7 @@ import java.util.StringJoiner;
|
|||||||
*/
|
*/
|
||||||
public final class LinkProperties implements Parcelable {
|
public final class LinkProperties implements Parcelable {
|
||||||
// The interface described by the network link.
|
// The interface described by the network link.
|
||||||
|
@UnsupportedAppUsage
|
||||||
private String mIfaceName;
|
private String mIfaceName;
|
||||||
private ArrayList<LinkAddress> mLinkAddresses = new ArrayList<>();
|
private ArrayList<LinkAddress> mLinkAddresses = new ArrayList<>();
|
||||||
private ArrayList<InetAddress> mDnses = new ArrayList<>();
|
private ArrayList<InetAddress> mDnses = new ArrayList<>();
|
||||||
@@ -103,9 +105,13 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public enum ProvisioningChange {
|
public enum ProvisioningChange {
|
||||||
|
@UnsupportedAppUsage
|
||||||
STILL_NOT_PROVISIONED,
|
STILL_NOT_PROVISIONED,
|
||||||
|
@UnsupportedAppUsage
|
||||||
LOST_PROVISIONING,
|
LOST_PROVISIONING,
|
||||||
|
@UnsupportedAppUsage
|
||||||
GAINED_PROVISIONING,
|
GAINED_PROVISIONING,
|
||||||
|
@UnsupportedAppUsage
|
||||||
STILL_PROVISIONED,
|
STILL_PROVISIONED,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,6 +120,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static ProvisioningChange compareProvisioning(
|
public static ProvisioningChange compareProvisioning(
|
||||||
LinkProperties before, LinkProperties after) {
|
LinkProperties before, LinkProperties after) {
|
||||||
if (before.isProvisioned() && after.isProvisioned()) {
|
if (before.isProvisioned() && after.isProvisioned()) {
|
||||||
@@ -154,12 +161,14 @@ public final class LinkProperties implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public LinkProperties() {
|
public LinkProperties() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public LinkProperties(LinkProperties source) {
|
public LinkProperties(LinkProperties source) {
|
||||||
if (source != null) {
|
if (source != null) {
|
||||||
mIfaceName = source.mIfaceName;
|
mIfaceName = source.mIfaceName;
|
||||||
@@ -186,6 +195,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @param iface The name of the network interface used for this link.
|
* @param iface The name of the network interface used for this link.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void setInterfaceName(String iface) {
|
public void setInterfaceName(String iface) {
|
||||||
mIfaceName = iface;
|
mIfaceName = iface;
|
||||||
ArrayList<RouteInfo> newRoutes = new ArrayList<>(mRoutes.size());
|
ArrayList<RouteInfo> newRoutes = new ArrayList<>(mRoutes.size());
|
||||||
@@ -207,6 +217,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public List<String> getAllInterfaceNames() {
|
public List<String> getAllInterfaceNames() {
|
||||||
List<String> interfaceNames = new ArrayList<>(mStackedLinks.size() + 1);
|
List<String> interfaceNames = new ArrayList<>(mStackedLinks.size() + 1);
|
||||||
if (mIfaceName != null) interfaceNames.add(mIfaceName);
|
if (mIfaceName != null) interfaceNames.add(mIfaceName);
|
||||||
@@ -226,6 +237,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return An unmodifiable {@link List} of {@link InetAddress} for this link.
|
* @return An unmodifiable {@link List} of {@link InetAddress} for this link.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public List<InetAddress> getAddresses() {
|
public List<InetAddress> getAddresses() {
|
||||||
List<InetAddress> addresses = new ArrayList<>();
|
List<InetAddress> addresses = new ArrayList<>();
|
||||||
for (LinkAddress linkAddress : mLinkAddresses) {
|
for (LinkAddress linkAddress : mLinkAddresses) {
|
||||||
@@ -238,6 +250,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* Returns all the addresses on this link and all the links stacked above it.
|
* Returns all the addresses on this link and all the links stacked above it.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public List<InetAddress> getAllAddresses() {
|
public List<InetAddress> getAllAddresses() {
|
||||||
List<InetAddress> addresses = new ArrayList<>();
|
List<InetAddress> addresses = new ArrayList<>();
|
||||||
for (LinkAddress linkAddress : mLinkAddresses) {
|
for (LinkAddress linkAddress : mLinkAddresses) {
|
||||||
@@ -265,6 +278,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return true if {@code address} was added or updated, false otherwise.
|
* @return true if {@code address} was added or updated, false otherwise.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean addLinkAddress(LinkAddress address) {
|
public boolean addLinkAddress(LinkAddress address) {
|
||||||
if (address == null) {
|
if (address == null) {
|
||||||
return false;
|
return false;
|
||||||
@@ -315,6 +329,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* Returns all the addresses on this link and all the links stacked above it.
|
* Returns all the addresses on this link and all the links stacked above it.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public List<LinkAddress> getAllLinkAddresses() {
|
public List<LinkAddress> getAllLinkAddresses() {
|
||||||
List<LinkAddress> addresses = new ArrayList<>(mLinkAddresses);
|
List<LinkAddress> addresses = new ArrayList<>(mLinkAddresses);
|
||||||
for (LinkProperties stacked: mStackedLinks.values()) {
|
for (LinkProperties stacked: mStackedLinks.values()) {
|
||||||
@@ -331,6 +346,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* object.
|
* object.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void setLinkAddresses(Collection<LinkAddress> addresses) {
|
public void setLinkAddresses(Collection<LinkAddress> addresses) {
|
||||||
mLinkAddresses.clear();
|
mLinkAddresses.clear();
|
||||||
for (LinkAddress address: addresses) {
|
for (LinkAddress address: addresses) {
|
||||||
@@ -345,6 +361,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return true if the DNS server was added, false if it was already present.
|
* @return true if the DNS server was added, false if it was already present.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean addDnsServer(InetAddress dnsServer) {
|
public boolean addDnsServer(InetAddress dnsServer) {
|
||||||
if (dnsServer != null && !mDnses.contains(dnsServer)) {
|
if (dnsServer != null && !mDnses.contains(dnsServer)) {
|
||||||
mDnses.add(dnsServer);
|
mDnses.add(dnsServer);
|
||||||
@@ -360,6 +377,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return true if the DNS server was removed, false if it did not exist.
|
* @return true if the DNS server was removed, false if it did not exist.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean removeDnsServer(InetAddress dnsServer) {
|
public boolean removeDnsServer(InetAddress dnsServer) {
|
||||||
if (dnsServer != null) {
|
if (dnsServer != null) {
|
||||||
return mDnses.remove(dnsServer);
|
return mDnses.remove(dnsServer);
|
||||||
@@ -374,6 +392,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @param dnsServers The {@link Collection} of DNS servers to set in this object.
|
* @param dnsServers The {@link Collection} of DNS servers to set in this object.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void setDnsServers(Collection<InetAddress> dnsServers) {
|
public void setDnsServers(Collection<InetAddress> dnsServers) {
|
||||||
mDnses.clear();
|
mDnses.clear();
|
||||||
for (InetAddress dnsServer: dnsServers) {
|
for (InetAddress dnsServer: dnsServers) {
|
||||||
@@ -510,6 +529,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* domains to search when resolving host names on this link.
|
* domains to search when resolving host names on this link.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void setDomains(String domains) {
|
public void setDomains(String domains) {
|
||||||
mDomains = domains;
|
mDomains = domains;
|
||||||
}
|
}
|
||||||
@@ -532,6 +552,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @param mtu The MTU to use for this link.
|
* @param mtu The MTU to use for this link.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void setMtu(int mtu) {
|
public void setMtu(int mtu) {
|
||||||
mMtu = mtu;
|
mMtu = mtu;
|
||||||
}
|
}
|
||||||
@@ -543,6 +564,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return The mtu value set for this link.
|
* @return The mtu value set for this link.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public int getMtu() {
|
public int getMtu() {
|
||||||
return mMtu;
|
return mMtu;
|
||||||
}
|
}
|
||||||
@@ -555,6 +577,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void setTcpBufferSizes(String tcpBufferSizes) {
|
public void setTcpBufferSizes(String tcpBufferSizes) {
|
||||||
mTcpBufferSizes = tcpBufferSizes;
|
mTcpBufferSizes = tcpBufferSizes;
|
||||||
}
|
}
|
||||||
@@ -566,6 +589,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public String getTcpBufferSizes() {
|
public String getTcpBufferSizes() {
|
||||||
return mTcpBufferSizes;
|
return mTcpBufferSizes;
|
||||||
}
|
}
|
||||||
@@ -589,6 +613,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean addRoute(RouteInfo route) {
|
public boolean addRoute(RouteInfo route) {
|
||||||
if (route != null) {
|
if (route != null) {
|
||||||
String routeIface = route.getInterface();
|
String routeIface = route.getInterface();
|
||||||
@@ -615,6 +640,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean removeRoute(RouteInfo route) {
|
public boolean removeRoute(RouteInfo route) {
|
||||||
return route != null &&
|
return route != null &&
|
||||||
Objects.equals(mIfaceName, route.getInterface()) &&
|
Objects.equals(mIfaceName, route.getInterface()) &&
|
||||||
@@ -645,6 +671,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* Returns all the routes on this link and all the links stacked above it.
|
* Returns all the routes on this link and all the links stacked above it.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public List<RouteInfo> getAllRoutes() {
|
public List<RouteInfo> getAllRoutes() {
|
||||||
List<RouteInfo> routes = new ArrayList<>(mRoutes);
|
List<RouteInfo> routes = new ArrayList<>(mRoutes);
|
||||||
for (LinkProperties stacked: mStackedLinks.values()) {
|
for (LinkProperties stacked: mStackedLinks.values()) {
|
||||||
@@ -661,6 +688,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @param proxy A {@link ProxyInfo} defining the HTTP Proxy to use on this link.
|
* @param proxy A {@link ProxyInfo} defining the HTTP Proxy to use on this link.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void setHttpProxy(ProxyInfo proxy) {
|
public void setHttpProxy(ProxyInfo proxy) {
|
||||||
mHttpProxy = proxy;
|
mHttpProxy = proxy;
|
||||||
}
|
}
|
||||||
@@ -685,6 +713,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return true if the link was stacked, false otherwise.
|
* @return true if the link was stacked, false otherwise.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean addStackedLink(LinkProperties link) {
|
public boolean addStackedLink(LinkProperties link) {
|
||||||
if (link != null && link.getInterfaceName() != null) {
|
if (link != null && link.getInterfaceName() != null) {
|
||||||
mStackedLinks.put(link.getInterfaceName(), link);
|
mStackedLinks.put(link.getInterfaceName(), link);
|
||||||
@@ -715,6 +744,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* Returns all the links stacked on top of this link.
|
* Returns all the links stacked on top of this link.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public @NonNull List<LinkProperties> getStackedLinks() {
|
public @NonNull List<LinkProperties> getStackedLinks() {
|
||||||
if (mStackedLinks.isEmpty()) {
|
if (mStackedLinks.isEmpty()) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
@@ -730,6 +760,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* Clears this object to its initial state.
|
* Clears this object to its initial state.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void clear() {
|
public void clear() {
|
||||||
mIfaceName = null;
|
mIfaceName = null;
|
||||||
mLinkAddresses.clear();
|
mLinkAddresses.clear();
|
||||||
@@ -831,6 +862,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return {@code true} if there is an IPv4 address, {@code false} otherwise.
|
* @return {@code true} if there is an IPv4 address, {@code false} otherwise.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean hasIPv4Address() {
|
public boolean hasIPv4Address() {
|
||||||
for (LinkAddress address : mLinkAddresses) {
|
for (LinkAddress address : mLinkAddresses) {
|
||||||
if (address.getAddress() instanceof Inet4Address) {
|
if (address.getAddress() instanceof Inet4Address) {
|
||||||
@@ -858,6 +890,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return {@code true} if there is a global preferred IPv6 address, {@code false} otherwise.
|
* @return {@code true} if there is a global preferred IPv6 address, {@code false} otherwise.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean hasGlobalIPv6Address() {
|
public boolean hasGlobalIPv6Address() {
|
||||||
for (LinkAddress address : mLinkAddresses) {
|
for (LinkAddress address : mLinkAddresses) {
|
||||||
if (address.getAddress() instanceof Inet6Address && address.isGlobalPreferred()) {
|
if (address.getAddress() instanceof Inet6Address && address.isGlobalPreferred()) {
|
||||||
@@ -873,6 +906,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return {@code true} if there is an IPv4 default route, {@code false} otherwise.
|
* @return {@code true} if there is an IPv4 default route, {@code false} otherwise.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean hasIPv4DefaultRoute() {
|
public boolean hasIPv4DefaultRoute() {
|
||||||
for (RouteInfo r : mRoutes) {
|
for (RouteInfo r : mRoutes) {
|
||||||
if (r.isIPv4Default()) {
|
if (r.isIPv4Default()) {
|
||||||
@@ -888,6 +922,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return {@code true} if there is an IPv6 default route, {@code false} otherwise.
|
* @return {@code true} if there is an IPv6 default route, {@code false} otherwise.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean hasIPv6DefaultRoute() {
|
public boolean hasIPv6DefaultRoute() {
|
||||||
for (RouteInfo r : mRoutes) {
|
for (RouteInfo r : mRoutes) {
|
||||||
if (r.isIPv6Default()) {
|
if (r.isIPv6Default()) {
|
||||||
@@ -903,6 +938,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return {@code true} if there is an IPv4 DNS server, {@code false} otherwise.
|
* @return {@code true} if there is an IPv4 DNS server, {@code false} otherwise.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean hasIPv4DnsServer() {
|
public boolean hasIPv4DnsServer() {
|
||||||
for (InetAddress ia : mDnses) {
|
for (InetAddress ia : mDnses) {
|
||||||
if (ia instanceof Inet4Address) {
|
if (ia instanceof Inet4Address) {
|
||||||
@@ -918,6 +954,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return {@code true} if there is an IPv6 DNS server, {@code false} otherwise.
|
* @return {@code true} if there is an IPv6 DNS server, {@code false} otherwise.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean hasIPv6DnsServer() {
|
public boolean hasIPv6DnsServer() {
|
||||||
for (InetAddress ia : mDnses) {
|
for (InetAddress ia : mDnses) {
|
||||||
if (ia instanceof Inet6Address) {
|
if (ia instanceof Inet6Address) {
|
||||||
@@ -947,6 +984,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return {@code true} if the link is provisioned, {@code false} otherwise.
|
* @return {@code true} if the link is provisioned, {@code false} otherwise.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean isIPv6Provisioned() {
|
public boolean isIPv6Provisioned() {
|
||||||
return (hasGlobalIPv6Address() &&
|
return (hasGlobalIPv6Address() &&
|
||||||
hasIPv6DefaultRoute() &&
|
hasIPv6DefaultRoute() &&
|
||||||
@@ -960,6 +998,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return {@code true} if the link is provisioned, {@code false} otherwise.
|
* @return {@code true} if the link is provisioned, {@code false} otherwise.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean isProvisioned() {
|
public boolean isProvisioned() {
|
||||||
return (isIPv4Provisioned() || isIPv6Provisioned());
|
return (isIPv4Provisioned() || isIPv6Provisioned());
|
||||||
}
|
}
|
||||||
@@ -971,6 +1010,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* {@code false} otherwise.
|
* {@code false} otherwise.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean isReachable(InetAddress ip) {
|
public boolean isReachable(InetAddress ip) {
|
||||||
final List<RouteInfo> allRoutes = getAllRoutes();
|
final List<RouteInfo> allRoutes = getAllRoutes();
|
||||||
// If we don't have a route to this IP address, it's not reachable.
|
// If we don't have a route to this IP address, it's not reachable.
|
||||||
@@ -1008,6 +1048,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return {@code true} if both are identical, {@code false} otherwise.
|
* @return {@code true} if both are identical, {@code false} otherwise.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean isIdenticalInterfaceName(LinkProperties target) {
|
public boolean isIdenticalInterfaceName(LinkProperties target) {
|
||||||
return TextUtils.equals(getInterfaceName(), target.getInterfaceName());
|
return TextUtils.equals(getInterfaceName(), target.getInterfaceName());
|
||||||
}
|
}
|
||||||
@@ -1019,6 +1060,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return {@code true} if both are identical, {@code false} otherwise.
|
* @return {@code true} if both are identical, {@code false} otherwise.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean isIdenticalAddresses(LinkProperties target) {
|
public boolean isIdenticalAddresses(LinkProperties target) {
|
||||||
Collection<InetAddress> targetAddresses = target.getAddresses();
|
Collection<InetAddress> targetAddresses = target.getAddresses();
|
||||||
Collection<InetAddress> sourceAddresses = getAddresses();
|
Collection<InetAddress> sourceAddresses = getAddresses();
|
||||||
@@ -1033,6 +1075,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return {@code true} if both are identical, {@code false} otherwise.
|
* @return {@code true} if both are identical, {@code false} otherwise.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean isIdenticalDnses(LinkProperties target) {
|
public boolean isIdenticalDnses(LinkProperties target) {
|
||||||
Collection<InetAddress> targetDnses = target.getDnsServers();
|
Collection<InetAddress> targetDnses = target.getDnsServers();
|
||||||
String targetDomains = target.getDomains();
|
String targetDomains = target.getDomains();
|
||||||
@@ -1080,6 +1123,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return {@code true} if both are identical, {@code false} otherwise.
|
* @return {@code true} if both are identical, {@code false} otherwise.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean isIdenticalRoutes(LinkProperties target) {
|
public boolean isIdenticalRoutes(LinkProperties target) {
|
||||||
Collection<RouteInfo> targetRoutes = target.getRoutes();
|
Collection<RouteInfo> targetRoutes = target.getRoutes();
|
||||||
return (mRoutes.size() == targetRoutes.size()) ?
|
return (mRoutes.size() == targetRoutes.size()) ?
|
||||||
@@ -1093,6 +1137,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return {@code true} if both are identical, {@code false} otherwise.
|
* @return {@code true} if both are identical, {@code false} otherwise.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean isIdenticalHttpProxy(LinkProperties target) {
|
public boolean isIdenticalHttpProxy(LinkProperties target) {
|
||||||
return getHttpProxy() == null ? target.getHttpProxy() == null :
|
return getHttpProxy() == null ? target.getHttpProxy() == null :
|
||||||
getHttpProxy().equals(target.getHttpProxy());
|
getHttpProxy().equals(target.getHttpProxy());
|
||||||
@@ -1105,6 +1150,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @return {@code true} if both are identical, {@code false} otherwise.
|
* @return {@code true} if both are identical, {@code false} otherwise.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean isIdenticalStackedLinks(LinkProperties target) {
|
public boolean isIdenticalStackedLinks(LinkProperties target) {
|
||||||
if (!mStackedLinks.keySet().equals(target.mStackedLinks.keySet())) {
|
if (!mStackedLinks.keySet().equals(target.mStackedLinks.keySet())) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package android.net;
|
|||||||
|
|
||||||
import android.annotation.IntDef;
|
import android.annotation.IntDef;
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
|
||||||
@@ -50,6 +51,7 @@ public final class MacAddress implements Parcelable {
|
|||||||
* The MacAddress zero MAC address.
|
* The MacAddress zero MAC address.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static final MacAddress ALL_ZEROS_ADDRESS = new MacAddress(0);
|
public static final MacAddress ALL_ZEROS_ADDRESS = new MacAddress(0);
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.system.ErrnoException;
|
import android.system.ErrnoException;
|
||||||
@@ -59,6 +60,7 @@ public class Network implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public final int netId;
|
public final int netId;
|
||||||
|
|
||||||
// Objects used to perform per-network operations such as getSocketFactory
|
// Objects used to perform per-network operations such as getSocketFactory
|
||||||
@@ -103,6 +105,7 @@ public class Network implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public Network(int netId) {
|
public Network(int netId) {
|
||||||
this.netId = netId;
|
this.netId = netId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.net.ConnectivityManager.PacketKeepalive;
|
import android.net.ConnectivityManager.PacketKeepalive;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -351,6 +352,7 @@ public abstract class NetworkAgent extends Handler {
|
|||||||
/**
|
/**
|
||||||
* Called by the bearer code when it has new NetworkInfo data.
|
* Called by the bearer code when it has new NetworkInfo data.
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void sendNetworkInfo(NetworkInfo networkInfo) {
|
public void sendNetworkInfo(NetworkInfo networkInfo) {
|
||||||
queueOrSendMessage(EVENT_NETWORK_INFO_CHANGED, new NetworkInfo(networkInfo));
|
queueOrSendMessage(EVENT_NETWORK_INFO_CHANGED, new NetworkInfo(networkInfo));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package android.net;
|
|||||||
import android.annotation.IntDef;
|
import android.annotation.IntDef;
|
||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
import android.annotation.TestApi;
|
import android.annotation.TestApi;
|
||||||
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.net.ConnectivityManager.NetworkCallback;
|
import android.net.ConnectivityManager.NetworkCallback;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
@@ -56,6 +57,7 @@ public final class NetworkCapabilities implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public NetworkCapabilities() {
|
public NetworkCapabilities() {
|
||||||
clearAll();
|
clearAll();
|
||||||
mNetworkCapabilities = DEFAULT_CAPABILITIES;
|
mNetworkCapabilities = DEFAULT_CAPABILITIES;
|
||||||
@@ -103,6 +105,7 @@ public final class NetworkCapabilities implements Parcelable {
|
|||||||
* Represents the network's capabilities. If any are specified they will be satisfied
|
* Represents the network's capabilities. If any are specified they will be satisfied
|
||||||
* by any Network that matches all of them.
|
* by any Network that matches all of them.
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
private long mNetworkCapabilities;
|
private long mNetworkCapabilities;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -371,6 +374,7 @@ public final class NetworkCapabilities implements Parcelable {
|
|||||||
* @return This NetworkCapabilities instance, to facilitate chaining.
|
* @return This NetworkCapabilities instance, to facilitate chaining.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public NetworkCapabilities addCapability(@NetCapability int capability) {
|
public NetworkCapabilities addCapability(@NetCapability int capability) {
|
||||||
checkValidCapability(capability);
|
checkValidCapability(capability);
|
||||||
mNetworkCapabilities |= 1 << capability;
|
mNetworkCapabilities |= 1 << capability;
|
||||||
@@ -407,6 +411,7 @@ public final class NetworkCapabilities implements Parcelable {
|
|||||||
* @return This NetworkCapabilities instance, to facilitate chaining.
|
* @return This NetworkCapabilities instance, to facilitate chaining.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public NetworkCapabilities removeCapability(@NetCapability int capability) {
|
public NetworkCapabilities removeCapability(@NetCapability int capability) {
|
||||||
checkValidCapability(capability);
|
checkValidCapability(capability);
|
||||||
final long mask = ~(1 << capability);
|
final long mask = ~(1 << capability);
|
||||||
@@ -659,6 +664,7 @@ public final class NetworkCapabilities implements Parcelable {
|
|||||||
* @return This NetworkCapabilities instance, to facilitate chaining.
|
* @return This NetworkCapabilities instance, to facilitate chaining.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public NetworkCapabilities addTransportType(@Transport int transportType) {
|
public NetworkCapabilities addTransportType(@Transport int transportType) {
|
||||||
checkValidTransportType(transportType);
|
checkValidTransportType(transportType);
|
||||||
mTransportTypes |= 1 << transportType;
|
mTransportTypes |= 1 << transportType;
|
||||||
@@ -898,6 +904,7 @@ public final class NetworkCapabilities implements Parcelable {
|
|||||||
* specifier. See {@link #setNetworkSpecifier}.
|
* specifier. See {@link #setNetworkSpecifier}.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public NetworkSpecifier getNetworkSpecifier() {
|
public NetworkSpecifier getNetworkSpecifier() {
|
||||||
return mNetworkSpecifier;
|
return mNetworkSpecifier;
|
||||||
}
|
}
|
||||||
@@ -930,6 +937,7 @@ public final class NetworkCapabilities implements Parcelable {
|
|||||||
* Signal strength. This is a signed integer, and higher values indicate better signal.
|
* Signal strength. This is a signed integer, and higher values indicate better signal.
|
||||||
* The exact units are bearer-dependent. For example, Wi-Fi uses RSSI.
|
* The exact units are bearer-dependent. For example, Wi-Fi uses RSSI.
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
private int mSignalStrength = SIGNAL_STRENGTH_UNSPECIFIED;
|
private int mSignalStrength = SIGNAL_STRENGTH_UNSPECIFIED;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -945,6 +953,7 @@ public final class NetworkCapabilities implements Parcelable {
|
|||||||
* @param signalStrength the bearer-specific signal strength.
|
* @param signalStrength the bearer-specific signal strength.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public NetworkCapabilities setSignalStrength(int signalStrength) {
|
public NetworkCapabilities setSignalStrength(int signalStrength) {
|
||||||
mSignalStrength = signalStrength;
|
mSignalStrength = signalStrength;
|
||||||
return this;
|
return this;
|
||||||
@@ -955,6 +964,7 @@ public final class NetworkCapabilities implements Parcelable {
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean hasSignalStrength() {
|
public boolean hasSignalStrength() {
|
||||||
return mSignalStrength > SIGNAL_STRENGTH_UNSPECIFIED;
|
return mSignalStrength > SIGNAL_STRENGTH_UNSPECIFIED;
|
||||||
}
|
}
|
||||||
@@ -965,6 +975,7 @@ public final class NetworkCapabilities implements Parcelable {
|
|||||||
* @return The bearer-specific signal strength.
|
* @return The bearer-specific signal strength.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public int getSignalStrength() {
|
public int getSignalStrength() {
|
||||||
return mSignalStrength;
|
return mSignalStrength;
|
||||||
}
|
}
|
||||||
@@ -1544,6 +1555,7 @@ public final class NetworkCapabilities implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static String transportNamesOf(@Transport int[] types) {
|
public static String transportNamesOf(@Transport int[] types) {
|
||||||
StringJoiner joiner = new StringJoiner("|");
|
StringJoiner joiner = new StringJoiner("|");
|
||||||
if (types != null) {
|
if (types != null) {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
|
||||||
@@ -129,6 +130,7 @@ public class NetworkInfo implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public NetworkInfo(int type, int subtype, String typeName, String subtypeName) {
|
public NetworkInfo(int type, int subtype, String typeName, String subtypeName) {
|
||||||
if (!ConnectivityManager.isNetworkTypeValid(type)
|
if (!ConnectivityManager.isNetworkTypeValid(type)
|
||||||
&& type != ConnectivityManager.TYPE_NONE) {
|
&& type != ConnectivityManager.TYPE_NONE) {
|
||||||
@@ -143,6 +145,7 @@ public class NetworkInfo implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** {@hide} */
|
/** {@hide} */
|
||||||
|
@UnsupportedAppUsage
|
||||||
public NetworkInfo(NetworkInfo source) {
|
public NetworkInfo(NetworkInfo source) {
|
||||||
if (source != null) {
|
if (source != null) {
|
||||||
synchronized (source) {
|
synchronized (source) {
|
||||||
@@ -209,6 +212,7 @@ public class NetworkInfo implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void setSubtype(int subtype, String subtypeName) {
|
public void setSubtype(int subtype, String subtypeName) {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
mSubtype = subtype;
|
mSubtype = subtype;
|
||||||
@@ -317,6 +321,7 @@ public class NetworkInfo implements Parcelable {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void setIsAvailable(boolean isAvailable) {
|
public void setIsAvailable(boolean isAvailable) {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
mIsAvailable = isAvailable;
|
mIsAvailable = isAvailable;
|
||||||
@@ -347,6 +352,7 @@ public class NetworkInfo implements Parcelable {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void setFailover(boolean isFailover) {
|
public void setFailover(boolean isFailover) {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
mIsFailover = isFailover;
|
mIsFailover = isFailover;
|
||||||
@@ -377,6 +383,7 @@ public class NetworkInfo implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void setRoaming(boolean isRoaming) {
|
public void setRoaming(boolean isRoaming) {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
mIsRoaming = isRoaming;
|
mIsRoaming = isRoaming;
|
||||||
@@ -422,6 +429,7 @@ public class NetworkInfo implements Parcelable {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public void setDetailedState(DetailedState detailedState, String reason, String extraInfo) {
|
public void setDetailedState(DetailedState detailedState, String reason, String extraInfo) {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
this.mDetailedState = detailedState;
|
this.mDetailedState = detailedState;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.net.NetworkCapabilities.NetCapability;
|
import android.net.NetworkCapabilities.NetCapability;
|
||||||
import android.net.NetworkCapabilities.Transport;
|
import android.net.NetworkCapabilities.Transport;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
@@ -38,6 +39,7 @@ public class NetworkRequest implements Parcelable {
|
|||||||
* The {@link NetworkCapabilities} that define this request.
|
* The {@link NetworkCapabilities} that define this request.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public final @NonNull NetworkCapabilities networkCapabilities;
|
public final @NonNull NetworkCapabilities networkCapabilities;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -46,6 +48,7 @@ public class NetworkRequest implements Parcelable {
|
|||||||
* the request.
|
* the request.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public final int requestId;
|
public final int requestId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -53,6 +56,7 @@ public class NetworkRequest implements Parcelable {
|
|||||||
* Causes CONNECTIVITY_ACTION broadcasts to be sent.
|
* Causes CONNECTIVITY_ACTION broadcasts to be sent.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public final int legacyType;
|
public final int legacyType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -241,6 +245,7 @@ public class NetworkRequest implements Parcelable {
|
|||||||
* @return The builder to facilitate chaining.
|
* @return The builder to facilitate chaining.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public Builder clearCapabilities() {
|
public Builder clearCapabilities() {
|
||||||
mNetworkCapabilities.clearAll();
|
mNetworkCapabilities.clearAll();
|
||||||
return this;
|
return this;
|
||||||
@@ -339,6 +344,7 @@ public class NetworkRequest implements Parcelable {
|
|||||||
* @param signalStrength the bearer-specific signal strength.
|
* @param signalStrength the bearer-specific signal strength.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public Builder setSignalStrength(int signalStrength) {
|
public Builder setSignalStrength(int signalStrength) {
|
||||||
mNetworkCapabilities.setSignalStrength(signalStrength);
|
mNetworkCapabilities.setSignalStrength(signalStrength);
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
@@ -33,6 +34,7 @@ public class NetworkState implements Parcelable {
|
|||||||
public final NetworkInfo networkInfo;
|
public final NetworkInfo networkInfo;
|
||||||
public final LinkProperties linkProperties;
|
public final LinkProperties linkProperties;
|
||||||
public final NetworkCapabilities networkCapabilities;
|
public final NetworkCapabilities networkCapabilities;
|
||||||
|
@UnsupportedAppUsage
|
||||||
public final Network network;
|
public final Network network;
|
||||||
public final String subscriberId;
|
public final String subscriberId;
|
||||||
public final String networkId;
|
public final String networkId;
|
||||||
@@ -58,6 +60,7 @@ public class NetworkState implements Parcelable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UnsupportedAppUsage
|
||||||
public NetworkState(Parcel in) {
|
public NetworkState(Parcel in) {
|
||||||
networkInfo = in.readParcelable(null);
|
networkInfo = in.readParcelable(null);
|
||||||
linkProperties = in.readParcelable(null);
|
linkProperties = in.readParcelable(null);
|
||||||
@@ -82,6 +85,7 @@ public class NetworkState implements Parcelable {
|
|||||||
out.writeString(networkId);
|
out.writeString(networkId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static final Creator<NetworkState> CREATOR = new Creator<NetworkState>() {
|
public static final Creator<NetworkState> CREATOR = new Creator<NetworkState>() {
|
||||||
@Override
|
@Override
|
||||||
public NetworkState createFromParcel(Parcel in) {
|
public NetworkState createFromParcel(Parcel in) {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.Pair;
|
import android.util.Pair;
|
||||||
@@ -43,6 +44,7 @@ public class NetworkUtils {
|
|||||||
/**
|
/**
|
||||||
* Attaches a socket filter that accepts DHCP packets to the given socket.
|
* Attaches a socket filter that accepts DHCP packets to the given socket.
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public native static void attachDhcpFilter(FileDescriptor fd) throws SocketException;
|
public native static void attachDhcpFilter(FileDescriptor fd) throws SocketException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,6 +52,7 @@ public class NetworkUtils {
|
|||||||
* @param fd the socket's {@link FileDescriptor}.
|
* @param fd the socket's {@link FileDescriptor}.
|
||||||
* @param packetType the hardware address type, one of ARPHRD_*.
|
* @param packetType the hardware address type, one of ARPHRD_*.
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public native static void attachRaFilter(FileDescriptor fd, int packetType) throws SocketException;
|
public native static void attachRaFilter(FileDescriptor fd, int packetType) throws SocketException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -60,6 +63,7 @@ public class NetworkUtils {
|
|||||||
* @param fd the socket's {@link FileDescriptor}.
|
* @param fd the socket's {@link FileDescriptor}.
|
||||||
* @param packetType the hardware address type, one of ARPHRD_*.
|
* @param packetType the hardware address type, one of ARPHRD_*.
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public native static void attachControlPacketFilter(FileDescriptor fd, int packetType)
|
public native static void attachControlPacketFilter(FileDescriptor fd, int packetType)
|
||||||
throws SocketException;
|
throws SocketException;
|
||||||
|
|
||||||
@@ -108,6 +112,7 @@ public class NetworkUtils {
|
|||||||
* this socket will go directly to the underlying network, so its traffic will not be
|
* this socket will go directly to the underlying network, so its traffic will not be
|
||||||
* forwarded through the VPN.
|
* forwarded through the VPN.
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static boolean protectFromVpn(FileDescriptor fd) {
|
public static boolean protectFromVpn(FileDescriptor fd) {
|
||||||
return protectFromVpn(fd.getInt$());
|
return protectFromVpn(fd.getInt$());
|
||||||
}
|
}
|
||||||
@@ -131,6 +136,7 @@ public class NetworkUtils {
|
|||||||
* or {@link #intToInet4AddressHTL(int)}
|
* or {@link #intToInet4AddressHTL(int)}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static InetAddress intToInetAddress(int hostAddress) {
|
public static InetAddress intToInetAddress(int hostAddress) {
|
||||||
return intToInet4AddressHTL(hostAddress);
|
return intToInet4AddressHTL(hostAddress);
|
||||||
}
|
}
|
||||||
@@ -209,6 +215,7 @@ public class NetworkUtils {
|
|||||||
* or {@link #prefixLengthToV4NetmaskIntHTL(int)}
|
* or {@link #prefixLengthToV4NetmaskIntHTL(int)}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static int prefixLengthToNetmaskInt(int prefixLength)
|
public static int prefixLengthToNetmaskInt(int prefixLength)
|
||||||
throws IllegalArgumentException {
|
throws IllegalArgumentException {
|
||||||
return prefixLengthToV4NetmaskIntHTL(prefixLength);
|
return prefixLengthToV4NetmaskIntHTL(prefixLength);
|
||||||
@@ -255,6 +262,7 @@ public class NetworkUtils {
|
|||||||
* @throws IllegalArgumentException the specified netmask was not contiguous.
|
* @throws IllegalArgumentException the specified netmask was not contiguous.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static int netmaskToPrefixLength(Inet4Address netmask) {
|
public static int netmaskToPrefixLength(Inet4Address netmask) {
|
||||||
// inetAddressToInt returns an int in *network* byte order.
|
// inetAddressToInt returns an int in *network* byte order.
|
||||||
int i = Integer.reverseBytes(inetAddressToInt(netmask));
|
int i = Integer.reverseBytes(inetAddressToInt(netmask));
|
||||||
@@ -275,6 +283,7 @@ public class NetworkUtils {
|
|||||||
* @return the InetAddress
|
* @return the InetAddress
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static InetAddress numericToInetAddress(String addrString)
|
public static InetAddress numericToInetAddress(String addrString)
|
||||||
throws IllegalArgumentException {
|
throws IllegalArgumentException {
|
||||||
return InetAddress.parseNumericAddress(addrString);
|
return InetAddress.parseNumericAddress(addrString);
|
||||||
@@ -349,6 +358,7 @@ public class NetworkUtils {
|
|||||||
/**
|
/**
|
||||||
* Returns the implicit netmask of an IPv4 address, as was the custom before 1993.
|
* Returns the implicit netmask of an IPv4 address, as was the custom before 1993.
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static int getImplicitNetmask(Inet4Address address) {
|
public static int getImplicitNetmask(Inet4Address address) {
|
||||||
int firstByte = address.getAddress()[0] & 0xff; // Convert to an unsigned value.
|
int firstByte = address.getAddress()[0] & 0xff; // Convert to an unsigned value.
|
||||||
if (firstByte < 128) {
|
if (firstByte < 128) {
|
||||||
@@ -439,6 +449,7 @@ public class NetworkUtils {
|
|||||||
* @param addr a string representing an ip addr
|
* @param addr a string representing an ip addr
|
||||||
* @return a string propertly trimmed
|
* @return a string propertly trimmed
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static String trimV4AddrZeros(String addr) {
|
public static String trimV4AddrZeros(String addr) {
|
||||||
if (addr == null) return null;
|
if (addr == null) return null;
|
||||||
String[] octets = addr.split("\\.");
|
String[] octets = addr.split("\\.");
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
|
|
||||||
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@@ -91,6 +92,7 @@ public class ProxyInfo implements Parcelable {
|
|||||||
* Create a ProxyProperties that points at a HTTP Proxy.
|
* Create a ProxyProperties that points at a HTTP Proxy.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public ProxyInfo(String host, int port, String exclList) {
|
public ProxyInfo(String host, int port, String exclList) {
|
||||||
mHost = host;
|
mHost = host;
|
||||||
mPort = port;
|
mPort = port;
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
|
||||||
@@ -55,6 +56,7 @@ public final class RouteInfo implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* The gateway address for this route.
|
* The gateway address for this route.
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
private final InetAddress mGateway;
|
private final InetAddress mGateway;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -79,6 +81,7 @@ public final class RouteInfo implements Parcelable {
|
|||||||
|
|
||||||
// Derived data members.
|
// Derived data members.
|
||||||
// TODO: remove these.
|
// TODO: remove these.
|
||||||
|
@UnsupportedAppUsage
|
||||||
private final boolean mIsHost;
|
private final boolean mIsHost;
|
||||||
private final boolean mHasGateway;
|
private final boolean mHasGateway;
|
||||||
|
|
||||||
@@ -160,6 +163,7 @@ public final class RouteInfo implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public RouteInfo(IpPrefix destination, InetAddress gateway, String iface) {
|
public RouteInfo(IpPrefix destination, InetAddress gateway, String iface) {
|
||||||
this(destination, gateway, iface, RTN_UNICAST);
|
this(destination, gateway, iface, RTN_UNICAST);
|
||||||
}
|
}
|
||||||
@@ -167,6 +171,7 @@ public final class RouteInfo implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public RouteInfo(LinkAddress destination, InetAddress gateway, String iface) {
|
public RouteInfo(LinkAddress destination, InetAddress gateway, String iface) {
|
||||||
this(destination == null ? null :
|
this(destination == null ? null :
|
||||||
new IpPrefix(destination.getAddress(), destination.getPrefixLength()),
|
new IpPrefix(destination.getAddress(), destination.getPrefixLength()),
|
||||||
@@ -197,6 +202,7 @@ public final class RouteInfo implements Parcelable {
|
|||||||
*
|
*
|
||||||
* TODO: Remove this.
|
* TODO: Remove this.
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public RouteInfo(LinkAddress destination, InetAddress gateway) {
|
public RouteInfo(LinkAddress destination, InetAddress gateway) {
|
||||||
this(destination, gateway, null);
|
this(destination, gateway, null);
|
||||||
}
|
}
|
||||||
@@ -208,6 +214,7 @@ public final class RouteInfo implements Parcelable {
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public RouteInfo(InetAddress gateway) {
|
public RouteInfo(InetAddress gateway) {
|
||||||
this((IpPrefix) null, gateway, null);
|
this((IpPrefix) null, gateway, null);
|
||||||
}
|
}
|
||||||
@@ -258,6 +265,7 @@ public final class RouteInfo implements Parcelable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UnsupportedAppUsage
|
||||||
private boolean isHost() {
|
private boolean isHost() {
|
||||||
return (mDestination.getAddress() instanceof Inet4Address &&
|
return (mDestination.getAddress() instanceof Inet4Address &&
|
||||||
mDestination.getPrefixLength() == 32) ||
|
mDestination.getPrefixLength() == 32) ||
|
||||||
@@ -355,6 +363,7 @@ public final class RouteInfo implements Parcelable {
|
|||||||
* @return {@code true} if a gateway is specified
|
* @return {@code true} if a gateway is specified
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public boolean hasGateway() {
|
public boolean hasGateway() {
|
||||||
return mHasGateway;
|
return mHasGateway;
|
||||||
}
|
}
|
||||||
@@ -379,6 +388,7 @@ public final class RouteInfo implements Parcelable {
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public static RouteInfo selectBestRoute(Collection<RouteInfo> routes, InetAddress dest) {
|
public static RouteInfo selectBestRoute(Collection<RouteInfo> routes, InetAddress dest) {
|
||||||
if ((routes == null) || (dest == null)) return null;
|
if ((routes == null) || (dest == null)) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.net.LinkAddress;
|
import android.net.LinkAddress;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
@@ -46,11 +47,16 @@ import java.util.Objects;
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public class StaticIpConfiguration implements Parcelable {
|
public class StaticIpConfiguration implements Parcelable {
|
||||||
|
@UnsupportedAppUsage
|
||||||
public LinkAddress ipAddress;
|
public LinkAddress ipAddress;
|
||||||
|
@UnsupportedAppUsage
|
||||||
public InetAddress gateway;
|
public InetAddress gateway;
|
||||||
|
@UnsupportedAppUsage
|
||||||
public final ArrayList<InetAddress> dnsServers;
|
public final ArrayList<InetAddress> dnsServers;
|
||||||
|
@UnsupportedAppUsage
|
||||||
public String domains;
|
public String domains;
|
||||||
|
|
||||||
|
@UnsupportedAppUsage
|
||||||
public StaticIpConfiguration() {
|
public StaticIpConfiguration() {
|
||||||
dnsServers = new ArrayList<InetAddress>();
|
dnsServers = new ArrayList<InetAddress>();
|
||||||
}
|
}
|
||||||
@@ -80,6 +86,7 @@ public class StaticIpConfiguration implements Parcelable {
|
|||||||
* route to the gateway as well. This configuration is arguably invalid, but it used to work
|
* route to the gateway as well. This configuration is arguably invalid, but it used to work
|
||||||
* in K and earlier, and other OSes appear to accept it.
|
* in K and earlier, and other OSes appear to accept it.
|
||||||
*/
|
*/
|
||||||
|
@UnsupportedAppUsage
|
||||||
public List<RouteInfo> getRoutes(String iface) {
|
public List<RouteInfo> getRoutes(String iface) {
|
||||||
List<RouteInfo> routes = new ArrayList<RouteInfo>(3);
|
List<RouteInfo> routes = new ArrayList<RouteInfo>(3);
|
||||||
if (ipAddress != null) {
|
if (ipAddress != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user