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
diff --git a/core/java/android/net/CaptivePortal.java b/core/java/android/net/CaptivePortal.java
index 8afeb30..c2586fa 100644
--- a/core/java/android/net/CaptivePortal.java
+++ b/core/java/android/net/CaptivePortal.java
@@ -19,7 +19,6 @@
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 @@
* @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 @@
* @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 @@
* @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 @@
* @hide
*/
@SystemApi
- @TestApi
public static final int APP_REQUEST_REEVALUATION_REQUIRED = APP_REQUEST_BASE + 0;
private final IBinder mBinder;
@@ -154,7 +149,6 @@
* @hide
*/
@SystemApi
- @TestApi
public void useNetwork() {
try {
ICaptivePortal.Stub.asInterface(mBinder).appResponse(APP_RETURN_WANTED_AS_IS);
@@ -167,7 +161,6 @@
* @hide
*/
@SystemApi
- @TestApi
@RequiresPermission(android.Manifest.permission.NETWORK_STACK)
public void reevaluateNetwork() {
try {
@@ -183,7 +176,6 @@
* @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 1357803..c443c75 100644
--- a/core/java/android/net/CaptivePortalData.java
+++ b/core/java/android/net/CaptivePortalData.java
@@ -19,7 +19,6 @@
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 @@
* @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 dcf3b5c..0def8b1 100644
--- a/core/java/android/net/ConnectivityManager.java
+++ b/core/java/android/net/ConnectivityManager.java
@@ -269,7 +269,6 @@
* {@hide}
*/
@SystemApi
- @TestApi
public static final String EXTRA_CAPTIVE_PORTAL_PROBE_SPEC =
"android.net.extra.CAPTIVE_PORTAL_PROBE_SPEC";
@@ -278,7 +277,6 @@
* {@hide}
*/
@SystemApi
- @TestApi
public static final String EXTRA_CAPTIVE_PORTAL_USER_AGENT =
"android.net.extra.CAPTIVE_PORTAL_USER_AGENT";
@@ -4401,7 +4399,6 @@
* @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 8cfe6df..e7c8014 100644
--- a/core/java/android/net/IpPrefix.java
+++ b/core/java/android/net/IpPrefix.java
@@ -19,7 +19,6 @@
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 @@
* @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 @@
* @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 a9d7f17..44d25a1 100644
--- a/core/java/android/net/LinkAddress.java
+++ b/core/java/android/net/LinkAddress.java
@@ -30,7 +30,6 @@
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 @@
* @return true if the address is IPv6.
* @hide
*/
- @TestApi
@SystemApi
public boolean isIpv6() {
return address instanceof Inet6Address;
@@ -180,7 +178,6 @@
* @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 @@
* @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 @@
* @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 @@
* @hide
*/
@SystemApi
- @TestApi
public LinkAddress(@NonNull InetAddress address,
@IntRange(from = 0, to = 128) int prefixLength) {
this(address, prefixLength, 0, 0);
@@ -314,7 +308,6 @@
* @hide
*/
@SystemApi
- @TestApi
public LinkAddress(@NonNull String address) {
this(address, 0, 0);
this.scope = scopeForUnicastAddress(this.address);
@@ -329,7 +322,6 @@
* @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 @@
* otherwise.
* @hide
*/
- @TestApi
@SystemApi
public boolean isSameAddressAs(@Nullable LinkAddress other) {
if (other == null) {
@@ -469,7 +460,6 @@
* @hide
*/
@SystemApi
- @TestApi
public long getDeprecationTime() {
return deprecationTime;
}
@@ -485,7 +475,6 @@
* @hide
*/
@SystemApi
- @TestApi
public long getExpirationTime() {
return expirationTime;
}
@@ -496,7 +485,6 @@
*
* @hide
*/
- @TestApi
@SystemApi
public boolean isGlobalPreferred() {
/**
diff --git a/core/java/android/net/LinkProperties.java b/core/java/android/net/LinkProperties.java
index 651494d..3e41e57 100644
--- a/core/java/android/net/LinkProperties.java
+++ b/core/java/android/net/LinkProperties.java
@@ -19,7 +19,6 @@
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 @@
* @hide
*/
@SystemApi
- @TestApi
public LinkProperties(@Nullable LinkProperties source) {
this(source, false /* parcelSensitiveFields */);
}
@@ -178,7 +176,6 @@
* @hide
*/
@SystemApi
- @TestApi
public LinkProperties(@Nullable LinkProperties source, boolean parcelSensitiveFields) {
mParcelSensitiveFields = parcelSensitiveFields;
if (source == null) return;
@@ -293,7 +290,6 @@
* @hide
*/
@SystemApi
- @TestApi
public boolean addLinkAddress(@NonNull LinkAddress address) {
if (address == null) {
return false;
@@ -322,7 +318,6 @@
* @hide
*/
@SystemApi
- @TestApi
public boolean removeLinkAddress(@NonNull LinkAddress toRemove) {
int i = findLinkAddressIndex(toRemove);
if (i >= 0) {
@@ -376,7 +371,6 @@
* @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 @@
* @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 @@
* @param usePrivateDns The private DNS state.
* @hide
*/
- @TestApi
@SystemApi
public void setUsePrivateDns(boolean usePrivateDns) {
mUsePrivateDns = usePrivateDns;
@@ -455,7 +447,6 @@
* @param privateDnsServerName The private DNS server name.
* @hide
*/
- @TestApi
@SystemApi
public void setPrivateDnsServerName(@Nullable String privateDnsServerName) {
mPrivateDnsServerName = privateDnsServerName;
@@ -534,7 +525,6 @@
* object.
* @hide
*/
- @TestApi
@SystemApi
public void setValidatedPrivateDnsServers(@NonNull Collection<InetAddress> dnsServers) {
mValidatedPrivateDnses.clear();
@@ -551,7 +541,6 @@
* DNS servers on this link.
* @hide
*/
- @TestApi
@SystemApi
public @NonNull List<InetAddress> getValidatedPrivateDnsServers() {
return Collections.unmodifiableList(mValidatedPrivateDnses);
@@ -592,7 +581,6 @@
* @hide
*/
@SystemApi
- @TestApi
public void setPcscfServers(@NonNull Collection<InetAddress> pcscfServers) {
mPcscfs.clear();
for (InetAddress pcscfServer: pcscfServers) {
@@ -608,7 +596,6 @@
* @hide
*/
@SystemApi
- @TestApi
public @NonNull List<InetAddress> getPcscfServers() {
return Collections.unmodifiableList(mPcscfs);
}
@@ -662,7 +649,6 @@
*
* @hide
*/
- @TestApi
@SystemApi
public void setTcpBufferSizes(@Nullable String tcpBufferSizes) {
mTcpBufferSizes = tcpBufferSizes;
@@ -675,7 +661,6 @@
*
* @hide
*/
- @TestApi
@SystemApi
public @Nullable String getTcpBufferSizes() {
return mTcpBufferSizes;
@@ -744,7 +729,6 @@
*
* @hide
*/
- @TestApi
@SystemApi
public boolean removeRoute(@NonNull RouteInfo route) {
return Objects.equals(mIfaceName, route.getInterface()) && mRoutes.remove(route);
@@ -1021,7 +1005,6 @@
* @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 @@
* @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 @@
* @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 @@
* @return {@code true} if the link is provisioned, {@code false} otherwise.
* @hide
*/
- @TestApi
@SystemApi
public boolean isIpv4Provisioned() {
return (hasIpv4Address()
@@ -1280,7 +1260,6 @@
* @return {@code true} if the link is provisioned, {@code false} otherwise.
* @hide
*/
- @TestApi
@SystemApi
public boolean isIpv6Provisioned() {
return (hasGlobalIpv6Address()
@@ -1308,7 +1287,6 @@
* @return {@code true} if the link is provisioned, {@code false} otherwise.
* @hide
*/
- @TestApi
@SystemApi
public boolean isProvisioned() {
return (isIpv4Provisioned() || isIpv6Provisioned());
@@ -1321,7 +1299,6 @@
* {@code false} otherwise.
* @hide
*/
- @TestApi
@SystemApi
public boolean isReachable(@NonNull InetAddress ip) {
final List<RouteInfo> allRoutes = getAllRoutes();
@@ -1578,7 +1555,6 @@
* @hide
*/
@SystemApi
- @TestApi
public void setCaptivePortalApiUrl(@Nullable Uri url) {
mCaptivePortalApiUrl = url;
}
@@ -1593,7 +1569,6 @@
* @hide
*/
@SystemApi
- @TestApi
@Nullable
public Uri getCaptivePortalApiUrl() {
return mCaptivePortalApiUrl;
@@ -1604,7 +1579,6 @@
* @hide
*/
@SystemApi
- @TestApi
public void setCaptivePortalData(@Nullable CaptivePortalData data) {
mCaptivePortalData = data;
}
@@ -1618,7 +1592,6 @@
* @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 b872617..2561938 100644
--- a/core/java/android/net/Network.java
+++ b/core/java/android/net/Network.java
@@ -18,7 +18,6 @@
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 @@
* @hide
*/
@SystemApi
- @TestApi
public Network(@NonNull Network that) {
this(that.netId, that.mPrivateDnsBypass);
}
@@ -164,7 +162,6 @@
*
* @hide
*/
- @TestApi
@SystemApi
public @NonNull Network getPrivateDnsBypassingCopy() {
return new Network(netId, true);
@@ -175,7 +172,6 @@
*
* @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 004f844..be33f4e 100644
--- a/core/java/android/net/NetworkCapabilities.java
+++ b/core/java/android/net/NetworkCapabilities.java
@@ -850,7 +850,6 @@
* @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 @@
*/
@NonNull
@SystemApi
- @TestApi
public int[] getAdministratorUids() {
return Arrays.copyOf(mAdministratorUids, mAdministratorUids.length);
}
@@ -1506,7 +1504,6 @@
* @hide
*/
@SystemApi
- @TestApi
public @Nullable String getSsid() {
return mSSID;
}
@@ -1590,7 +1587,6 @@
*
* @hide
*/
- @TestApi
@SystemApi
public boolean satisfiedByNetworkCapabilities(@Nullable NetworkCapabilities nc) {
return satisfiedByNetworkCapabilities(nc, false);
@@ -2136,7 +2132,6 @@
* @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 9876076..62aebb0 100644
--- a/core/java/android/net/RouteInfo.java
+++ b/core/java/android/net/RouteInfo.java
@@ -20,7 +20,6 @@
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 @@
/** 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 @@
* @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 @@
*
* @hide
*/
- @TestApi
@SystemApi
@RouteType
public int getType() {
diff --git a/core/java/android/net/StaticIpConfiguration.java b/core/java/android/net/StaticIpConfiguration.java
index a973455..f56d656 100644
--- a/core/java/android/net/StaticIpConfiguration.java
+++ b/core/java/android/net/StaticIpConfiguration.java
@@ -19,7 +19,6 @@
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 @@
* @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 92c5432..bf5b26e 100644
--- a/core/java/android/net/apf/ApfCapabilities.java
+++ b/core/java/android/net/apf/ApfCapabilities.java
@@ -19,7 +19,6 @@
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 @@
* @hide
*/
@SystemApi
-@TestApi
public final class ApfCapabilities implements Parcelable {
/**
* Version of APF instruction set supported for packet filtering. 0 indicates no support for