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: I5b918dbf4293168c2a02cfe1c0f6ca8342b3195c
BUG: 210979001
diff --git a/staticlibs/device/com/android/net/module/util/netlink/RtNetlinkRouteMessage.java b/staticlibs/device/com/android/net/module/util/netlink/RtNetlinkRouteMessage.java
index 1705f1c..c5efcb2 100644
--- a/staticlibs/device/com/android/net/module/util/netlink/RtNetlinkRouteMessage.java
+++ b/staticlibs/device/com/android/net/module/util/netlink/RtNetlinkRouteMessage.java
@@ -22,7 +22,6 @@
import static com.android.net.module.util.NetworkStackConstants.IPV4_ADDR_ANY;
import static com.android.net.module.util.NetworkStackConstants.IPV6_ADDR_ANY;
-import android.annotation.SuppressLint;
import android.net.IpPrefix;
import android.system.OsConstants;
@@ -108,7 +107,6 @@
* @param header netlink message header.
* @param byteBuffer the ByteBuffer instance that wraps the raw netlink message bytes.
*/
- @SuppressLint("NewApi")
@Nullable
public static RtNetlinkRouteMessage parse(@NonNull final StructNlMsgHdr header,
@NonNull final ByteBuffer byteBuffer) {
diff --git a/staticlibs/device/com/android/net/module/util/netlink/StructNdOptPref64.java b/staticlibs/device/com/android/net/module/util/netlink/StructNdOptPref64.java
index 8226346..f6b2e0e 100644
--- a/staticlibs/device/com/android/net/module/util/netlink/StructNdOptPref64.java
+++ b/staticlibs/device/com/android/net/module/util/netlink/StructNdOptPref64.java
@@ -16,7 +16,6 @@
package com.android.net.module.util.netlink;
-import android.annotation.SuppressLint;
import android.net.IpPrefix;
import android.util.Log;
@@ -108,7 +107,6 @@
this.lifetime = lifetime & 0xfff8;
}
- @SuppressLint("NewApi")
private StructNdOptPref64(@NonNull ByteBuffer buf) {
super(buf.get(), Byte.toUnsignedInt(buf.get()));
if (type != TYPE) throw new IllegalArgumentException("Invalid type " + type);
diff --git a/staticlibs/tests/unit/src/com/android/net/module/util/IpRangeTest.java b/staticlibs/tests/unit/src/com/android/net/module/util/IpRangeTest.java
index 20bbd4a..f44b17d 100644
--- a/staticlibs/tests/unit/src/com/android/net/module/util/IpRangeTest.java
+++ b/staticlibs/tests/unit/src/com/android/net/module/util/IpRangeTest.java
@@ -22,7 +22,6 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import android.annotation.SuppressLint;
import android.net.InetAddresses;
import android.net.IpPrefix;
@@ -93,7 +92,6 @@
}
}
- @SuppressLint("NewApi")
@Test
public void testConstructor() {
IpRange r = new IpRange(new IpPrefix(IPV4_ADDR, 32));
@@ -121,7 +119,6 @@
assertEquals(IPV6_RANGE_END, r.getEndAddr());
}
- @SuppressLint("NewApi")
@Test
public void testContainsRangeEqualRanges() {
final IpRange r1 = new IpRange(new IpPrefix(IPV6_ADDR, 35));
@@ -132,7 +129,6 @@
assertEquals(r1, r2);
}
- @SuppressLint("NewApi")
@Test
public void testContainsRangeSubset() {
final IpRange r1 = new IpRange(new IpPrefix(IPV6_ADDR, 64));
@@ -143,7 +139,6 @@
assertNotEquals(r1, r2);
}
- @SuppressLint("NewApi")
@Test
public void testContainsRangeTruncatesLowerOrderBits() {
final IpRange r1 = new IpRange(new IpPrefix(IPV6_ADDR, 100));
@@ -154,7 +149,6 @@
assertEquals(r1, r2);
}
- @SuppressLint("NewApi")
@Test
public void testContainsRangeSubsetSameStartAddr() {
final IpRange r1 = new IpRange(new IpPrefix(IPV6_ADDR, 35));
@@ -165,7 +159,6 @@
assertNotEquals(r1, r2);
}
- @SuppressLint("NewApi")
@Test
public void testContainsRangeOverlapping() {
final IpRange r1 = new IpRange(new IpPrefix(address("2001:db9::"), 32));
@@ -176,7 +169,6 @@
assertNotEquals(r1, r2);
}
- @SuppressLint("NewApi")
@Test
public void testOverlapsRangeEqualRanges() {
final IpRange r1 = new IpRange(new IpPrefix(IPV6_ADDR, 35));
@@ -187,7 +179,6 @@
assertEquals(r1, r2);
}
- @SuppressLint("NewApi")
@Test
public void testOverlapsRangeSubset() {
final IpRange r1 = new IpRange(new IpPrefix(IPV6_ADDR, 35));
@@ -198,7 +189,6 @@
assertNotEquals(r1, r2);
}
- @SuppressLint("NewApi")
@Test
public void testOverlapsRangeDisjoint() {
final IpRange r1 = new IpRange(new IpPrefix(IPV6_ADDR, 32));
@@ -209,7 +199,6 @@
assertNotEquals(r1, r2);
}
- @SuppressLint("NewApi")
@Test
public void testOverlapsRangePartialOverlapLow() {
final IpRange r1 = new IpRange(new IpPrefix(address("2001:db9::"), 32));
@@ -220,7 +209,6 @@
assertNotEquals(r1, r2);
}
- @SuppressLint("NewApi")
@Test
public void testOverlapsRangePartialOverlapHigh() {
final IpRange r1 = new IpRange(new IpPrefix(address("2001:db7::"), 32));
diff --git a/staticlibs/tests/unit/src/com/android/net/module/util/LinkPropertiesUtilsTest.java b/staticlibs/tests/unit/src/com/android/net/module/util/LinkPropertiesUtilsTest.java
index 09f0490..3d2d6eb 100644
--- a/staticlibs/tests/unit/src/com/android/net/module/util/LinkPropertiesUtilsTest.java
+++ b/staticlibs/tests/unit/src/com/android/net/module/util/LinkPropertiesUtilsTest.java
@@ -22,7 +22,6 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import android.annotation.SuppressLint;
import android.net.InetAddresses;
import android.net.IpPrefix;
import android.net.LinkAddress;
@@ -47,7 +46,6 @@
@RunWith(AndroidJUnit4.class)
public final class LinkPropertiesUtilsTest {
- @SuppressLint("NewApi")
private static final IpPrefix PREFIX = new IpPrefix(toInetAddress("75.208.6.0"), 24);
private static final InetAddress V4_ADDR = toInetAddress("75.208.6.1");
private static final InetAddress V6_ADDR = toInetAddress(
diff --git a/staticlibs/tests/unit/src/com/android/net/module/util/StructTest.java b/staticlibs/tests/unit/src/com/android/net/module/util/StructTest.java
index 4e46210..eabc14b 100644
--- a/staticlibs/tests/unit/src/com/android/net/module/util/StructTest.java
+++ b/staticlibs/tests/unit/src/com/android/net/module/util/StructTest.java
@@ -24,7 +24,6 @@
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
-import android.annotation.SuppressLint;
import android.net.InetAddresses;
import android.net.IpPrefix;
import android.net.MacAddress;
@@ -454,7 +453,6 @@
}
}
- @SuppressLint("NewApi")
private void verifyPrefixByteArrayParsing(final PrefixMessage msg) throws Exception {
// The original PREF64 option message has just 12 bytes for prefix byte array
// (Highest 96 bits of the Prefix), copyOf pads the 128-bits IPv6 address with
diff --git a/staticlibs/tests/unit/src/com/android/net/module/util/netlink/StructNdOptPref64Test.java b/staticlibs/tests/unit/src/com/android/net/module/util/netlink/StructNdOptPref64Test.java
index beed838..57248ea 100644
--- a/staticlibs/tests/unit/src/com/android/net/module/util/netlink/StructNdOptPref64Test.java
+++ b/staticlibs/tests/unit/src/com/android/net/module/util/netlink/StructNdOptPref64Test.java
@@ -24,7 +24,6 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import android.annotation.SuppressLint;
import android.net.IpPrefix;
import androidx.test.filters.SmallTest;
@@ -52,7 +51,6 @@
return prefixBytes;
}
- @SuppressLint("NewApi")
private static IpPrefix prefix(String addrString, int prefixLength) throws Exception {
return new IpPrefix(InetAddress.getByName(addrString), prefixLength);
}