From 9a6fd906e62f336855e9f8ba10b5ab91b8ada836 Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Mon, 19 Oct 2020 16:15:58 +0100 Subject: [PATCH] Remove @TestApi from @SystemApi symbols I ran these commands: cd frameworks/base grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \ 's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs' grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \ 's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs' Bug: 171179806 Test: m checkapi Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789 Merged-In: I772790b783b0a8730b8bf680c9e569a886b8d789 --- core/java/android/net/CaptivePortal.java | 8 ------ core/java/android/net/CaptivePortalData.java | 2 -- .../java/android/net/ConnectivityManager.java | 3 --- core/java/android/net/IpPrefix.java | 3 --- core/java/android/net/LinkAddress.java | 12 --------- core/java/android/net/LinkProperties.java | 27 ------------------- core/java/android/net/Network.java | 4 --- .../java/android/net/NetworkCapabilities.java | 5 ---- core/java/android/net/RouteInfo.java | 6 ----- .../android/net/StaticIpConfiguration.java | 2 -- .../java/android/net/apf/ApfCapabilities.java | 2 -- 11 files changed, 74 deletions(-) diff --git a/core/java/android/net/CaptivePortal.java b/core/java/android/net/CaptivePortal.java index 8afeb3033c..c2586fa0c8 100644 --- a/core/java/android/net/CaptivePortal.java +++ b/core/java/android/net/CaptivePortal.java @@ -19,7 +19,6 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.RequiresPermission; import android.annotation.SystemApi; -import android.annotation.TestApi; import android.os.IBinder; import android.os.Parcel; import android.os.Parcelable; @@ -42,7 +41,6 @@ public class CaptivePortal implements Parcelable { * @hide */ @SystemApi - @TestApi public static final int APP_RETURN_DISMISSED = 0; /** * Response code from the captive portal application, indicating that the user did not login and @@ -52,7 +50,6 @@ public class CaptivePortal implements Parcelable { * @hide */ @SystemApi - @TestApi public static final int APP_RETURN_UNWANTED = 1; /** * Response code from the captive portal application, indicating that the user does not wish to @@ -62,7 +59,6 @@ public class CaptivePortal implements Parcelable { * @hide */ @SystemApi - @TestApi public static final int APP_RETURN_WANTED_AS_IS = 2; /** Event offset of request codes from captive portal application. */ private static final int APP_REQUEST_BASE = 100; @@ -74,7 +70,6 @@ public class CaptivePortal implements Parcelable { * @hide */ @SystemApi - @TestApi public static final int APP_REQUEST_REEVALUATION_REQUIRED = APP_REQUEST_BASE + 0; private final IBinder mBinder; @@ -154,7 +149,6 @@ public class CaptivePortal implements Parcelable { * @hide */ @SystemApi - @TestApi public void useNetwork() { try { ICaptivePortal.Stub.asInterface(mBinder).appResponse(APP_RETURN_WANTED_AS_IS); @@ -167,7 +161,6 @@ public class CaptivePortal implements Parcelable { * @hide */ @SystemApi - @TestApi @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void reevaluateNetwork() { try { @@ -183,7 +176,6 @@ public class CaptivePortal implements Parcelable { * @hide */ @SystemApi - @TestApi public void logEvent(@EventId int eventId, @NonNull String packageName) { try { ICaptivePortal.Stub.asInterface(mBinder).logEvent(eventId, packageName); diff --git a/core/java/android/net/CaptivePortalData.java b/core/java/android/net/CaptivePortalData.java index 1357803a6c..c443c7500f 100644 --- a/core/java/android/net/CaptivePortalData.java +++ b/core/java/android/net/CaptivePortalData.java @@ -19,7 +19,6 @@ package android.net; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; -import android.annotation.TestApi; import android.os.Parcel; import android.os.Parcelable; @@ -30,7 +29,6 @@ import java.util.Objects; * @hide */ @SystemApi -@TestApi public final class CaptivePortalData implements Parcelable { private final long mRefreshTimeMillis; @Nullable diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index dcf3b5cae7..0def8b1af5 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -269,7 +269,6 @@ public class ConnectivityManager { * {@hide} */ @SystemApi - @TestApi public static final String EXTRA_CAPTIVE_PORTAL_PROBE_SPEC = "android.net.extra.CAPTIVE_PORTAL_PROBE_SPEC"; @@ -278,7 +277,6 @@ public class ConnectivityManager { * {@hide} */ @SystemApi - @TestApi public static final String EXTRA_CAPTIVE_PORTAL_USER_AGENT = "android.net.extra.CAPTIVE_PORTAL_USER_AGENT"; @@ -4401,7 +4399,6 @@ public class ConnectivityManager { * @hide */ @SystemApi - @TestApi @RequiresPermission(NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK) public void startCaptivePortalApp(@NonNull Network network, @NonNull Bundle appExtras) { try { diff --git a/core/java/android/net/IpPrefix.java b/core/java/android/net/IpPrefix.java index 8cfe6df678..e7c801475c 100644 --- a/core/java/android/net/IpPrefix.java +++ b/core/java/android/net/IpPrefix.java @@ -19,7 +19,6 @@ package android.net; import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.SystemApi; -import android.annotation.TestApi; import android.os.Parcel; import android.os.Parcelable; import android.util.Pair; @@ -88,7 +87,6 @@ public final class IpPrefix implements Parcelable { * @hide */ @SystemApi - @TestApi public IpPrefix(@NonNull InetAddress address, @IntRange(from = 0, to = 128) int prefixLength) { // We don't reuse the (byte[], int) constructor because it calls clone() on the byte array, // which is unnecessary because getAddress() already returns a clone. @@ -107,7 +105,6 @@ public final class IpPrefix implements Parcelable { * @hide */ @SystemApi - @TestApi public IpPrefix(@NonNull String prefix) { // We don't reuse the (InetAddress, int) constructor because "error: call to this must be // first statement in constructor". We could factor out setting the member variables to an diff --git a/core/java/android/net/LinkAddress.java b/core/java/android/net/LinkAddress.java index a9d7f17017..44d25a1ab0 100644 --- a/core/java/android/net/LinkAddress.java +++ b/core/java/android/net/LinkAddress.java @@ -30,7 +30,6 @@ import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; -import android.annotation.TestApi; import android.compat.annotation.UnsupportedAppUsage; import android.os.Build; import android.os.Parcel; @@ -158,7 +157,6 @@ public class LinkAddress implements Parcelable { * @return true if the address is IPv6. * @hide */ - @TestApi @SystemApi public boolean isIpv6() { return address instanceof Inet6Address; @@ -180,7 +178,6 @@ public class LinkAddress implements Parcelable { * @return true if the address is IPv4 or is a mapped IPv4 address. * @hide */ - @TestApi @SystemApi public boolean isIpv4() { return address instanceof Inet4Address; @@ -243,7 +240,6 @@ public class LinkAddress implements Parcelable { * @hide */ @SystemApi - @TestApi public LinkAddress(@NonNull InetAddress address, @IntRange(from = 0, to = 128) int prefixLength, int flags, int scope) { init(address, prefixLength, flags, scope, LIFETIME_UNKNOWN, LIFETIME_UNKNOWN); @@ -275,7 +271,6 @@ public class LinkAddress implements Parcelable { * @hide */ @SystemApi - @TestApi public LinkAddress(@NonNull InetAddress address, @IntRange(from = 0, to = 128) int prefixLength, int flags, int scope, long deprecationTime, long expirationTime) { init(address, prefixLength, flags, scope, deprecationTime, expirationTime); @@ -289,7 +284,6 @@ public class LinkAddress implements Parcelable { * @hide */ @SystemApi - @TestApi public LinkAddress(@NonNull InetAddress address, @IntRange(from = 0, to = 128) int prefixLength) { this(address, prefixLength, 0, 0); @@ -314,7 +308,6 @@ public class LinkAddress implements Parcelable { * @hide */ @SystemApi - @TestApi public LinkAddress(@NonNull String address) { this(address, 0, 0); this.scope = scopeForUnicastAddress(this.address); @@ -329,7 +322,6 @@ public class LinkAddress implements Parcelable { * @hide */ @SystemApi - @TestApi public LinkAddress(@NonNull String address, int flags, int scope) { // This may throw an IllegalArgumentException; catching it is the caller's responsibility. // TODO: consider rejecting mapped IPv4 addresses such as "::ffff:192.0.2.5/24". @@ -389,7 +381,6 @@ public class LinkAddress implements Parcelable { * otherwise. * @hide */ - @TestApi @SystemApi public boolean isSameAddressAs(@Nullable LinkAddress other) { if (other == null) { @@ -469,7 +460,6 @@ public class LinkAddress implements Parcelable { * @hide */ @SystemApi - @TestApi public long getDeprecationTime() { return deprecationTime; } @@ -485,7 +475,6 @@ public class LinkAddress implements Parcelable { * @hide */ @SystemApi - @TestApi public long getExpirationTime() { return expirationTime; } @@ -496,7 +485,6 @@ public class LinkAddress implements Parcelable { * * @hide */ - @TestApi @SystemApi public boolean isGlobalPreferred() { /** diff --git a/core/java/android/net/LinkProperties.java b/core/java/android/net/LinkProperties.java index 651494d1c9..3e41e573e2 100644 --- a/core/java/android/net/LinkProperties.java +++ b/core/java/android/net/LinkProperties.java @@ -19,7 +19,6 @@ package android.net; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; -import android.annotation.TestApi; import android.compat.annotation.UnsupportedAppUsage; import android.net.util.LinkPropertiesUtils; import android.net.util.LinkPropertiesUtils.CompareResult; @@ -162,7 +161,6 @@ public final class LinkProperties implements Parcelable { * @hide */ @SystemApi - @TestApi public LinkProperties(@Nullable LinkProperties source) { this(source, false /* parcelSensitiveFields */); } @@ -178,7 +176,6 @@ public final class LinkProperties implements Parcelable { * @hide */ @SystemApi - @TestApi public LinkProperties(@Nullable LinkProperties source, boolean parcelSensitiveFields) { mParcelSensitiveFields = parcelSensitiveFields; if (source == null) return; @@ -293,7 +290,6 @@ public final class LinkProperties implements Parcelable { * @hide */ @SystemApi - @TestApi public boolean addLinkAddress(@NonNull LinkAddress address) { if (address == null) { return false; @@ -322,7 +318,6 @@ public final class LinkProperties implements Parcelable { * @hide */ @SystemApi - @TestApi public boolean removeLinkAddress(@NonNull LinkAddress toRemove) { int i = findLinkAddressIndex(toRemove); if (i >= 0) { @@ -376,7 +371,6 @@ public final class LinkProperties implements Parcelable { * @return true if the DNS server was added, false if it was already present. * @hide */ - @TestApi @SystemApi public boolean addDnsServer(@NonNull InetAddress dnsServer) { if (dnsServer != null && !mDnses.contains(dnsServer)) { @@ -393,7 +387,6 @@ public final class LinkProperties implements Parcelable { * @return true if the DNS server was removed, false if it did not exist. * @hide */ - @TestApi @SystemApi public boolean removeDnsServer(@NonNull InetAddress dnsServer) { return mDnses.remove(dnsServer); @@ -428,7 +421,6 @@ public final class LinkProperties implements Parcelable { * @param usePrivateDns The private DNS state. * @hide */ - @TestApi @SystemApi public void setUsePrivateDns(boolean usePrivateDns) { mUsePrivateDns = usePrivateDns; @@ -455,7 +447,6 @@ public final class LinkProperties implements Parcelable { * @param privateDnsServerName The private DNS server name. * @hide */ - @TestApi @SystemApi public void setPrivateDnsServerName(@Nullable String privateDnsServerName) { mPrivateDnsServerName = privateDnsServerName; @@ -534,7 +525,6 @@ public final class LinkProperties implements Parcelable { * object. * @hide */ - @TestApi @SystemApi public void setValidatedPrivateDnsServers(@NonNull Collection dnsServers) { mValidatedPrivateDnses.clear(); @@ -551,7 +541,6 @@ public final class LinkProperties implements Parcelable { * DNS servers on this link. * @hide */ - @TestApi @SystemApi public @NonNull List getValidatedPrivateDnsServers() { return Collections.unmodifiableList(mValidatedPrivateDnses); @@ -592,7 +581,6 @@ public final class LinkProperties implements Parcelable { * @hide */ @SystemApi - @TestApi public void setPcscfServers(@NonNull Collection pcscfServers) { mPcscfs.clear(); for (InetAddress pcscfServer: pcscfServers) { @@ -608,7 +596,6 @@ public final class LinkProperties implements Parcelable { * @hide */ @SystemApi - @TestApi public @NonNull List getPcscfServers() { return Collections.unmodifiableList(mPcscfs); } @@ -662,7 +649,6 @@ public final class LinkProperties implements Parcelable { * * @hide */ - @TestApi @SystemApi public void setTcpBufferSizes(@Nullable String tcpBufferSizes) { mTcpBufferSizes = tcpBufferSizes; @@ -675,7 +661,6 @@ public final class LinkProperties implements Parcelable { * * @hide */ - @TestApi @SystemApi public @Nullable String getTcpBufferSizes() { return mTcpBufferSizes; @@ -744,7 +729,6 @@ public final class LinkProperties implements Parcelable { * * @hide */ - @TestApi @SystemApi public boolean removeRoute(@NonNull RouteInfo route) { return Objects.equals(mIfaceName, route.getInterface()) && mRoutes.remove(route); @@ -1021,7 +1005,6 @@ public final class LinkProperties implements Parcelable { * @return {@code true} if there is an IPv4 address, {@code false} otherwise. * @hide */ - @TestApi @SystemApi public boolean hasIpv4Address() { for (LinkAddress address : mLinkAddresses) { @@ -1062,7 +1045,6 @@ public final class LinkProperties implements Parcelable { * @return {@code true} if there is a global preferred IPv6 address, {@code false} otherwise. * @hide */ - @TestApi @SystemApi public boolean hasGlobalIpv6Address() { for (LinkAddress address : mLinkAddresses) { @@ -1149,7 +1131,6 @@ public final class LinkProperties implements Parcelable { * @return {@code true} if there is an IPv6 default route, {@code false} otherwise. * @hide */ - @TestApi @SystemApi public boolean hasIpv6DefaultRoute() { for (RouteInfo r : mRoutes) { @@ -1265,7 +1246,6 @@ public final class LinkProperties implements Parcelable { * @return {@code true} if the link is provisioned, {@code false} otherwise. * @hide */ - @TestApi @SystemApi public boolean isIpv4Provisioned() { return (hasIpv4Address() @@ -1280,7 +1260,6 @@ public final class LinkProperties implements Parcelable { * @return {@code true} if the link is provisioned, {@code false} otherwise. * @hide */ - @TestApi @SystemApi public boolean isIpv6Provisioned() { return (hasGlobalIpv6Address() @@ -1308,7 +1287,6 @@ public final class LinkProperties implements Parcelable { * @return {@code true} if the link is provisioned, {@code false} otherwise. * @hide */ - @TestApi @SystemApi public boolean isProvisioned() { return (isIpv4Provisioned() || isIpv6Provisioned()); @@ -1321,7 +1299,6 @@ public final class LinkProperties implements Parcelable { * {@code false} otherwise. * @hide */ - @TestApi @SystemApi public boolean isReachable(@NonNull InetAddress ip) { final List allRoutes = getAllRoutes(); @@ -1578,7 +1555,6 @@ public final class LinkProperties implements Parcelable { * @hide */ @SystemApi - @TestApi public void setCaptivePortalApiUrl(@Nullable Uri url) { mCaptivePortalApiUrl = url; } @@ -1593,7 +1569,6 @@ public final class LinkProperties implements Parcelable { * @hide */ @SystemApi - @TestApi @Nullable public Uri getCaptivePortalApiUrl() { return mCaptivePortalApiUrl; @@ -1604,7 +1579,6 @@ public final class LinkProperties implements Parcelable { * @hide */ @SystemApi - @TestApi public void setCaptivePortalData(@Nullable CaptivePortalData data) { mCaptivePortalData = data; } @@ -1618,7 +1592,6 @@ public final class LinkProperties implements Parcelable { * @hide */ @SystemApi - @TestApi @Nullable public CaptivePortalData getCaptivePortalData() { return mCaptivePortalData; diff --git a/core/java/android/net/Network.java b/core/java/android/net/Network.java index b872617ab3..25619384ac 100644 --- a/core/java/android/net/Network.java +++ b/core/java/android/net/Network.java @@ -18,7 +18,6 @@ package android.net; import android.annotation.NonNull; import android.annotation.SystemApi; -import android.annotation.TestApi; import android.compat.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; @@ -127,7 +126,6 @@ public class Network implements Parcelable { * @hide */ @SystemApi - @TestApi public Network(@NonNull Network that) { this(that.netId, that.mPrivateDnsBypass); } @@ -164,7 +162,6 @@ public class Network implements Parcelable { * * @hide */ - @TestApi @SystemApi public @NonNull Network getPrivateDnsBypassingCopy() { return new Network(netId, true); @@ -175,7 +172,6 @@ public class Network implements Parcelable { * * @hide */ - @TestApi @SystemApi public int getNetId() { return netId; diff --git a/core/java/android/net/NetworkCapabilities.java b/core/java/android/net/NetworkCapabilities.java index 004f84422b..be33f4edb5 100644 --- a/core/java/android/net/NetworkCapabilities.java +++ b/core/java/android/net/NetworkCapabilities.java @@ -850,7 +850,6 @@ public final class NetworkCapabilities implements Parcelable { * @return an array of transport type values for this instance. * @hide */ - @TestApi @SystemApi @NonNull public @Transport int[] getTransportTypes() { return BitUtils.unpackBits(mTransportTypes); @@ -1025,7 +1024,6 @@ public final class NetworkCapabilities implements Parcelable { */ @NonNull @SystemApi - @TestApi public int[] getAdministratorUids() { return Arrays.copyOf(mAdministratorUids, mAdministratorUids.length); } @@ -1506,7 +1504,6 @@ public final class NetworkCapabilities implements Parcelable { * @hide */ @SystemApi - @TestApi public @Nullable String getSsid() { return mSSID; } @@ -1590,7 +1587,6 @@ public final class NetworkCapabilities implements Parcelable { * * @hide */ - @TestApi @SystemApi public boolean satisfiedByNetworkCapabilities(@Nullable NetworkCapabilities nc) { return satisfiedByNetworkCapabilities(nc, false); @@ -2136,7 +2132,6 @@ public final class NetworkCapabilities implements Parcelable { * @hide */ @SystemApi - @TestApi public static final class Builder { private final NetworkCapabilities mCaps; diff --git a/core/java/android/net/RouteInfo.java b/core/java/android/net/RouteInfo.java index 9876076173..62aebb0180 100644 --- a/core/java/android/net/RouteInfo.java +++ b/core/java/android/net/RouteInfo.java @@ -20,7 +20,6 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; -import android.annotation.TestApi; import android.compat.annotation.UnsupportedAppUsage; import android.net.util.NetUtils; import android.os.Build; @@ -87,17 +86,14 @@ public final class RouteInfo implements Parcelable { /** Unicast route. @hide */ @SystemApi - @TestApi public static final int RTN_UNICAST = 1; /** Unreachable route. @hide */ @SystemApi - @TestApi public static final int RTN_UNREACHABLE = 7; /** Throw route. @hide */ @SystemApi - @TestApi public static final int RTN_THROW = 9; /** @@ -135,7 +131,6 @@ public final class RouteInfo implements Parcelable { * @hide */ @SystemApi - @TestApi public RouteInfo(@Nullable IpPrefix destination, @Nullable InetAddress gateway, @Nullable String iface, @RouteType int type) { this(destination, gateway, iface, type, 0); @@ -397,7 +392,6 @@ public final class RouteInfo implements Parcelable { * * @hide */ - @TestApi @SystemApi @RouteType public int getType() { diff --git a/core/java/android/net/StaticIpConfiguration.java b/core/java/android/net/StaticIpConfiguration.java index a973455baa..f56d656f07 100644 --- a/core/java/android/net/StaticIpConfiguration.java +++ b/core/java/android/net/StaticIpConfiguration.java @@ -19,7 +19,6 @@ package android.net; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; -import android.annotation.TestApi; import android.compat.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; @@ -52,7 +51,6 @@ import java.util.Objects; * @hide */ @SystemApi -@TestApi public final class StaticIpConfiguration implements Parcelable { /** @hide */ @UnsupportedAppUsage diff --git a/core/java/android/net/apf/ApfCapabilities.java b/core/java/android/net/apf/ApfCapabilities.java index 92c543294a..bf5b26e278 100644 --- a/core/java/android/net/apf/ApfCapabilities.java +++ b/core/java/android/net/apf/ApfCapabilities.java @@ -19,7 +19,6 @@ package android.net.apf; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; -import android.annotation.TestApi; import android.content.res.Resources; import android.os.Parcel; import android.os.Parcelable; @@ -36,7 +35,6 @@ import com.android.internal.R; * @hide */ @SystemApi -@TestApi public final class ApfCapabilities implements Parcelable { /** * Version of APF instruction set supported for packet filtering. 0 indicates no support for