Merge "Add maxTargetSdk restriction to unused APIs."
This commit is contained in:
@@ -354,7 +354,7 @@ public class ConnectivityManager {
|
||||
* @hide
|
||||
*/
|
||||
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public static final String ACTION_TETHER_STATE_CHANGED =
|
||||
TetheringManager.ACTION_TETHER_STATE_CHANGED;
|
||||
|
||||
@@ -363,7 +363,7 @@ public class ConnectivityManager {
|
||||
* gives a String[] listing all the interfaces configured for
|
||||
* tethering and currently available for tethering.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public static final String EXTRA_AVAILABLE_TETHER = TetheringManager.EXTRA_AVAILABLE_TETHER;
|
||||
|
||||
/**
|
||||
@@ -378,7 +378,7 @@ public class ConnectivityManager {
|
||||
* gives a String[] listing all the interfaces currently tethered
|
||||
* (ie, has DHCPv4 support and packets potentially forwarded/NATed)
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public static final String EXTRA_ACTIVE_TETHER = TetheringManager.EXTRA_ACTIVE_TETHER;
|
||||
|
||||
/**
|
||||
@@ -387,7 +387,7 @@ public class ConnectivityManager {
|
||||
* failed. Use {@link #getLastTetherError} to find the error code
|
||||
* for any interfaces listed here.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public static final String EXTRA_ERRORED_TETHER = TetheringManager.EXTRA_ERRORED_TETHER;
|
||||
|
||||
/**
|
||||
@@ -850,7 +850,7 @@ public class ConnectivityManager {
|
||||
* {@hide}
|
||||
*/
|
||||
@Deprecated
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public static String getNetworkTypeName(int type) {
|
||||
switch (type) {
|
||||
case TYPE_NONE:
|
||||
@@ -1173,7 +1173,7 @@ public class ConnectivityManager {
|
||||
* {@hide}
|
||||
*/
|
||||
@RequiresPermission(android.Manifest.permission.NETWORK_STACK)
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public NetworkInfo getActiveNetworkInfoForUid(int uid) {
|
||||
return getActiveNetworkInfoForUid(uid, false);
|
||||
}
|
||||
@@ -1520,7 +1520,7 @@ public class ConnectivityManager {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
private NetworkCapabilities networkCapabilitiesForFeature(int networkType, String feature) {
|
||||
if (networkType == TYPE_MOBILE) {
|
||||
switch (feature) {
|
||||
@@ -1606,7 +1606,7 @@ public class ConnectivityManager {
|
||||
};
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
private static final HashMap<NetworkCapabilities, LegacyRequest> sLegacyRequests =
|
||||
new HashMap<>();
|
||||
|
||||
@@ -1635,7 +1635,7 @@ public class ConnectivityManager {
|
||||
Log.d(TAG, "expireRequest with " + ourSeqNum + ", " + sequenceNum);
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
private NetworkRequest requestNetworkForFeatureLocked(NetworkCapabilities netCap) {
|
||||
int delay = -1;
|
||||
int type = legacyTypeForNetworkCapabilities(netCap);
|
||||
@@ -1665,7 +1665,7 @@ public class ConnectivityManager {
|
||||
}
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
private boolean removeRequestForFeature(NetworkCapabilities netCap) {
|
||||
final LegacyRequest l;
|
||||
synchronized (sLegacyRequests) {
|
||||
@@ -1732,17 +1732,17 @@ public class ConnectivityManager {
|
||||
|
||||
/** @hide */
|
||||
public static class PacketKeepaliveCallback {
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public PacketKeepaliveCallback() {
|
||||
}
|
||||
/** The requested keepalive was successfully started. */
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public void onStarted() {}
|
||||
/** The keepalive was successfully stopped. */
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public void onStopped() {}
|
||||
/** An error occurred. */
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public void onError(int error) {}
|
||||
}
|
||||
|
||||
@@ -1806,7 +1806,7 @@ public class ConnectivityManager {
|
||||
|
||||
private volatile Integer mSlot;
|
||||
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public void stop() {
|
||||
try {
|
||||
mExecutor.execute(() -> {
|
||||
@@ -1875,7 +1875,7 @@ public class ConnectivityManager {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public PacketKeepalive startNattKeepalive(
|
||||
Network network, int intervalSeconds, PacketKeepaliveCallback callback,
|
||||
InetAddress srcAddr, int srcPort, InetAddress dstAddr) {
|
||||
@@ -2110,7 +2110,7 @@ public class ConnectivityManager {
|
||||
|
||||
/** {@hide} */
|
||||
@Deprecated
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public NetworkQuotaInfo getActiveNetworkQuotaInfo() {
|
||||
try {
|
||||
return mService.getActiveNetworkQuotaInfo();
|
||||
@@ -2408,7 +2408,7 @@ public class ConnectivityManager {
|
||||
*
|
||||
* {@hide}
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
@Deprecated
|
||||
public int tether(String iface) {
|
||||
return mTetheringManager.tether(iface);
|
||||
@@ -2849,7 +2849,7 @@ public class ConnectivityManager {
|
||||
* {@hide}
|
||||
*/
|
||||
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
@Deprecated
|
||||
public int getLastTetherError(String iface) {
|
||||
int error = mTetheringManager.getLastTetherError(iface);
|
||||
@@ -4659,7 +4659,7 @@ public class ConnectivityManager {
|
||||
* @deprecated This is strictly for legacy usage to support {@link #startUsingNetworkFeature}.
|
||||
*/
|
||||
@Deprecated
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public static boolean setProcessDefaultNetworkForHostResolution(Network network) {
|
||||
return NetworkUtils.bindProcessToNetworkForHostResolution(
|
||||
(network == null) ? NETID_UNSET : network.getNetIdForResolv());
|
||||
|
||||
@@ -73,7 +73,7 @@ interface IConnectivityManager
|
||||
|
||||
NetworkCapabilities getNetworkCapabilities(in Network network, String callingPackageName);
|
||||
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
|
||||
NetworkState[] getAllNetworkState();
|
||||
|
||||
NetworkQuotaInfo getActiveNetworkQuotaInfo();
|
||||
@@ -134,7 +134,7 @@ interface IConnectivityManager
|
||||
|
||||
VpnConfig getVpnConfig(int userId);
|
||||
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
|
||||
void startLegacyVpn(in VpnProfile profile);
|
||||
|
||||
LegacyVpnInfo getLegacyVpnInfo(int userId);
|
||||
|
||||
@@ -21,6 +21,7 @@ import android.annotation.Nullable;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.SystemApi;
|
||||
import android.compat.annotation.UnsupportedAppUsage;
|
||||
import android.os.Build;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
@@ -98,7 +99,7 @@ public final class IpConfiguration implements Parcelable {
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public IpConfiguration(IpAssignment ipAssignment,
|
||||
ProxySettings proxySettings,
|
||||
StaticIpConfiguration staticIpConfiguration,
|
||||
|
||||
@@ -111,7 +111,7 @@ public final class LinkProperties implements Parcelable {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public static ProvisioningChange compareProvisioning(
|
||||
LinkProperties before, LinkProperties after) {
|
||||
if (before.isProvisioned() && after.isProvisioned()) {
|
||||
@@ -849,7 +849,7 @@ public final class LinkProperties implements Parcelable {
|
||||
* Returns all the links stacked on top of this link.
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public @NonNull List<LinkProperties> getStackedLinks() {
|
||||
if (mStackedLinks.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
@@ -1448,7 +1448,7 @@ public final class LinkProperties implements Parcelable {
|
||||
* @return {@code true} if both are identical, {@code false} otherwise.
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public boolean isIdenticalStackedLinks(@NonNull LinkProperties target) {
|
||||
if (!mStackedLinks.keySet().equals(target.mStackedLinks.keySet())) {
|
||||
return false;
|
||||
|
||||
@@ -22,6 +22,7 @@ import android.annotation.Nullable;
|
||||
import android.compat.annotation.UnsupportedAppUsage;
|
||||
import android.net.util.MacAddressUtils;
|
||||
import android.net.wifi.WifiInfo;
|
||||
import android.os.Build;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
@@ -58,7 +59,7 @@ public final class MacAddress implements Parcelable {
|
||||
* <p>Not publicly exposed or treated specially since the OUI 00:00:00 is registered.
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public static final MacAddress ALL_ZEROS_ADDRESS = new MacAddress(0);
|
||||
|
||||
/** @hide */
|
||||
|
||||
@@ -19,6 +19,7 @@ package android.net;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.SystemApi;
|
||||
import android.compat.annotation.UnsupportedAppUsage;
|
||||
import android.os.Build;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.system.ErrnoException;
|
||||
@@ -109,7 +110,7 @@ public class Network implements Parcelable {
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public Network(int netId) {
|
||||
this(netId, false);
|
||||
}
|
||||
|
||||
@@ -133,7 +133,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
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
private long mNetworkCapabilities;
|
||||
|
||||
/**
|
||||
@@ -1288,7 +1288,7 @@ public final class NetworkCapabilities implements Parcelable {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public boolean hasSignalStrength() {
|
||||
return mSignalStrength > SIGNAL_STRENGTH_UNSPECIFIED;
|
||||
}
|
||||
@@ -1927,7 +1927,7 @@ public final class NetworkCapabilities implements Parcelable {
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public static @NonNull String transportNamesOf(@Nullable @Transport int[] types) {
|
||||
StringJoiner joiner = new StringJoiner("|");
|
||||
if (types != null) {
|
||||
|
||||
@@ -43,7 +43,7 @@ public class NetworkRequest implements Parcelable {
|
||||
* The {@link NetworkCapabilities} that define this request.
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public final @NonNull NetworkCapabilities networkCapabilities;
|
||||
|
||||
/**
|
||||
@@ -52,7 +52,7 @@ public class NetworkRequest implements Parcelable {
|
||||
* the request.
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public final int requestId;
|
||||
|
||||
/**
|
||||
|
||||
@@ -98,7 +98,7 @@ public class NetworkUtils {
|
||||
* this socket will go directly to the underlying network, so its traffic will not be
|
||||
* forwarded through the VPN.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public static boolean protectFromVpn(FileDescriptor fd) {
|
||||
return protectFromVpn(fd.getInt$());
|
||||
}
|
||||
@@ -223,7 +223,7 @@ public class NetworkUtils {
|
||||
* @hide
|
||||
* @deprecated use {@link Inet4AddressUtils#netmaskToPrefixLength(Inet4Address)}
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
@Deprecated
|
||||
public static int netmaskToPrefixLength(Inet4Address netmask) {
|
||||
// This is only here because some apps seem to be using it (@UnsupportedAppUsage).
|
||||
@@ -290,7 +290,7 @@ public class NetworkUtils {
|
||||
/**
|
||||
* Returns the implicit netmask of an IPv4 address, as was the custom before 1993.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public static int getImplicitNetmask(Inet4Address address) {
|
||||
// Only here because it seems to be used by apps
|
||||
return Inet4AddressUtils.getImplicitNetmask(address);
|
||||
|
||||
@@ -232,7 +232,7 @@ public final class RouteInfo implements Parcelable {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public RouteInfo(@Nullable IpPrefix destination, @Nullable InetAddress gateway,
|
||||
@Nullable String iface) {
|
||||
this(destination, gateway, iface, RTN_UNICAST);
|
||||
@@ -501,7 +501,7 @@ public final class RouteInfo implements Parcelable {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
@Nullable
|
||||
public static RouteInfo selectBestRoute(Collection<RouteInfo> routes, InetAddress dest) {
|
||||
return NetUtils.selectBestRoute(routes, dest);
|
||||
|
||||
@@ -20,6 +20,7 @@ import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.SystemApi;
|
||||
import android.compat.annotation.UnsupportedAppUsage;
|
||||
import android.os.Build;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
@@ -53,19 +54,19 @@ import java.util.Objects;
|
||||
@SystemApi
|
||||
public final class StaticIpConfiguration implements Parcelable {
|
||||
/** @hide */
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
@Nullable
|
||||
public LinkAddress ipAddress;
|
||||
/** @hide */
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
@Nullable
|
||||
public InetAddress gateway;
|
||||
/** @hide */
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
@NonNull
|
||||
public final ArrayList<InetAddress> dnsServers;
|
||||
/** @hide */
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
@Nullable
|
||||
public String domains;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user