summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAyush Sharma <ayushsha@google.com>2021-12-16 14:40:13 +0000
committerAyush Sharma <ayushsha@google.com>2021-12-16 14:40:13 +0000
commit6d1ea2bb16451e43b5a2c3da30b49ecfc40037cc (patch)
tree4ad01d9e98d3295f8185eeffed363d8c4ce476e6
parent758ead6dd362f8b7c665603fb9d85038b3f72f27 (diff)
Revert "Unhide RouteInfo#getType and related fields"
Revert "Add APIs that allow to exclude routes from VPN" Revert "Suppress NewApi warnings for @SystemApi -> public APIs" Revert "Add VpnServiceBuilderShim for VpnService.Builder" Revert submission 1551943-vpn-impl Reason for revert: <DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=mainline_modules_x86_64-userdebug&lkgb=8007224&lkbb=8008168&fkbb=8007902 >, bug b/210979001 Reverted Changes: I0e7aa077a:Add VpnServiceBuilderShim for VpnService.Builder Ib12f5ab39:Suppress NewApi warnings for @SystemApi -> public ... I59b9185cf:Unhide RouteInfo#getType and related fields Ie5b62b2b2:Unhide IpPrefix(InetAddress, int) I993a32d40:Add CTS tests for exclude VPN routes APIs Ib24b2d3fb:Suppress NewApi warnings for @SystemApi -> public ... Ic3b10464a:Add APIs that allow to exclude routes from VPN Change-Id: I98d3b998e4702f56e9d5e17944238b283b29f2b2 BUG: 210979001
-rw-r--r--framework/api/current.txt4
-rw-r--r--framework/api/system-current.txt4
-rw-r--r--framework/src/android/net/RouteInfo.java25
-rw-r--r--tests/common/java/android/net/RouteInfoTest.java12
4 files changed, 13 insertions, 32 deletions
diff --git a/framework/api/current.txt b/framework/api/current.txt
index c53f29a5ef..9a77a3ced5 100644
--- a/framework/api/current.txt
+++ b/framework/api/current.txt
@@ -439,15 +439,11 @@ package android.net {
method @NonNull public android.net.IpPrefix getDestination();
method @Nullable public java.net.InetAddress getGateway();
method @Nullable public String getInterface();
- method public int getType();
method public boolean hasGateway();
method public boolean isDefaultRoute();
method public boolean matches(java.net.InetAddress);
method public void writeToParcel(android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.net.RouteInfo> CREATOR;
- field public static final int RTN_THROW = 9; // 0x9
- field public static final int RTN_UNICAST = 1; // 0x1
- field public static final int RTN_UNREACHABLE = 7; // 0x7
}
public abstract class SocketKeepalive implements java.lang.AutoCloseable {
diff --git a/framework/api/system-current.txt b/framework/api/system-current.txt
index 7db8725582..cfab8724fd 100644
--- a/framework/api/system-current.txt
+++ b/framework/api/system-current.txt
@@ -432,6 +432,10 @@ package android.net {
ctor public RouteInfo(@Nullable android.net.IpPrefix, @Nullable java.net.InetAddress, @Nullable String, int);
ctor public RouteInfo(@Nullable android.net.IpPrefix, @Nullable java.net.InetAddress, @Nullable String, int, int);
method public int getMtu();
+ method public int getType();
+ field public static final int RTN_THROW = 9; // 0x9
+ field public static final int RTN_UNICAST = 1; // 0x1
+ field public static final int RTN_UNREACHABLE = 7; // 0x7
}
public abstract class SocketKeepalive implements java.lang.AutoCloseable {
diff --git a/framework/src/android/net/RouteInfo.java b/framework/src/android/net/RouteInfo.java
index df5f151a3f..fad3144a4b 100644
--- a/framework/src/android/net/RouteInfo.java
+++ b/framework/src/android/net/RouteInfo.java
@@ -86,26 +86,16 @@ public final class RouteInfo implements Parcelable {
private final String mInterface;
- /**
- * Unicast route.
- *
- * Indicates that destination is reachable directly or via gateway.
- **/
+ /** Unicast route. @hide */
+ @SystemApi
public static final int RTN_UNICAST = 1;
- /**
- * Unreachable route.
- *
- * Indicates that destination is unreachable.
- **/
+ /** Unreachable route. @hide */
+ @SystemApi
public static final int RTN_UNREACHABLE = 7;
- /**
- * Throw route.
- *
- * Indicates that routing information about this destination is not in this table.
- * Routing lookup should continue in another table.
- **/
+ /** Throw route. @hide */
+ @SystemApi
public static final int RTN_THROW = 9;
/**
@@ -401,7 +391,10 @@ public final class RouteInfo implements Parcelable {
* Retrieves the type of this route.
*
* @return The type of this route; one of the {@code RTN_xxx} constants defined in this class.
+ *
+ * @hide
*/
+ @SystemApi
@RouteType
public int getType() {
return mType;
diff --git a/tests/common/java/android/net/RouteInfoTest.java b/tests/common/java/android/net/RouteInfoTest.java
index b69b04561b..71689f9197 100644
--- a/tests/common/java/android/net/RouteInfoTest.java
+++ b/tests/common/java/android/net/RouteInfoTest.java
@@ -16,8 +16,6 @@
package android.net;
-import static android.net.RouteInfo.RTN_THROW;
-import static android.net.RouteInfo.RTN_UNICAST;
import static android.net.RouteInfo.RTN_UNREACHABLE;
import static com.android.testutils.MiscAsserts.assertEqualBothWays;
@@ -331,16 +329,6 @@ public class RouteInfoTest {
}
@Test
- public void testRouteTypes() {
- RouteInfo r = new RouteInfo(new IpPrefix(Inet6Address.ANY, 0), RTN_UNREACHABLE);
- assertEquals(RTN_UNREACHABLE, r.getType());
- r = new RouteInfo(new IpPrefix(Inet6Address.ANY, 0), RTN_UNICAST);
- assertEquals(RTN_UNICAST, r.getType());
- r = new RouteInfo(new IpPrefix(Inet6Address.ANY, 0), RTN_THROW);
- assertEquals(RTN_THROW, r.getType());
- }
-
- @Test
public void testTruncation() {
LinkAddress l;
RouteInfo r;