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