Snap for 8730993 from 47ee8bb1fbe268e7e6fd1b1cc9a786049fa56efd to mainline-tzdata3-release

Change-Id: I09ecaa8ab337524f3cd6a5045008a302b360010e
diff --git a/Android.bp b/Android.bp
index 4b3d558..ef43047 100644
--- a/Android.bp
+++ b/Android.bp
@@ -45,10 +45,6 @@
     default_applicable_licenses: ["Android-Apache-2.0"],
 }
 
-// In some branches, this may be module_current instead of module_33 if the SDK prebuilts are not
-// yet dropped there, meaning module_33 cannot be used yet.
-module_33_version = "module_33"
-
 // TODO: remove this default and replace with ConnectivityNextEnableDefaults. This will need to be
 // done separately in each branch due to merge conflicts.
 // Defaults to enable/disable java targets that depend on
@@ -56,7 +52,7 @@
 // have a different value depending on the branch.
 java_defaults {
     name: "NetworkStackNextEnableDefaults",
-    enabled: true,
+    enabled: false,
 }
 // This is a placeholder comment to avoid merge conflicts
 // as the above target may have different "enabled" values
@@ -76,12 +72,11 @@
 
 java_defaults {
     name: "NetworkStackReleaseApiLevel",
-    sdk_version: module_33_version,
+    sdk_version: "module_31",
     min_sdk_version: "29",
-    target_sdk_version: "33",
+    target_sdk_version: "31",
     libs: [
         "framework-connectivity",
-        "framework-connectivity-t",
         "framework-statsd",
         "framework-wifi",
     ]
@@ -147,6 +142,9 @@
     },
 }
 
+// Shims for APIs being added to the current development version of Android. These APIs are not
+// stable and have no defined version number. These could be called 10000, but they use the next
+// integer so if the next SDK release happens to use that integer, we don't need to rename them.
 java_library {
     name: "NetworkStackApi31Shims",
     defaults: ["NetworkStackShimsDefaults"],
@@ -163,6 +161,10 @@
     visibility: ["//visibility:private"],
 }
 
+
+// Shims for APIs being added to the current development version of Android. These APIs are not
+// stable and have no defined version number. These could be called 10000, but they use the next
+// integer so if the next SDK release happens to use that integer, we don't need to rename them.
 java_library {
     name: "NetworkStackApi33Shims",
     defaults: ["NetworkStackShimsDefaults", "ConnectivityNextEnableDefaults"],
@@ -181,33 +183,7 @@
         "framework-connectivity",
         "framework-connectivity-t.stubs.module_lib",
         "framework-tethering",
-    ],
-    sdk_version: module_33_version,
-    visibility: ["//visibility:private"],
-}
-
-// Shims for APIs being added to the current development version of Android. These APIs are not
-// stable and have no defined version number. These could be called 10000, but they use the next
-// integer so if the next SDK release happens to use that integer, we don't need to rename them.
-java_library {
-    name: "NetworkStackApi34Shims",
-    defaults: ["NetworkStackShimsDefaults", "ConnectivityNextEnableDefaults"],
-    srcs: [
-        "apishim/34/**/*.java",
-    ],
-    static_libs: [
-        "net-utils-framework-common",
-    ],
-    libs: [
-        "NetworkStackShimsCommon",
-        "NetworkStackApi29Shims",
-        "NetworkStackApi30Shims",
-        "NetworkStackApi31Shims",
-        "NetworkStackApi33Shims",
-        "framework-bluetooth",
-        "framework-connectivity",
-        "framework-connectivity-t.stubs.module_lib",
-        "framework-tethering",
+        "android.net.ipsec.ike.stubs.module_lib",
     ],
     sdk_version: "module_current",
     visibility: ["//visibility:private"],
@@ -218,19 +194,15 @@
 // called directly by the networkstack code.
 java_library {
     name: "NetworkStackApiCurrentShims",
-    defaults: [
-        "NetworkStackShimsDefaults",
-        "NetworkStackDevApiLevel",
-        "ConnectivityNextEnableDefaults",
-    ],
+    defaults: ["NetworkStackShimsDefaults", "ConnectivityNextEnableDefaults"],
     static_libs: [
         "NetworkStackShimsCommon",
         "NetworkStackApi29Shims",
         "NetworkStackApi30Shims",
         "NetworkStackApi31Shims",
         "NetworkStackApi33Shims",
-        "NetworkStackApi34Shims",
     ],
+    sdk_version: "module_current",
     visibility: [
         "//packages/modules/Connectivity/Tethering",
         "//packages/modules/Connectivity/service",
@@ -245,15 +217,15 @@
 // the networkstack code.
 java_library {
     name: "NetworkStackApiStableShims",
-    defaults: ["NetworkStackShimsDefaults", "NetworkStackReleaseApiLevel"],
+    defaults: ["NetworkStackShimsDefaults"],
     static_libs: [
         "NetworkStackShimsCommon",
         "NetworkStackApi29Shims",
         "NetworkStackApi30Shims",
         "NetworkStackApi31Shims",
-        "NetworkStackApi33Shims",
     ],
     jarjar_rules: "apishim/jarjar-rules-compat.txt",
+    sdk_version: "module_31",
     visibility: [
         "//packages/modules/Connectivity/Tethering",
         "//packages/modules/Connectivity/service",
@@ -375,9 +347,11 @@
     manifest: "AndroidManifest_InProcess.xml",
     // InProcessNetworkStack is a replacement for NetworkStack
     overrides: ["NetworkStack", "NetworkStackNext"],
+    // The permission configuration *must* be included to ensure security of the device
     // The InProcessNetworkStack goes together with the PlatformCaptivePortalLogin, which replaces
     // the default CaptivePortalLogin.
     required: [
+        "PlatformNetworkPermissionConfig",
         "PlatformCaptivePortalLogin",
     ],
 }
@@ -405,7 +379,9 @@
     static_libs: ["NetworkStackNextManifestBase"],
     certificate: "networkstack",
     manifest: "AndroidManifest_Next.xml",
+    // The permission configuration *must* be included to ensure security of the device
     required: [
+        "NetworkPermissionConfig",
         "privapp_whitelist_com.android.networkstack",
     ],
     lint: { strict_updatability_linting: true },
@@ -418,7 +394,9 @@
     static_libs: ["NetworkStackApiStableLib"],
     certificate: "networkstack",
     manifest: "AndroidManifest.xml",
+    // The permission configuration *must* be included to ensure security of the device
     required: [
+        "NetworkPermissionConfig",
         "privapp_whitelist_com.android.networkstack",
     ],
     updatable: true,
@@ -497,7 +475,9 @@
     static_libs: ["NetworkStackApiStableLib"],
     certificate: "networkstack",
     manifest: ":NetworkStackTestAndroidManifest",
+    // The permission configuration *must* be included to ensure security of the device
     required: [
+        "NetworkPermissionConfig",
         "privapp_whitelist_com.android.networkstack",
     ],
 }
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index d616750..8750795 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -19,13 +19,10 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="com.android.networkstack"
   android:sharedUserId="android.uid.networkstack"
-  android:versionCode="339990000"
-  android:versionName="339990000"
+  android:versionCode="319999900"
+  android:versionName="s_aml_319999900"
   coreApp="true"
 >
-    <!--- Defines the MAINLINE_NETWORK_STACK permission used by the networkstack process. -->
-    <permission android:name="android.permission.MAINLINE_NETWORK_STACK"
-                android:protectionLevel="signature"/>
     <!-- Permissions must be defined here, and not in the base manifest, as the network stack
          running in the system server process does not need any permission, and having privileged
          permissions added would cause crashes on startup unless they are also added to the
diff --git a/AndroidManifest_InProcess.xml b/AndroidManifest_InProcess.xml
index 7934826..6c64d87 100644
--- a/AndroidManifest_InProcess.xml
+++ b/AndroidManifest_InProcess.xml
@@ -21,9 +21,6 @@
           android:sharedUserId="android.uid.system"
           android:process="system"
           coreApp="true">
-    <!--- Defines the MAINLINE_NETWORK_STACK permission used by the networkstack process. -->
-    <permission android:name="android.permission.MAINLINE_NETWORK_STACK"
-                android:protectionLevel="signature"/>
     <application>
         <service android:name="com.android.server.NetworkStackService"
                  android:process="system"
diff --git a/AndroidManifest_Next.xml b/AndroidManifest_Next.xml
index 200a921..244d465 100644
--- a/AndroidManifest_Next.xml
+++ b/AndroidManifest_Next.xml
@@ -17,7 +17,7 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
           package="com.android.networkstack"
           android:sharedUserId="android.uid.networkstack"
-          android:versionCode="339990000"
+          android:versionCode="320000000"
           android:versionName="T-next"
           coreApp="true">
 </manifest>
diff --git a/apishim/29/com/android/networkstack/apishim/api29/ConstantsShim.java b/apishim/29/com/android/networkstack/apishim/api29/ConstantsShim.java
index 0dcd0db..7159cea 100644
--- a/apishim/29/com/android/networkstack/apishim/api29/ConstantsShim.java
+++ b/apishim/29/com/android/networkstack/apishim/api29/ConstantsShim.java
@@ -40,8 +40,6 @@
     public static final int VPN_PROFILE_STATE_CONNECTING = 1;
     public static final int VPN_PROFILE_STATE_CONNECTED = 2;
 
-    public static final String ACTION_VPN_MANAGER_EVENT = "android.net.action.VPN_MANAGER_EVENT";
-
     // Constants defined in android.net.ConnectivityDiagnosticsManager.
     public static final int DETECTION_METHOD_DNS_EVENTS = 1;
     public static final int DETECTION_METHOD_TCP_METRICS = 2;
diff --git a/apishim/29/com/android/networkstack/apishim/api29/EthernetManagerShimImpl.java b/apishim/29/com/android/networkstack/apishim/api29/EthernetManagerShimImpl.java
new file mode 100644
index 0000000..2f5fb7d
--- /dev/null
+++ b/apishim/29/com/android/networkstack/apishim/api29/EthernetManagerShimImpl.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.networkstack.apishim.api29;
+
+import android.content.Context;
+import android.os.Build;
+
+import androidx.annotation.RequiresApi;
+
+import com.android.networkstack.apishim.common.EthernetManagerShim;
+
+/**
+ * Implementation of {@link EthernetManagerShim} for API 29.
+ *
+ * Cannot actually import EthernetManager because that only became @SystemApi in API 30.
+ */
+@RequiresApi(Build.VERSION_CODES.Q)
+public class EthernetManagerShimImpl implements EthernetManagerShim {
+    /**
+     * Get a new instance of {@link EthernetManagerShim}.
+     */
+    public static EthernetManagerShim newInstance(Context context) {
+        return new EthernetManagerShimImpl();
+    }
+}
diff --git a/apishim/29/com/android/networkstack/apishim/api29/Ikev2VpnProfileBuilderShimImpl.java b/apishim/29/com/android/networkstack/apishim/api29/Ikev2VpnProfileBuilderShimImpl.java
new file mode 100644
index 0000000..ecf3f15
--- /dev/null
+++ b/apishim/29/com/android/networkstack/apishim/api29/Ikev2VpnProfileBuilderShimImpl.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.networkstack.apishim.api29;
+
+import android.os.Build;
+
+import androidx.annotation.RequiresApi;
+
+import com.android.networkstack.apishim.common.Ikev2VpnProfileBuilderShim;
+
+/**
+ * Implementation of Ikev2VpnProfileBuilderShim for API 29.
+  *
+ * @param <T> type of builder, typically Ikev2VpnProfile.Builder. This is necessary because at
+ *            compile time, shims for older releases will not have access to this class as it
+ *            debuted in SDK30. So the user of the shim has to pass it in.
+ */
+// NOTE : the trick with the formal parameter only works because when this shim was introduced,
+// the stable API already contained the class that the caller needs to pass in; this won't
+// work for a class added in the latest API level.
+@RequiresApi(Build.VERSION_CODES.Q)
+public class Ikev2VpnProfileBuilderShimImpl<T> implements Ikev2VpnProfileBuilderShim<T> {
+}
diff --git a/apishim/29/com/android/networkstack/apishim/api29/Ikev2VpnProfileShimImpl.java b/apishim/29/com/android/networkstack/apishim/api29/Ikev2VpnProfileShimImpl.java
new file mode 100644
index 0000000..0f8dae5
--- /dev/null
+++ b/apishim/29/com/android/networkstack/apishim/api29/Ikev2VpnProfileShimImpl.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.networkstack.apishim.api29;
+
+import com.android.networkstack.apishim.common.Ikev2VpnProfileShim;
+
+/**
+ * Implementation of Ikev2VpnProfileShim for API 29.
+ * @param <T> type of profile, typically Ikev2VpnProfile
+ */
+public class Ikev2VpnProfileShimImpl<T> implements Ikev2VpnProfileShim<T> {
+}
diff --git a/apishim/30/com/android/networkstack/apishim/api30/Ikev2VpnProfileBuilderShimImpl.java b/apishim/30/com/android/networkstack/apishim/api30/Ikev2VpnProfileBuilderShimImpl.java
new file mode 100644
index 0000000..7c126a3
--- /dev/null
+++ b/apishim/30/com/android/networkstack/apishim/api30/Ikev2VpnProfileBuilderShimImpl.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.networkstack.apishim.api30;
+
+import android.net.Ikev2VpnProfile;
+import android.net.ProxyInfo;
+import android.os.Build;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
+
+import com.android.networkstack.apishim.common.Ikev2VpnProfileBuilderShim;
+import com.android.networkstack.apishim.common.Ikev2VpnProfileShim;
+import com.android.networkstack.apishim.common.UnsupportedApiLevelException;
+
+import java.security.PrivateKey;
+import java.security.cert.X509Certificate;
+import java.util.List;
+
+/**
+ * Implementation of Ikev2VpnProfileBuilderShim for API 30.
+ */
+// TODO : when API29 is no longer supported, remove the type argument
+@RequiresApi(Build.VERSION_CODES.R)
+public class Ikev2VpnProfileBuilderShimImpl
+        extends com.android.networkstack.apishim.api29.Ikev2VpnProfileBuilderShimImpl<
+                Ikev2VpnProfile.Builder> {
+    protected Ikev2VpnProfile.Builder mBuilder;
+
+    protected Ikev2VpnProfileBuilderShimImpl(@Nullable String serverAddr,
+            @Nullable String identity, @Nullable Object params) {
+        if (serverAddr != null && identity != null) {
+            mBuilder = new Ikev2VpnProfile.Builder(serverAddr, identity);
+        }
+    }
+    /**
+     * Returns a new instance of this shim impl.
+     */
+    public static Ikev2VpnProfileBuilderShim<Ikev2VpnProfile.Builder> newInstance(
+            @Nullable String serverAddr, @Nullable String identity, @Nullable Object params) {
+        return new Ikev2VpnProfileBuilderShimImpl(serverAddr, identity, params);
+    }
+
+    @Override
+    public Ikev2VpnProfileBuilderShim<Ikev2VpnProfile.Builder> setAuthPsk(@NonNull byte[] psk) {
+        mBuilder.setAuthPsk(psk);
+        return this;
+    }
+
+    @Override
+    public Ikev2VpnProfileBuilderShim<Ikev2VpnProfile.Builder> setAuthUsernamePassword(
+            @NonNull String user, @NonNull String pass, @Nullable X509Certificate serverRootCa)
+            throws UnsupportedApiLevelException {
+        mBuilder.setAuthUsernamePassword(user, pass, serverRootCa);
+        return this;
+    }
+
+    @Override
+    public Ikev2VpnProfileBuilderShim<Ikev2VpnProfile.Builder> setAuthDigitalSignature(
+            @NonNull X509Certificate userCert, @NonNull PrivateKey key,
+            @Nullable X509Certificate serverRootCa) {
+        mBuilder.setAuthDigitalSignature(userCert, key, serverRootCa);
+        return this;
+    }
+
+    @Override
+    public Ikev2VpnProfileBuilderShim<Ikev2VpnProfile.Builder> setBypassable(boolean isBypassable) {
+        mBuilder.setBypassable(true);
+        return this;
+    }
+
+    @Override
+    public Ikev2VpnProfileBuilderShim<Ikev2VpnProfile.Builder> setProxy(@Nullable ProxyInfo proxy) {
+        mBuilder.setProxy(proxy);
+        return this;
+    }
+
+    @Override
+    public Ikev2VpnProfileBuilderShim<Ikev2VpnProfile.Builder> setMaxMtu(int mtu) {
+        mBuilder.setMaxMtu(mtu);
+        return this;
+    }
+
+    @Override
+    public Ikev2VpnProfileBuilderShim<Ikev2VpnProfile.Builder> setMetered(boolean isMetered) {
+        mBuilder.setMetered(isMetered);
+        return this;
+    }
+
+    @Override
+    public Ikev2VpnProfileBuilderShim<Ikev2VpnProfile.Builder> setAllowedAlgorithms(
+            @NonNull List<String> algorithmNames) {
+        mBuilder.setAllowedAlgorithms(algorithmNames);
+        return this;
+    }
+
+    @Override
+    public Ikev2VpnProfile.Builder getBuilder() {
+        return mBuilder;
+    }
+
+    @Override
+    public Ikev2VpnProfileShim build() {
+        return new Ikev2VpnProfileShimImpl(mBuilder.build());
+    }
+}
diff --git a/apishim/30/com/android/networkstack/apishim/api30/Ikev2VpnProfileShimImpl.java b/apishim/30/com/android/networkstack/apishim/api30/Ikev2VpnProfileShimImpl.java
new file mode 100644
index 0000000..71d68ab
--- /dev/null
+++ b/apishim/30/com/android/networkstack/apishim/api30/Ikev2VpnProfileShimImpl.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.networkstack.apishim.api30;
+
+import android.net.Ikev2VpnProfile;
+
+/**
+ * Implementation of Ikev2VpnProfileShim for API 30.
+ */
+// TODO : when API29 is no longer supported, remove the type argument
+public class Ikev2VpnProfileShimImpl extends
+        com.android.networkstack.apishim.api29.Ikev2VpnProfileShimImpl<Ikev2VpnProfile> {
+    protected Ikev2VpnProfile mProfile;
+
+    public Ikev2VpnProfileShimImpl(Ikev2VpnProfile profile) {
+        mProfile = profile;
+    }
+
+    public Ikev2VpnProfile getProfile() {
+        return mProfile;
+    }
+}
diff --git a/apishim/31/com/android/networkstack/apishim/api31/EthernetManagerShimImpl.java b/apishim/31/com/android/networkstack/apishim/api31/EthernetManagerShimImpl.java
new file mode 100644
index 0000000..2c93d7c
--- /dev/null
+++ b/apishim/31/com/android/networkstack/apishim/api31/EthernetManagerShimImpl.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.networkstack.apishim.api31;
+
+import static com.android.modules.utils.build.SdkLevel.isAtLeastS;
+
+import android.content.Context;
+import android.os.Build;
+
+import androidx.annotation.RequiresApi;
+
+import com.android.networkstack.apishim.common.EthernetManagerShim;
+
+/**
+ * Implementation of {@link EthernetManagerShim} for API 31.
+ *
+ * Doesn't have any methods, but must exist because the stable shim API level is currently 31.
+ * TODO: delete when the stable shim API level becomes 33.
+ */
+@RequiresApi(Build.VERSION_CODES.S)
+public class EthernetManagerShimImpl
+        extends com.android.networkstack.apishim.api29.EthernetManagerShimImpl {
+    /**
+     * Get a new instance of {@link EthernetManagerShim}.
+     */
+    @RequiresApi(Build.VERSION_CODES.Q)
+    public static EthernetManagerShim newInstance(Context context) {
+        if (!isAtLeastS()) {
+            return com.android.networkstack.apishim.api29.EthernetManagerShimImpl
+                    .newInstance(context);
+        }
+        return new EthernetManagerShimImpl();
+    }
+}
diff --git a/apishim/31/com/android/networkstack/apishim/api31/Ikev2VpnProfileBuilderShimImpl.java b/apishim/31/com/android/networkstack/apishim/api31/Ikev2VpnProfileBuilderShimImpl.java
new file mode 100644
index 0000000..de60ff3
--- /dev/null
+++ b/apishim/31/com/android/networkstack/apishim/api31/Ikev2VpnProfileBuilderShimImpl.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.networkstack.apishim.api31;
+
+import android.os.Build;
+
+import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
+
+/**
+ * Implementation of Ikev2VpnProfileBuilderShim for API 31.
+ */
+@RequiresApi(Build.VERSION_CODES.S)
+public class Ikev2VpnProfileBuilderShimImpl
+        extends com.android.networkstack.apishim.api30.Ikev2VpnProfileBuilderShimImpl {
+    protected Ikev2VpnProfileBuilderShimImpl(@Nullable String serverAddr,
+            @Nullable String identity, @Nullable Object params) {
+        super(serverAddr, identity, params);
+    }
+}
diff --git a/apishim/31/com/android/networkstack/apishim/api31/Ikev2VpnProfileShimImpl.java b/apishim/31/com/android/networkstack/apishim/api31/Ikev2VpnProfileShimImpl.java
new file mode 100644
index 0000000..1a9e332
--- /dev/null
+++ b/apishim/31/com/android/networkstack/apishim/api31/Ikev2VpnProfileShimImpl.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.networkstack.apishim.api31;
+
+import android.net.Ikev2VpnProfile;
+
+/**
+ * Implementation of Ikev2VpnProfileShim for API 31.
+ */
+public class Ikev2VpnProfileShimImpl extends
+        com.android.networkstack.apishim.api30.Ikev2VpnProfileShimImpl {
+    public Ikev2VpnProfileShimImpl(Ikev2VpnProfile profile) {
+        super(profile);
+    }
+}
diff --git a/apishim/33/com/android/networkstack/apishim/api33/BluetoothPanShimImpl.java b/apishim/33/com/android/networkstack/apishim/BluetoothPanShimImpl.java
similarity index 97%
rename from apishim/33/com/android/networkstack/apishim/api33/BluetoothPanShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/BluetoothPanShimImpl.java
index 09a3573..990a312 100644
--- a/apishim/33/com/android/networkstack/apishim/api33/BluetoothPanShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/BluetoothPanShimImpl.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.networkstack.apishim.api33;
+package com.android.networkstack.apishim;
 
 import static com.android.modules.utils.build.SdkLevel.isAtLeastT;
 
diff --git a/apishim/33/com/android/networkstack/apishim/api33/CaptivePortalDataShimImpl.java b/apishim/33/com/android/networkstack/apishim/CaptivePortalDataShimImpl.java
similarity index 96%
rename from apishim/33/com/android/networkstack/apishim/api33/CaptivePortalDataShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/CaptivePortalDataShimImpl.java
index 7a4dbba..63fa021 100644
--- a/apishim/33/com/android/networkstack/apishim/api33/CaptivePortalDataShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/CaptivePortalDataShimImpl.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.networkstack.apishim.api33;
+package com.android.networkstack.apishim;
 
 import android.net.CaptivePortalData;
 import android.os.Build;
diff --git a/apishim/33/com/android/networkstack/apishim/api33/ConnectivityFrameworkInitShimImpl.java b/apishim/33/com/android/networkstack/apishim/ConnectivityFrameworkInitShimImpl.java
similarity index 96%
rename from apishim/33/com/android/networkstack/apishim/api33/ConnectivityFrameworkInitShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/ConnectivityFrameworkInitShimImpl.java
index a97e717..2fc4ca1 100644
--- a/apishim/33/com/android/networkstack/apishim/api33/ConnectivityFrameworkInitShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/ConnectivityFrameworkInitShimImpl.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.networkstack.apishim.api33;
+package com.android.networkstack.apishim;
 
 import android.net.ConnectivityFrameworkInitializerTiramisu;
 import android.os.Build;
diff --git a/apishim/33/com/android/networkstack/apishim/api33/ConnectivityManagerShimImpl.java b/apishim/33/com/android/networkstack/apishim/ConnectivityManagerShimImpl.java
similarity index 95%
rename from apishim/33/com/android/networkstack/apishim/api33/ConnectivityManagerShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/ConnectivityManagerShimImpl.java
index 1cb36ae..7675960 100644
--- a/apishim/33/com/android/networkstack/apishim/api33/ConnectivityManagerShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/ConnectivityManagerShimImpl.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.networkstack.apishim.api33;
+package com.android.networkstack.apishim;
 
 import android.content.Context;
 import android.os.Build;
diff --git a/apishim/33/com/android/networkstack/apishim/api33/ConstantsShim.java b/apishim/33/com/android/networkstack/apishim/ConstantsShim.java
similarity index 95%
rename from apishim/33/com/android/networkstack/apishim/api33/ConstantsShim.java
rename to apishim/33/com/android/networkstack/apishim/ConstantsShim.java
index 227b60c..6d146f5 100644
--- a/apishim/33/com/android/networkstack/apishim/api33/ConstantsShim.java
+++ b/apishim/33/com/android/networkstack/apishim/ConstantsShim.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.networkstack.apishim.api33;
+package com.android.networkstack.apishim;
 
 import androidx.annotation.VisibleForTesting;
 
diff --git a/apishim/33/com/android/networkstack/apishim/EthernetManagerShimImpl.java b/apishim/33/com/android/networkstack/apishim/EthernetManagerShimImpl.java
new file mode 100644
index 0000000..82a8f35
--- /dev/null
+++ b/apishim/33/com/android/networkstack/apishim/EthernetManagerShimImpl.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.networkstack.apishim;
+
+import static com.android.modules.utils.build.SdkLevel.isAtLeastT;
+
+import android.content.Context;
+import android.net.EthernetManager;
+import android.os.Build;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.RequiresApi;
+
+import com.android.networkstack.apishim.common.EthernetManagerShim;
+
+import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Executor;
+
+/**
+ * Implementation of {@link EthernetManagerShim} for API 33.
+ */
+@RequiresApi(Build.VERSION_CODES.TIRAMISU)
+public class EthernetManagerShimImpl
+        extends com.android.networkstack.apishim.api31.EthernetManagerShimImpl {
+
+    protected final EthernetManager mEm;
+
+    // This is needed because callers of the shim cannot use EthernetManager.InterfaceStateListener,
+    // they need to use EthernetManagerShim.InterfaceStateListener instead. But when actually
+    // registering a callback, the callback type passed to EthernetManager must be a real
+    // listener, not a shim. This map keeps track of the mapping between the two objects so that
+    // when a caller calls removeInterfaceStateListener with a shim listener, this class knows what
+    // real listener to pass to EthernetManager.
+    private final ConcurrentHashMap<InterfaceStateListener, EthernetManager.InterfaceStateListener>
+            mListeners = new ConcurrentHashMap<>();
+
+    protected EthernetManagerShimImpl(Context context) {
+        mEm = context.getSystemService(EthernetManager.class);
+    }
+
+    /**
+     * Get a new instance of {@link EthernetManagerShim}.
+     */
+    @RequiresApi(Build.VERSION_CODES.Q)
+    public static EthernetManagerShim newInstance(Context context) {
+        if (!isAtLeastT()) {
+            return com.android.networkstack.apishim.api31.EthernetManagerShimImpl
+                    .newInstance(context);
+        }
+        return new EthernetManagerShimImpl(context);
+    }
+
+    @Override
+    public void addInterfaceStateListener(@NonNull Executor executor,
+            @NonNull InterfaceStateListener listener) {
+        final EthernetManager.InterfaceStateListener wrapper = (a, b, c, d) -> {
+            listener.onInterfaceStateChanged(a, b, c, d);
+        };
+        // EthernetManager#addInterfaceStateListener will allow registering the same listener twice,
+        // but this does not seem very useful and is difficult to support with the wrapper scheme
+        // used by this shim. Don't allow it.
+        final EthernetManager.InterfaceStateListener existing =
+                mListeners.putIfAbsent(listener, wrapper);
+        if (existing != null) {
+            throw new IllegalStateException("Attempt to register duplicate listener");
+        }
+        mEm.addInterfaceStateListener(executor, wrapper);
+    }
+
+    @Override
+    public void removeInterfaceStateListener(@NonNull InterfaceStateListener listener) {
+        final EthernetManager.InterfaceStateListener wrapper = mListeners.remove(listener);
+        if (wrapper != null) {
+            mEm.removeInterfaceStateListener(wrapper);
+        }
+    }
+
+    @Override
+    // This method existed in R and S, but as @TestApi, so should not appear in the shims before T
+    // because otherwise it could be used by production code on R and S.
+    public void setIncludeTestInterfaces(boolean include) {
+        mEm.setIncludeTestInterfaces(include);
+    }
+
+    @Override
+    @NonNull
+    public List<String> getInterfaceList() {
+        return mEm.getInterfaceList();
+    }
+}
diff --git a/apishim/33/com/android/networkstack/apishim/Ikev2VpnProfileBuilderShimImpl.java b/apishim/33/com/android/networkstack/apishim/Ikev2VpnProfileBuilderShimImpl.java
new file mode 100644
index 0000000..634b6b5
--- /dev/null
+++ b/apishim/33/com/android/networkstack/apishim/Ikev2VpnProfileBuilderShimImpl.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.networkstack.apishim;
+
+import android.net.Ikev2VpnProfile;
+import android.net.ipsec.ike.IkeTunnelConnectionParams;
+import android.os.Build;
+
+import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
+
+import com.android.modules.utils.build.SdkLevel;
+import com.android.networkstack.apishim.common.Ikev2VpnProfileBuilderShim;
+
+/**
+ * A shim for Ikev2VpnProfile.Builder
+ */
+@RequiresApi(Build.VERSION_CODES.TIRAMISU)
+public class Ikev2VpnProfileBuilderShimImpl
+        extends com.android.networkstack.apishim.api31.Ikev2VpnProfileBuilderShimImpl {
+    private Ikev2VpnProfileBuilderShimImpl(@Nullable String serverAddr,
+            @Nullable String identity, @Nullable Object params) {
+        super(serverAddr, identity, params);
+
+        if (serverAddr == null && identity == null && params == null) {
+            throw new IllegalArgumentException(
+                    "serverAddr, identity and params should not be all null");
+        }
+        // Support building the Builder with an IkeTunnelConnectionParams from API 33.
+        if (params != null) {
+            if (!(params instanceof IkeTunnelConnectionParams)) {
+                throw new IllegalArgumentException("params should be an IkeTunnelConnectionParams");
+            }
+            mBuilder = new Ikev2VpnProfile.Builder((IkeTunnelConnectionParams) params);
+        } else {
+            mBuilder = new Ikev2VpnProfile.Builder(serverAddr, identity);
+        }
+    }
+
+    /**
+     * Returns a new instance of this shim impl.
+     */
+    @RequiresApi(Build.VERSION_CODES.R)
+    public static Ikev2VpnProfileBuilderShim<Ikev2VpnProfile.Builder> newInstance(
+            @Nullable String serverAddr, @Nullable String identity, @Nullable Object params) {
+        if (SdkLevel.isAtLeastT()) {
+            return new Ikev2VpnProfileBuilderShimImpl(serverAddr, identity, params);
+        } else {
+            return com.android.networkstack.apishim.api31.Ikev2VpnProfileBuilderShimImpl
+                    .newInstance(serverAddr, identity, params);
+        }
+    }
+
+    /**
+     * @see Ikev2VpnProfile.Builder#setRequiresInternetValidation(boolean)
+     */
+    @Override
+    public Ikev2VpnProfileBuilderShim<Ikev2VpnProfile.Builder> setRequiresInternetValidation(
+            boolean requiresInternetValidation) {
+        mBuilder.setRequiresInternetValidation(requiresInternetValidation);
+        return this;
+    }
+
+    /**
+     * @see Ikev2VpnProfile.Builder#setLocalRoutesExcluded(boolean)
+     */
+    @Override
+    public Ikev2VpnProfileBuilderShim<Ikev2VpnProfile.Builder> setLocalRoutesExcluded(
+            boolean excludeLocalRoutes) {
+        mBuilder.setLocalRoutesExcluded(excludeLocalRoutes);
+        return this;
+    }
+}
diff --git a/apishim/33/com/android/networkstack/apishim/Ikev2VpnProfileShimImpl.java b/apishim/33/com/android/networkstack/apishim/Ikev2VpnProfileShimImpl.java
new file mode 100644
index 0000000..c3e35d3
--- /dev/null
+++ b/apishim/33/com/android/networkstack/apishim/Ikev2VpnProfileShimImpl.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.networkstack.apishim;
+
+import android.net.Ikev2VpnProfile;
+import android.os.Build;
+
+import androidx.annotation.RequiresApi;
+
+/**
+ * A shim for Ikev2VpnProfile
+ */
+@RequiresApi(Build.VERSION_CODES.TIRAMISU)
+public class Ikev2VpnProfileShimImpl
+        extends com.android.networkstack.apishim.api31.Ikev2VpnProfileShimImpl {
+    public Ikev2VpnProfileShimImpl(Ikev2VpnProfile profile) {
+       super(profile);
+    }
+
+    /**
+     * @see Ikev2VpnProfile#isInternetValidationRequired()
+     */
+    @Override
+    public boolean isInternetValidationRequired() {
+        return mProfile.isInternetValidationRequired();
+    }
+
+    /**
+     * @see Ikev2VpnProfile#getIkeTunnelConnectionParams()
+     */
+    @Override
+    public Object getIkeTunnelConnectionParams() {
+        return mProfile.getIkeTunnelConnectionParams();
+    }
+}
diff --git a/apishim/33/com/android/networkstack/apishim/api33/NetworkAgentConfigShimImpl.java b/apishim/33/com/android/networkstack/apishim/NetworkAgentConfigShimImpl.java
similarity index 97%
rename from apishim/33/com/android/networkstack/apishim/api33/NetworkAgentConfigShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/NetworkAgentConfigShimImpl.java
index ee7f026..912b721 100644
--- a/apishim/33/com/android/networkstack/apishim/api33/NetworkAgentConfigShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/NetworkAgentConfigShimImpl.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.networkstack.apishim.api33;
+package com.android.networkstack.apishim;
 
 import static com.android.modules.utils.build.SdkLevel.isAtLeastT;
 
diff --git a/apishim/33/com/android/networkstack/apishim/api33/NetworkInformationShimImpl.java b/apishim/33/com/android/networkstack/apishim/NetworkInformationShimImpl.java
similarity index 97%
rename from apishim/33/com/android/networkstack/apishim/api33/NetworkInformationShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/NetworkInformationShimImpl.java
index 5d6ada1..46ba098 100644
--- a/apishim/33/com/android/networkstack/apishim/api33/NetworkInformationShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/NetworkInformationShimImpl.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.networkstack.apishim.api33;
+package com.android.networkstack.apishim;
 
 import static com.android.modules.utils.build.SdkLevel.isAtLeastT;
 
diff --git a/apishim/33/com/android/networkstack/apishim/api33/NetworkRequestShimImpl.java b/apishim/33/com/android/networkstack/apishim/NetworkRequestShimImpl.java
similarity index 95%
rename from apishim/33/com/android/networkstack/apishim/api33/NetworkRequestShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/NetworkRequestShimImpl.java
index a73d6a1..72dfef2 100644
--- a/apishim/33/com/android/networkstack/apishim/api33/NetworkRequestShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/NetworkRequestShimImpl.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.networkstack.apishim.api33;
+package com.android.networkstack.apishim;
 
 import android.os.Build;
 
diff --git a/apishim/33/com/android/networkstack/apishim/api33/NetworkShimImpl.java b/apishim/33/com/android/networkstack/apishim/NetworkShimImpl.java
similarity index 95%
rename from apishim/33/com/android/networkstack/apishim/api33/NetworkShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/NetworkShimImpl.java
index d084c01..0968c4c 100644
--- a/apishim/33/com/android/networkstack/apishim/api33/NetworkShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/NetworkShimImpl.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.networkstack.apishim.api33;
+package com.android.networkstack.apishim;
 
 import android.net.Network;
 import android.os.Build;
diff --git a/apishim/33/com/android/networkstack/apishim/api33/NsdShimImpl.java b/apishim/33/com/android/networkstack/apishim/NsdShimImpl.java
similarity index 98%
rename from apishim/33/com/android/networkstack/apishim/api33/NsdShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/NsdShimImpl.java
index 1f0907f..2f13397 100644
--- a/apishim/33/com/android/networkstack/apishim/api33/NsdShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/NsdShimImpl.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.networkstack.apishim.api33;
+package com.android.networkstack.apishim;
 
 import android.net.Network;
 import android.net.NetworkRequest;
diff --git a/apishim/33/com/android/networkstack/apishim/api33/ProcessShimImpl.java b/apishim/33/com/android/networkstack/apishim/ProcessShimImpl.java
similarity index 96%
rename from apishim/33/com/android/networkstack/apishim/api33/ProcessShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/ProcessShimImpl.java
index a6c282e..882dfbf 100644
--- a/apishim/33/com/android/networkstack/apishim/api33/ProcessShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/ProcessShimImpl.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.networkstack.apishim.api33;
+package com.android.networkstack.apishim;
 
 import android.os.Build;
 import android.os.Process;
diff --git a/apishim/33/com/android/networkstack/apishim/api33/SettingsShimImpl.java b/apishim/33/com/android/networkstack/apishim/SettingsShimImpl.java
similarity index 95%
rename from apishim/33/com/android/networkstack/apishim/api33/SettingsShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/SettingsShimImpl.java
index 113b013..cd3a463 100644
--- a/apishim/33/com/android/networkstack/apishim/api33/SettingsShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/SettingsShimImpl.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.networkstack.apishim.api33;
+package com.android.networkstack.apishim;
 
 import android.os.Build;
 
diff --git a/apishim/33/com/android/networkstack/apishim/api33/SocketUtilsShimImpl.java b/apishim/33/com/android/networkstack/apishim/SocketUtilsShimImpl.java
similarity index 95%
rename from apishim/33/com/android/networkstack/apishim/api33/SocketUtilsShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/SocketUtilsShimImpl.java
index 1da7ea2..d4ab534 100644
--- a/apishim/33/com/android/networkstack/apishim/api33/SocketUtilsShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/SocketUtilsShimImpl.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.networkstack.apishim.api33;
+package com.android.networkstack.apishim;
 
 import android.os.Build;
 
diff --git a/apishim/33/com/android/networkstack/apishim/api33/TelephonyManagerShimImpl.java b/apishim/33/com/android/networkstack/apishim/TelephonyManagerShimImpl.java
similarity index 98%
rename from apishim/33/com/android/networkstack/apishim/api33/TelephonyManagerShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/TelephonyManagerShimImpl.java
index 473db91..af481b6 100644
--- a/apishim/33/com/android/networkstack/apishim/api33/TelephonyManagerShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/TelephonyManagerShimImpl.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.networkstack.apishim.api33;
+package com.android.networkstack.apishim;
 
 import static com.android.modules.utils.build.SdkLevel.isAtLeastT;
 import static com.android.net.module.util.CollectionUtils.toIntArray;
diff --git a/apishim/33/com/android/networkstack/apishim/api33/VpnManagerShimImpl.java b/apishim/33/com/android/networkstack/apishim/VpnManagerShimImpl.java
similarity index 97%
rename from apishim/33/com/android/networkstack/apishim/api33/VpnManagerShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/VpnManagerShimImpl.java
index 37a58df..ffd3da3 100644
--- a/apishim/33/com/android/networkstack/apishim/api33/VpnManagerShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/VpnManagerShimImpl.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.networkstack.apishim.api33;
+package com.android.networkstack.apishim;
 
 import static com.android.modules.utils.build.SdkLevel.isAtLeastT;
 
diff --git a/apishim/33/com/android/networkstack/apishim/api33/VpnProfileStateShimImpl.java b/apishim/33/com/android/networkstack/apishim/VpnProfileStateShimImpl.java
similarity index 97%
rename from apishim/33/com/android/networkstack/apishim/api33/VpnProfileStateShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/VpnProfileStateShimImpl.java
index 4521364..7c61b02 100644
--- a/apishim/33/com/android/networkstack/apishim/api33/VpnProfileStateShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/VpnProfileStateShimImpl.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.networkstack.apishim.api33;
+package com.android.networkstack.apishim;
 
 import android.net.VpnProfileState;
 import android.os.Build;
diff --git a/apishim/33/com/android/networkstack/apishim/api33/VpnServiceBuilderShimImpl.java b/apishim/33/com/android/networkstack/apishim/VpnServiceBuilderShimImpl.java
similarity index 97%
rename from apishim/33/com/android/networkstack/apishim/api33/VpnServiceBuilderShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/VpnServiceBuilderShimImpl.java
index 464da3c..da8f774 100644
--- a/apishim/33/com/android/networkstack/apishim/api33/VpnServiceBuilderShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/VpnServiceBuilderShimImpl.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.networkstack.apishim.api33;
+package com.android.networkstack.apishim;
 
 import android.net.IpPrefix;
 import android.net.VpnService;
diff --git a/apishim/34/com/android/networkstack/apishim/BluetoothPanShimImpl.java b/apishim/34/com/android/networkstack/apishim/BluetoothPanShimImpl.java
deleted file mode 100644
index 94c3d38..0000000
--- a/apishim/34/com/android/networkstack/apishim/BluetoothPanShimImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.networkstack.apishim;
-
-import android.bluetooth.BluetoothPan;
-import android.os.Build;
-
-import androidx.annotation.RequiresApi;
-
-/**
- * Implementation of {@link BluetoothPanShimImpl} for API 34.
- */
-// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
-public class BluetoothPanShimImpl extends
-        com.android.networkstack.apishim.api33.BluetoothPanShimImpl {
-    // Currently identical to the API 33 shim, so inherit everything
-    protected BluetoothPanShimImpl(BluetoothPan pan) {
-        super(pan);
-    }
-}
diff --git a/apishim/34/com/android/networkstack/apishim/CaptivePortalDataShimImpl.java b/apishim/34/com/android/networkstack/apishim/CaptivePortalDataShimImpl.java
deleted file mode 100644
index 94814aa..0000000
--- a/apishim/34/com/android/networkstack/apishim/CaptivePortalDataShimImpl.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.networkstack.apishim;
-
-import android.net.CaptivePortalData;
-import android.os.Build;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.RequiresApi;
-
-import com.android.networkstack.apishim.common.CaptivePortalDataShim;
-
-/**
- * Compatibility implementation of {@link CaptivePortalDataShim}.
- */
-// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
-public class CaptivePortalDataShimImpl
-        extends com.android.networkstack.apishim.api33.CaptivePortalDataShimImpl {
-    // Currently identical to the API 33 shim, so inherit everything
-    public CaptivePortalDataShimImpl(@NonNull CaptivePortalData data) {
-        super(data);
-    }
-}
diff --git a/apishim/34/com/android/networkstack/apishim/ConnectivityFrameworkInitShimImpl.java b/apishim/34/com/android/networkstack/apishim/ConnectivityFrameworkInitShimImpl.java
deleted file mode 100644
index a343b67..0000000
--- a/apishim/34/com/android/networkstack/apishim/ConnectivityFrameworkInitShimImpl.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.networkstack.apishim;
-
-import android.os.Build;
-
-import androidx.annotation.RequiresApi;
-
-import com.android.networkstack.apishim.common.ConnectivityFrameworkInitShim;
-
-/**
- * Implementation of {@link ConnectivityFrameworkInitShim}.
- */
-// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
-public class ConnectivityFrameworkInitShimImpl extends
-        com.android.networkstack.apishim.api33.ConnectivityFrameworkInitShimImpl {
-    // Currently identical to the API 33 shim, so inherit everything
-    protected ConnectivityFrameworkInitShimImpl() {}
-}
diff --git a/apishim/34/com/android/networkstack/apishim/ConnectivityManagerShimImpl.java b/apishim/34/com/android/networkstack/apishim/ConnectivityManagerShimImpl.java
deleted file mode 100644
index 7f6ad39..0000000
--- a/apishim/34/com/android/networkstack/apishim/ConnectivityManagerShimImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.networkstack.apishim;
-
-import android.content.Context;
-import android.os.Build;
-
-import androidx.annotation.RequiresApi;
-
-import com.android.networkstack.apishim.common.ConnectivityManagerShim;
-
-/**
- * Compatibility implementation of {@link ConnectivityManagerShim}.
- */
-// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
-public class ConnectivityManagerShimImpl
-        extends com.android.networkstack.apishim.api33.ConnectivityManagerShimImpl  {
-    // Currently identical to the API 33 shim, so inherit everything
-    protected ConnectivityManagerShimImpl(Context context) {
-        super(context);
-    }
-}
diff --git a/apishim/34/com/android/networkstack/apishim/ConstantsShim.java b/apishim/34/com/android/networkstack/apishim/ConstantsShim.java
deleted file mode 100644
index 9df84d5..0000000
--- a/apishim/34/com/android/networkstack/apishim/ConstantsShim.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.networkstack.apishim;
-
-import android.os.Build;
-
-import androidx.annotation.RequiresApi;
-import androidx.annotation.VisibleForTesting;
-
-/**
- * Utility class for defining and importing constants from the Android platform.
- */
-// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
-public class ConstantsShim extends com.android.networkstack.apishim.api33.ConstantsShim {
-    /**
-     * Constant that callers can use to determine what version of the shim they are using.
-     * Must be the same as the version of the shims.
-     * This should only be used by test code. Production code that uses the shims should be using
-     * the shimmed objects and methods themselves.
-     */
-    @VisibleForTesting
-    public static final int VERSION = 34;
-}
diff --git a/apishim/34/com/android/networkstack/apishim/NetworkAgentConfigShimImpl.java b/apishim/34/com/android/networkstack/apishim/NetworkAgentConfigShimImpl.java
deleted file mode 100644
index 4d8ede2..0000000
--- a/apishim/34/com/android/networkstack/apishim/NetworkAgentConfigShimImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.networkstack.apishim;
-
-import android.net.NetworkAgentConfig;
-import android.os.Build;
-
-import androidx.annotation.Nullable;
-import androidx.annotation.RequiresApi;
-
-/**
- * A shim for NetworkAgentConfig
- */
-// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
-public class NetworkAgentConfigShimImpl
-        extends com.android.networkstack.apishim.api33.NetworkAgentConfigShimImpl {
-    protected NetworkAgentConfigShimImpl(@Nullable final NetworkAgentConfig config) {
-        super(config);
-    }
-}
diff --git a/apishim/34/com/android/networkstack/apishim/NetworkInformationShimImpl.java b/apishim/34/com/android/networkstack/apishim/NetworkInformationShimImpl.java
deleted file mode 100644
index b8905e8..0000000
--- a/apishim/34/com/android/networkstack/apishim/NetworkInformationShimImpl.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.networkstack.apishim;
-
-import android.os.Build;
-
-import androidx.annotation.RequiresApi;
-
-import com.android.networkstack.apishim.common.NetworkInformationShim;
-
-/**
- * Compatibility implementation of {@link NetworkInformationShim}.
- */
-// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
-public class NetworkInformationShimImpl
-        extends com.android.networkstack.apishim.api33.NetworkInformationShimImpl {
-    protected NetworkInformationShimImpl() {}
-}
diff --git a/apishim/34/com/android/networkstack/apishim/NetworkRequestShimImpl.java b/apishim/34/com/android/networkstack/apishim/NetworkRequestShimImpl.java
deleted file mode 100644
index 61c9d09..0000000
--- a/apishim/34/com/android/networkstack/apishim/NetworkRequestShimImpl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.networkstack.apishim;
-
-import android.os.Build;
-
-import androidx.annotation.RequiresApi;
-
-import com.android.networkstack.apishim.common.NetworkRequestShim;
-
-/**
- * Implementation of {@link NetworkRequestShim} for API 34.
- */
-// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
-public class NetworkRequestShimImpl
-        extends com.android.networkstack.apishim.api33.NetworkRequestShimImpl {
-    // Currently identical to the API 33 shim, so inherit everything
-    protected NetworkRequestShimImpl() {
-        super();
-    }
-}
diff --git a/apishim/34/com/android/networkstack/apishim/NetworkShimImpl.java b/apishim/34/com/android/networkstack/apishim/NetworkShimImpl.java
deleted file mode 100644
index 683d1eb..0000000
--- a/apishim/34/com/android/networkstack/apishim/NetworkShimImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.networkstack.apishim;
-
-import android.net.Network;
-import android.os.Build;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.RequiresApi;
-
-/**
- * Compatibility implementation of {@link com.android.networkstack.apishim.common.NetworkShim}.
- */
-// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
-public class NetworkShimImpl extends com.android.networkstack.apishim.api33.NetworkShimImpl {
-    // Currently, this is the same as the API 33 shim, so inherit everything from that.
-    protected NetworkShimImpl(@NonNull Network network) {
-        super(network);
-    }
-}
diff --git a/apishim/34/com/android/networkstack/apishim/NsdShimImpl.java b/apishim/34/com/android/networkstack/apishim/NsdShimImpl.java
deleted file mode 100644
index c7b2b7a..0000000
--- a/apishim/34/com/android/networkstack/apishim/NsdShimImpl.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.networkstack.apishim;
-
-import android.os.Build;
-
-import androidx.annotation.RequiresApi;
-
-import com.android.networkstack.apishim.common.NsdShim;
-
-/**
- * Implementation of {@link NsdShim}.
- */
-// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
-public class NsdShimImpl extends com.android.networkstack.apishim.api33.NsdShimImpl {
-    protected NsdShimImpl() {}
-}
diff --git a/apishim/34/com/android/networkstack/apishim/ProcessShimImpl.java b/apishim/34/com/android/networkstack/apishim/ProcessShimImpl.java
deleted file mode 100644
index 460ed46..0000000
--- a/apishim/34/com/android/networkstack/apishim/ProcessShimImpl.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.networkstack.apishim;
-
-import android.os.Build;
-
-import androidx.annotation.RequiresApi;
-
-import com.android.networkstack.apishim.common.ProcessShim;
-
-/** Implementation of {@link ProcessShim} for API 34. */
-// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
-public class ProcessShimImpl extends com.android.networkstack.apishim.api33.ProcessShimImpl {
-    protected ProcessShimImpl() {}
-}
diff --git a/apishim/34/com/android/networkstack/apishim/SettingsShimImpl.java b/apishim/34/com/android/networkstack/apishim/SettingsShimImpl.java
deleted file mode 100644
index aa12005..0000000
--- a/apishim/34/com/android/networkstack/apishim/SettingsShimImpl.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.networkstack.apishim;
-
-import android.os.Build;
-
-import androidx.annotation.RequiresApi;
-
-import com.android.networkstack.apishim.common.SettingsShim;
-
-/**
- * Compatibility implementation of {@link SettingsShim} for API 34.
- */
-// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
-public class SettingsShimImpl
-        extends com.android.networkstack.apishim.api33.SettingsShimImpl {
-    // Currently identical to the API 33 shim, so inherit everything
-    protected SettingsShimImpl() { }
-}
diff --git a/apishim/34/com/android/networkstack/apishim/SocketUtilsShimImpl.java b/apishim/34/com/android/networkstack/apishim/SocketUtilsShimImpl.java
deleted file mode 100644
index ca7b64c..0000000
--- a/apishim/34/com/android/networkstack/apishim/SocketUtilsShimImpl.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.networkstack.apishim;
-
-import android.os.Build;
-
-import androidx.annotation.RequiresApi;
-
-/**
- * Implementation of {@link com.android.networkstack.apishim.common.SocketUtilsShim}.
- */
-// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
-public class SocketUtilsShimImpl
-        extends com.android.networkstack.apishim.api33.SocketUtilsShimImpl {
-    // Currently, this is the same as the API 33 shim, so inherit everything from that.
-    protected SocketUtilsShimImpl() {}
-}
diff --git a/apishim/34/com/android/networkstack/apishim/TelephonyManagerShimImpl.java b/apishim/34/com/android/networkstack/apishim/TelephonyManagerShimImpl.java
deleted file mode 100644
index ed81f52..0000000
--- a/apishim/34/com/android/networkstack/apishim/TelephonyManagerShimImpl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.networkstack.apishim;
-
-import android.os.Build;
-import android.telephony.TelephonyManager;
-
-import androidx.annotation.RequiresApi;
-
-import com.android.networkstack.apishim.common.TelephonyManagerShim;
-
-/**
- * Implementation of {@link TelephonyManagerShim} for API 34.
- */
-// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
-public class TelephonyManagerShimImpl extends
-        com.android.networkstack.apishim.api33.TelephonyManagerShimImpl {
-    protected TelephonyManagerShimImpl(TelephonyManager telephonyManager) {
-        super(telephonyManager);
-    }
-}
diff --git a/apishim/34/com/android/networkstack/apishim/VpnManagerShimImpl.java b/apishim/34/com/android/networkstack/apishim/VpnManagerShimImpl.java
deleted file mode 100644
index d7f6280..0000000
--- a/apishim/34/com/android/networkstack/apishim/VpnManagerShimImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.networkstack.apishim;
-
-import android.content.Context;
-import android.os.Build;
-
-import androidx.annotation.RequiresApi;
-
-import com.android.networkstack.apishim.common.VpnManagerShim;
-
-/**
- * Compatibility implementation of {@link VpnManagerShim}.
- */
-// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
-public class VpnManagerShimImpl extends com.android.networkstack.apishim.api33.VpnManagerShimImpl {
-    protected VpnManagerShimImpl(Context context) {
-        super(context);
-    }
-}
diff --git a/apishim/34/com/android/networkstack/apishim/VpnProfileStateShimImpl.java b/apishim/34/com/android/networkstack/apishim/VpnProfileStateShimImpl.java
deleted file mode 100644
index 23f346d..0000000
--- a/apishim/34/com/android/networkstack/apishim/VpnProfileStateShimImpl.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.networkstack.apishim;
-
-import android.net.VpnProfileState;
-import android.os.Build;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.RequiresApi;
-
-import com.android.networkstack.apishim.common.VpnProfileStateShim;
-
-/** Implementation of {@link VpnProfileStateShim} for API 34. */
-// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
-public class VpnProfileStateShimImpl
-        extends com.android.networkstack.apishim.api33.VpnProfileStateShimImpl {
-    protected VpnProfileStateShimImpl(@NonNull VpnProfileState profileState) {
-        super(profileState);
-    }
-}
diff --git a/apishim/34/com/android/networkstack/apishim/VpnServiceBuilderShimImpl.java b/apishim/34/com/android/networkstack/apishim/VpnServiceBuilderShimImpl.java
deleted file mode 100644
index b78a77b..0000000
--- a/apishim/34/com/android/networkstack/apishim/VpnServiceBuilderShimImpl.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.networkstack.apishim;
-
-import android.os.Build;
-
-import androidx.annotation.RequiresApi;
-
-import com.android.networkstack.apishim.common.VpnServiceBuilderShim;
-
-/**
- * Implementation of {@link VpnServiceBuilderShim}.
- */
-// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
-public class VpnServiceBuilderShimImpl extends
-        com.android.networkstack.apishim.api33.VpnServiceBuilderShimImpl {
-    protected VpnServiceBuilderShimImpl() {}
-}
diff --git a/apishim/common/com/android/networkstack/apishim/common/EthernetManagerShim.java b/apishim/common/com/android/networkstack/apishim/common/EthernetManagerShim.java
new file mode 100644
index 0000000..02a08de
--- /dev/null
+++ b/apishim/common/com/android/networkstack/apishim/common/EthernetManagerShim.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.networkstack.apishim.common;
+
+import android.net.IpConfiguration;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import java.util.List;
+import java.util.concurrent.Executor;
+
+/** API shim for EthernetManager */
+public interface EthernetManagerShim {
+    int STATE_ABSENT = 0;
+    int STATE_LINK_DOWN = 1;
+    int STATE_LINK_UP = 2;
+    int ROLE_NONE = 0;
+    int ROLE_CLIENT = 1;
+    int ROLE_SERVER = 2;
+
+    /** Shim for EthernetManager#InterfaceStateListener. */
+    interface InterfaceStateListener {
+        void onInterfaceStateChanged(@NonNull String iface, int state, int role,
+                @Nullable IpConfiguration configuration);
+    }
+
+    /** Shim for EthernetManager#addInterfaceStateListener */
+    default void addInterfaceStateListener(@NonNull Executor executor,
+            @NonNull InterfaceStateListener listener) throws UnsupportedApiLevelException {
+        throw new UnsupportedApiLevelException();
+    }
+
+    /** Shim for EthernetManager#removeInterfaceStateListener */
+    default void removeInterfaceStateListener(@NonNull InterfaceStateListener listener)
+            throws UnsupportedApiLevelException {
+        throw new UnsupportedApiLevelException("Not supported until API 33");
+    }
+
+    /** Shim for EthernetManager#setIncludeTestInterfaces */
+    default void setIncludeTestInterfaces(boolean include) throws UnsupportedApiLevelException {
+        throw new UnsupportedApiLevelException("Not supported until API 30");
+    }
+
+    /** Shim for EthernetManager#getInterfaceList */
+    default List<String> getInterfaceList() throws UnsupportedApiLevelException {
+        throw new UnsupportedApiLevelException("Not supported until API 33");
+    }
+}
diff --git a/apishim/common/com/android/networkstack/apishim/common/Ikev2VpnProfileBuilderShim.java b/apishim/common/com/android/networkstack/apishim/common/Ikev2VpnProfileBuilderShim.java
new file mode 100644
index 0000000..0ad989e
--- /dev/null
+++ b/apishim/common/com/android/networkstack/apishim/common/Ikev2VpnProfileBuilderShim.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.networkstack.apishim.common;
+
+import android.net.ProxyInfo;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import java.security.PrivateKey;
+import java.security.cert.X509Certificate;
+import java.util.List;
+
+
+/**
+ * A shim for Ikev2VpnProfile.Builder.
+ *
+ * T should extend Ikev2VpnProfile.Builder, but this can't be written here as that class is not
+ * available in API29.
+ * @param <T> type of builder, typically Ikev2VpnProfile.Builder
+ */
+// TODO : when API29 is no longer supported, remove the type argument
+public interface Ikev2VpnProfileBuilderShim<T> {
+    /**
+     * @see Ikev2VpnProfile.Builder#setRequiresInternetValidation(boolean)
+     */
+    default Ikev2VpnProfileBuilderShim<T> setRequiresInternetValidation(
+            boolean requiresInternetValidation) throws UnsupportedApiLevelException {
+        throw new UnsupportedApiLevelException("Only supported from API 33");
+    }
+
+    /**
+     * @see Ikev2VpnProfile.Builder#setAuthPsk(byte[])
+     */
+    default Ikev2VpnProfileBuilderShim<T> setAuthPsk(@NonNull byte[] psk)
+            throws UnsupportedApiLevelException {
+        throw new UnsupportedApiLevelException("Only supported from API 30");
+    }
+
+    /**
+     * @see Ikev2VpnProfile.Builder#setAuthUsernamePassword(String, String, X509Certificate)
+     */
+    default Ikev2VpnProfileBuilderShim<T> setAuthUsernamePassword(@NonNull String user,
+            @NonNull String pass, @Nullable X509Certificate serverRootCa)
+            throws UnsupportedApiLevelException {
+        throw new UnsupportedApiLevelException("Only supported from API 30");
+    }
+
+    /**
+     * @see Ikev2VpnProfile.Builder#setAuthDigitalSignature(X509Certificate, PrivateKey,
+     *      X509Certificate)
+     */
+    default Ikev2VpnProfileBuilderShim<T> setAuthDigitalSignature(@NonNull X509Certificate userCert,
+            @NonNull PrivateKey key, @Nullable X509Certificate serverRootCa)
+            throws UnsupportedApiLevelException {
+        throw new UnsupportedApiLevelException("Only supported from API 30");
+    }
+
+    /**
+     * @see Ikev2VpnProfile.Builder#setBypassable(boolean)
+     */
+    default Ikev2VpnProfileBuilderShim<T> setBypassable(boolean isBypassable)
+            throws UnsupportedApiLevelException {
+        throw new UnsupportedApiLevelException("Only supported from API 30");
+    }
+
+    /**
+     * @see Ikev2VpnProfile.Builder#setProxy(ProxyInfo)
+     */
+    default Ikev2VpnProfileBuilderShim<T> setProxy(@Nullable ProxyInfo proxy)
+            throws UnsupportedApiLevelException {
+        throw new UnsupportedApiLevelException("Only supported from API 30");
+    }
+
+    /**
+     * @see Ikev2VpnProfile.Builder#setMaxMtu(int)
+     */
+    default Ikev2VpnProfileBuilderShim<T> setMaxMtu(int mtu) throws UnsupportedApiLevelException {
+        throw new UnsupportedApiLevelException("Only supported from API 30");
+    }
+
+    /**
+     * @see Ikev2VpnProfile.Builder#setMetered(boolean)
+     */
+    default Ikev2VpnProfileBuilderShim<T> setMetered(boolean isMetered)
+            throws UnsupportedApiLevelException {
+        throw new UnsupportedApiLevelException("Only supported from API 30");
+    }
+
+    /**
+     * @see Ikev2VpnProfile.Builder#setAllowedAlgorithms(List<String>)
+     */
+    default Ikev2VpnProfileBuilderShim<T> setAllowedAlgorithms(@NonNull List<String> algorithmNames)
+            throws UnsupportedApiLevelException {
+        throw new UnsupportedApiLevelException("Only supported from API 30");
+    }
+
+    /**
+     * @see Ikev2VpnProfile.Builder#setLocalRoutesExcluded(boolean)
+     */
+    default Ikev2VpnProfileBuilderShim<T> setLocalRoutesExcluded(boolean excludeLocalRoutes)
+            throws UnsupportedApiLevelException {
+        throw new UnsupportedApiLevelException("Only supported from API 33");
+    }
+
+    /**
+     * Get <T> type of builder, typically Ikev2VpnProfile.Builder
+     */
+    default T getBuilder() throws UnsupportedApiLevelException {
+        throw new UnsupportedApiLevelException("Only supported from API 30");
+    }
+
+    /**
+     * Build an Ikev2VpnProfileShim
+     */
+    default Ikev2VpnProfileShim build() throws UnsupportedApiLevelException {
+        throw new UnsupportedApiLevelException("Only supported from API 30");
+    }
+}
diff --git a/apishim/common/com/android/networkstack/apishim/common/Ikev2VpnProfileShim.java b/apishim/common/com/android/networkstack/apishim/common/Ikev2VpnProfileShim.java
new file mode 100644
index 0000000..a29c5bf
--- /dev/null
+++ b/apishim/common/com/android/networkstack/apishim/common/Ikev2VpnProfileShim.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.networkstack.apishim.common;
+
+/**
+ * A shim for Ikev2VpnProfile.
+ *
+ * T should extend Ikev2VpnProfile, but this can't be written here as that class is not
+ * available in API29.
+ * @param <T> type of profile, typically Ikev2VpnProfile
+ */
+// TODO : when API29 is no longer supported, remove the type argument
+public interface Ikev2VpnProfileShim<T> {
+    /**
+     * @see Ikev2VpnProfile#isInternetValidationRequired()
+     */
+    default boolean isInternetValidationRequired() throws UnsupportedApiLevelException {
+        throw new UnsupportedApiLevelException("Only supported from API level 33.");
+    }
+
+    /**
+     * @see Ikev2VpnProfile#getIkeTunnelConnectionParams()
+     */
+    default Object getIkeTunnelConnectionParams() throws UnsupportedApiLevelException {
+        throw new UnsupportedApiLevelException("Only supported from API level 33.");
+    }
+
+    /**
+     * Return the <T> type of profile.
+     */
+    default T getProfile() throws UnsupportedApiLevelException {
+        throw new UnsupportedApiLevelException("Only supported from API level 30.");
+    }
+}
diff --git a/apishim/jarjar-rules-compat.txt b/apishim/jarjar-rules-compat.txt
index 09fa04d..4f34ccb 100644
--- a/apishim/jarjar-rules-compat.txt
+++ b/apishim/jarjar-rules-compat.txt
@@ -1,7 +1,7 @@
 # jarjar rules to use on API stable builds.
 # Use the latest stable apishim package as the main apishim package, to replace and avoid building
 # the unstable, non-compatibility shims.
-# Once API 34 is stable, apishim/34/com.android.networkstack.apishim should be moved to the
-# com.android.networkstack.apishim.api34 package, a new apishim/34/com.android.networkstack.apishim
-# package should be created, and this rule should reference api34.
-rule com.android.networkstack.apishim.api33.** com.android.networkstack.apishim.@1
\ No newline at end of file
+# Once API 32 is stable, apishim/32/com.android.networkstack.apishim should be moved to the
+# com.android.networkstack.apishim.api32 package, a new apishim/33/com.android.networkstack.apishim
+# package should be created, and this rule should reference api32.
+rule com.android.networkstack.apishim.api31.** com.android.networkstack.apishim.@1
\ No newline at end of file
diff --git a/common/moduleutils/src/android/net/ip/NetlinkMonitor.java b/common/moduleutils/src/android/net/ip/NetlinkMonitor.java
index e58b44e..17157d8 100644
--- a/common/moduleutils/src/android/net/ip/NetlinkMonitor.java
+++ b/common/moduleutils/src/android/net/ip/NetlinkMonitor.java
@@ -18,7 +18,6 @@
 
 import static android.net.util.SocketUtils.makeNetlinkSocketAddress;
 import static android.system.OsConstants.AF_NETLINK;
-import static android.system.OsConstants.ENOBUFS;
 import static android.system.OsConstants.SOCK_DGRAM;
 import static android.system.OsConstants.SOCK_NONBLOCK;
 import static android.system.OsConstants.SOL_SOCKET;
@@ -102,11 +101,7 @@
         try {
             fd = Os.socket(AF_NETLINK, SOCK_DGRAM | SOCK_NONBLOCK, mFamily);
             if (mSockRcvbufSize != DEFAULT_SOCKET_RECV_BUFSIZE) {
-                try {
-                    Os.setsockoptInt(fd, SOL_SOCKET, SO_RCVBUF, mSockRcvbufSize);
-                } catch (ErrnoException e) {
-                    Log.wtf(mTag, "Failed to set SO_RCVBUF to " + mSockRcvbufSize, e);
-                }
+                Os.setsockoptInt(fd, SOL_SOCKET, SO_RCVBUF, mSockRcvbufSize);
             }
             Os.bind(fd, makeNetlinkSocketAddress(0, mBindGroups));
             NetlinkSocket.connectToKernel(fd);
@@ -152,32 +147,6 @@
         }
     }
 
-    @Override
-    protected void logError(String msg, Exception e) {
-        mLog.e(msg, e);
-    }
-
-    // Ignoring ENOBUFS may miss any important netlink messages, there are some messages which
-    // cannot be recovered by dumping current state once missed since kernel doesn't keep state
-    // for it. In addition, dumping current state will not result in any RTM_DELxxx messages, so
-    // reconstructing current state from a dump will be difficult. However, for those netlink
-    // messages don't cause any state changes, e.g. RTM_NEWLINK with current link state, maybe
-    // it's okay to ignore them, because these netlink messages won't cause any changes on the
-    // LinkProperties. Given the above trade-offs, try to ignore ENOBUFS and that's similar to
-    // what netd does today.
-    //
-    // TODO: log metrics when ENOBUFS occurs, or even force a disconnect, it will help see how
-    // often this error occurs on fields with the associated socket receive buffer size.
-    @Override
-    protected boolean handleReadError(ErrnoException e) {
-        logError("readPacket error: ", e);
-        if (e.errno == ENOBUFS) {
-            Log.wtf(mTag, "Errno: ENOBUFS");
-            return false;
-        }
-        return true;
-    }
-
     // TODO: move NetworkStackUtils to frameworks/libs/net for NetworkStackUtils#closeSocketQuietly.
     private void closeSocketQuietly(FileDescriptor fd) {
         try {
diff --git a/common/networkstackclient/Android.bp b/common/networkstackclient/Android.bp
index c363a2b..53477ac 100644
--- a/common/networkstackclient/Android.bp
+++ b/common/networkstackclient/Android.bp
@@ -194,6 +194,7 @@
     ],
     static_libs: [
         "networkstack-aidl-latest",
+        "modules-utils-build",
     ],
     visibility: [
         "//frameworks/base/packages/Connectivity/service",
@@ -204,12 +205,10 @@
         "//packages/apps/Bluetooth",
         "//packages/modules/Bluetooth/android/app",
         "//packages/modules/NetworkStack",
-        "//packages/modules/Wifi/service",
     ],
     apex_available: [
         "//apex_available:platform",
         "com.android.bluetooth",
         "com.android.tethering",
-        "com.android.wifi",
     ],
 }
diff --git a/common/networkstackclient/src/android/net/NetworkMonitorManager.java b/common/networkstackclient/src/android/net/NetworkMonitorManager.java
index c39c684..98598a1 100644
--- a/common/networkstackclient/src/android/net/NetworkMonitorManager.java
+++ b/common/networkstackclient/src/android/net/NetworkMonitorManager.java
@@ -23,6 +23,8 @@
 import android.os.RemoteException;
 import android.util.Log;
 
+import com.android.modules.utils.build.SdkLevel;
+
 /**
  * A convenience wrapper for INetworkMonitor.
  *
@@ -148,25 +150,15 @@
         }
     }
 
-    // This should not be called starting from S
-    @Deprecated
-    public boolean notifyNetworkConnected(LinkProperties lp, NetworkCapabilities nc) {
-        final long token = Binder.clearCallingIdentity();
-        try {
-            mNetworkMonitor.notifyNetworkConnected(lp, nc);
-            return true;
-        } catch (RemoteException e) {
-            log("Error in notifyNetworkConnected", e);
-            return false;
-        } finally {
-            Binder.restoreCallingIdentity(token);
-        }
-    }
-
     public boolean notifyNetworkConnected(NetworkMonitorParameters params) {
         final long token = Binder.clearCallingIdentity();
         try {
-            mNetworkMonitor.notifyNetworkConnectedParcel(params);
+            if (SdkLevel.isAtLeastT()) {
+                mNetworkMonitor.notifyNetworkConnectedParcel(params);
+            } else {
+                mNetworkMonitor.notifyNetworkConnected(params.linkProperties,
+                        params.networkCapabilities);
+            }
             return true;
         } catch (RemoteException e) {
             log("Error in notifyNetworkConnected", e);
diff --git a/src/android/net/dhcp/DhcpInformPacket.java b/src/android/net/dhcp/DhcpInformPacket.java
new file mode 100644
index 0000000..135b8f6
--- /dev/null
+++ b/src/android/net/dhcp/DhcpInformPacket.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net.dhcp;
+
+import java.net.Inet4Address;
+import java.nio.ByteBuffer;
+
+/**
+ * This class implements the (unused) DHCP-INFORM packet.
+ */
+public class DhcpInformPacket extends DhcpPacket {
+    /**
+     * Generates an INFORM packet with the specified parameters.
+     */
+    DhcpInformPacket(int transId, short secs, Inet4Address clientIp, Inet4Address yourIp,
+                     Inet4Address nextIp, Inet4Address relayIp,
+                     byte[] clientMac) {
+        super(transId, secs, clientIp, yourIp, nextIp, relayIp, clientMac, false);
+    }
+
+    public String toString() {
+        String s = super.toString();
+        return s + " INFORM";
+    }
+
+    /**
+     * Builds an INFORM packet.
+     */
+    public ByteBuffer buildPacket(int encap, short destUdp, short srcUdp) {
+        ByteBuffer result = ByteBuffer.allocate(MAX_LENGTH);
+
+        fillInPacket(encap, mClientIp, mYourIp, destUdp, srcUdp, result,
+            DHCP_BOOTREQUEST, false);
+        result.flip();
+        return result;
+    }
+
+    /**
+     * Adds additional parameters to the INFORM packet.
+     */
+    void finishPacket(ByteBuffer buffer) {
+        addTlv(buffer, DHCP_MESSAGE_TYPE, DHCP_MESSAGE_TYPE_INFORM);
+        addTlv(buffer, DHCP_CLIENT_IDENTIFIER, getClientId());
+        addCommonClientTlvs(buffer);
+        addTlv(buffer, DHCP_PARAMETER_LIST, mRequestedParams);
+        addTlvEnd(buffer);
+    }
+}
diff --git a/src/android/net/dhcp/DhcpPacket.java b/src/android/net/dhcp/DhcpPacket.java
index 7dc1b99..63c5b0c 100644
--- a/src/android/net/dhcp/DhcpPacket.java
+++ b/src/android/net/dhcp/DhcpPacket.java
@@ -1346,6 +1346,11 @@
                 newPacket = new DhcpReleasePacket(
                         transactionId, serverIdentifier, clientIp, relayIp, clientMac);
                 break;
+            case DHCP_MESSAGE_TYPE_INFORM:
+                newPacket = new DhcpInformPacket(
+                    transactionId, secs, clientIp, yourIp, nextIp, relayIp,
+                    clientMac);
+                break;
             default:
                 throw new ParseException(DhcpErrorEvent.DHCP_UNKNOWN_MSG_TYPE,
                         "Unimplemented DHCP type %d", dhcpType);
diff --git a/src/android/net/ip/IpClientLinkObserver.java b/src/android/net/ip/IpClientLinkObserver.java
index bebe7c9..b1dbabd 100644
--- a/src/android/net/ip/IpClientLinkObserver.java
+++ b/src/android/net/ip/IpClientLinkObserver.java
@@ -21,7 +21,6 @@
 import static android.system.OsConstants.AF_UNSPEC;
 import static android.system.OsConstants.IFF_LOOPBACK;
 
-import static com.android.modules.utils.build.SdkLevel.isAtLeastT;
 import static com.android.net.module.util.NetworkStackConstants.ICMPV6_ROUTER_ADVERTISEMENT;
 import static com.android.net.module.util.netlink.NetlinkConstants.IFF_LOWER_UP;
 import static com.android.net.module.util.netlink.NetlinkConstants.RTM_F_CLONED;
@@ -45,7 +44,6 @@
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 
-import com.android.internal.annotations.VisibleForTesting;
 import com.android.net.module.util.InterfaceParams;
 import com.android.net.module.util.netlink.NduseroptMessage;
 import com.android.net.module.util.netlink.NetlinkConstants;
@@ -161,14 +159,7 @@
     // This must match the interface prefix in clatd.c.
     // TODO: Revert this hack once IpClient and Nat464Xlat work in concert.
     protected static final String CLAT_PREFIX = "v4-";
-    private static final boolean DBG = true;
-
-    // The default socket receive buffer size in bytes(4MB). If too many netlink messages are
-    // sent too quickly, those messages can overflow the socket receive buffer. Set a large-enough
-    // recv buffer size to avoid the ENOBUFS as much as possible.
-    @VisibleForTesting
-    static final String CONFIG_SOCKET_RECV_BUFSIZE = "ipclient_netlink_sock_recv_buf_size";
-    private static final int SOCKET_RECV_BUFSIZE = 4 * 1024 * 1024;
+    private static final boolean DBG = false;
 
     public IpClientLinkObserver(Context context, Handler h, String iface, Callback callback,
             Configuration config, SharedLog log, IpClient.Dependencies deps) {
@@ -186,11 +177,7 @@
         mAlarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
         mDependencies = deps;
         mNetlinkMonitor = new MyNetlinkMonitor(h, log, mTag);
-        mHandler.post(() -> {
-            if (!mNetlinkMonitor.start()) {
-                Log.wtf(mTag, "Fail to start NetlinkMonitor.");
-            }
-        });
+        mHandler.post(mNetlinkMonitor::start);
     }
 
     public void shutdown() {
@@ -216,16 +203,7 @@
 
     private boolean isNetlinkEventParsingEnabled() {
         return mDependencies.isFeatureEnabled(mContext, IPCLIENT_PARSE_NETLINK_EVENTS_VERSION,
-                isAtLeastT() /* default value */);
-    }
-
-    private int getSocketReceiveBufferSize() {
-        final int size = mDependencies.getDeviceConfigPropertyInt(CONFIG_SOCKET_RECV_BUFSIZE,
-                SOCKET_RECV_BUFSIZE /* default value */);
-        if (size < 0) {
-            throw new IllegalArgumentException("Invalid SO_RCVBUF " + size);
-        }
-        return size;
+                false /* default value */);
     }
 
     @Override
@@ -300,10 +278,10 @@
     }
 
     private void updateInterfaceDnsServerInfo(long lifetime, final String[] addresses) {
+        maybeLog("interfaceDnsServerInfo", Arrays.toString(addresses));
         final boolean changed = mDnsServerRepository.addServers(lifetime, addresses);
         final boolean linkState;
         if (changed) {
-            maybeLog("interfaceDnsServerInfo", Arrays.toString(addresses));
             synchronized (this) {
                 mDnsServerRepository.setDnsServersOn(mLinkProperties);
                 linkState = getInterfaceLinkStateLocked();
@@ -312,7 +290,7 @@
         }
     }
 
-    private boolean updateInterfaceAddress(@NonNull final LinkAddress address, boolean add) {
+    private void updateInterfaceAddress(@NonNull final LinkAddress address, boolean add) {
         final boolean changed;
         final boolean linkState;
         synchronized (this) {
@@ -330,10 +308,9 @@
                 mCallback.onIpv6AddressRemoved(addr);
             }
         }
-        return changed;
     }
 
-    private boolean updateInterfaceRoute(final RouteInfo route, boolean add) {
+    private void updateInterfaceRoute(final RouteInfo route, boolean add) {
         final boolean changed;
         final boolean linkState;
         synchronized (this) {
@@ -347,7 +324,6 @@
         if (changed) {
             mCallback.update(linkState);
         }
-        return changed;
     }
 
     private void updateInterfaceRemoved() {
@@ -423,12 +399,11 @@
         MyNetlinkMonitor(Handler h, SharedLog log, String tag) {
             super(h, log, tag, OsConstants.NETLINK_ROUTE,
                     !isNetlinkEventParsingEnabled()
-                        ? NetlinkConstants.RTMGRP_ND_USEROPT
-                        : (NetlinkConstants.RTMGRP_ND_USEROPT | NetlinkConstants.RTMGRP_LINK
-                                | NetlinkConstants.RTMGRP_IPV4_IFADDR
-                                | NetlinkConstants.RTMGRP_IPV6_IFADDR
-                                | NetlinkConstants.RTMGRP_IPV6_ROUTE),
-                    getSocketReceiveBufferSize());
+                    ? NetlinkConstants.RTMGRP_ND_USEROPT
+                    : (NetlinkConstants.RTMGRP_ND_USEROPT | NetlinkConstants.RTMGRP_LINK
+                            | NetlinkConstants.RTMGRP_IPV4_IFADDR
+                            | NetlinkConstants.RTMGRP_IPV6_IFADDR
+                            | NetlinkConstants.RTMGRP_IPV6_ROUTE));
 
             mHandler = h;
         }
@@ -447,9 +422,6 @@
         private int mIfindex;
 
         void setIfindex(int ifindex) {
-            if (!isRunning()) {
-                Log.wtf(mTag, "NetlinkMonitor is not running when setting interface parameter!");
-            }
             mIfindex = ifindex;
         }
 
@@ -629,14 +601,12 @@
 
             switch (msg.getHeader().nlmsg_type) {
                 case NetlinkConstants.RTM_NEWADDR:
-                    if (updateInterfaceAddress(la, true /* add address */)) {
-                        maybeLog("addressUpdated", mIfindex, la);
-                    }
+                    maybeLog("addressUpdated", mIfindex, la);
+                    updateInterfaceAddress(la, true /* add address */);
                     break;
                 case NetlinkConstants.RTM_DELADDR:
-                    if (updateInterfaceAddress(la, false /* remove address */)) {
-                        maybeLog("addressRemoved", mIfindex, la);
-                    }
+                    maybeLog("addressRemoved", mIfindex, la);
+                    updateInterfaceAddress(la, false /* remove address */);
                     break;
                 default:
                     Log.e(mTag, "Unknown rtnetlink address msg type " + msg.getHeader().nlmsg_type);
@@ -661,14 +631,12 @@
                     mInterfaceName, msg.getRtMsgHeader().type);
             switch (msg.getHeader().nlmsg_type) {
                 case NetlinkConstants.RTM_NEWROUTE:
-                    if (updateInterfaceRoute(route, true /* add route */)) {
-                        maybeLog("routeUpdated", route);
-                    }
+                    maybeLog("routeUpdated", route);
+                    updateInterfaceRoute(route, true /* add route */);
                     break;
                 case NetlinkConstants.RTM_DELROUTE:
-                    if (updateInterfaceRoute(route, false /* remove route */)) {
-                        maybeLog("routeRemoved", route);
-                    }
+                    maybeLog("routeRemoved", route);
+                    updateInterfaceRoute(route, false /* remove route */);
                     break;
                 default:
                     Log.e(mTag, "Unknown rtnetlink route msg type " + msg.getHeader().nlmsg_type);
diff --git a/src/android/net/ip/IpReachabilityMonitor.java b/src/android/net/ip/IpReachabilityMonitor.java
index 7614cf3..876610d 100644
--- a/src/android/net/ip/IpReachabilityMonitor.java
+++ b/src/android/net/ip/IpReachabilityMonitor.java
@@ -667,7 +667,7 @@
     }
 
     /**
-     * Log NUD failure metrics with new statsd APIs while the function using mMetricsLog API
+     * Log NUD failure metrics with new Westworld APIs while the function using mMetricsLog API
      * still sends the legacy metrics, @see #logNudFailed.
      */
     private void logNeighborLostEvent(final NeighborEvent event, final NudEventType type) {
diff --git a/tests/integration/Android.bp b/tests/integration/Android.bp
index 2bf0529..9984a54 100644
--- a/tests/integration/Android.bp
+++ b/tests/integration/Android.bp
@@ -36,8 +36,8 @@
     name: "NetworkStackIntegrationTestsDefaults",
     defaults: ["framework-connectivity-test-defaults"],
     srcs: [
-        "common/**/*.java",
-        "common/**/*.kt",
+        "src/**/*.java",
+        "src/**/*.kt",
     ],
     static_libs: [
         "androidx.annotation_annotation",
@@ -57,10 +57,6 @@
 android_library {
     name: "NetworkStackIntegrationTestsLib",
     defaults: ["NetworkStackIntegrationTestsDefaults"],
-    srcs: [
-        "signature/**/*.java",
-        "signature/**/*.kt",
-    ],
     min_sdk_version: "29",
     static_libs: [
         "NetworkStackApiStableLib",
@@ -88,10 +84,6 @@
         "NetworkStackIntegrationTestsJniDefaults",
         "ConnectivityNextEnableDefaults",
     ],
-    srcs: [
-        "signature/**/*.java",
-        "signature/**/*.kt",
-    ],
     static_libs: [
         "NetworkStackApiCurrentLib",
     ],
@@ -101,26 +93,6 @@
     jarjar_rules: ":NetworkStackJarJarRules",
 }
 
-// Network stack integration root tests.
-android_test {
-    name: "NetworkStackRootTests",
-    defaults: [
-        "NetworkStackIntegrationTestsDefaults",
-        "NetworkStackIntegrationTestsJniDefaults",
-    ],
-    srcs: [
-        "root/**/*.java",
-        "root/**/*.kt",
-    ],
-    static_libs: [
-        "NetworkStackApiCurrentLib",
-    ],
-    platform_apis: true,
-    test_suites: ["general-tests", "mts-networking"],
-    manifest: "AndroidManifest_root.xml",
-    jarjar_rules: ":NetworkStackJarJarRules",
-}
-
 // Special version of the network stack tests that includes all tests necessary for code coverage
 // purposes. This is currently the union of NetworkStackTests and NetworkStackIntegrationTests.
 android_test {
@@ -129,7 +101,7 @@
     platform_apis: true,
     min_sdk_version: "29",
     target_sdk_version: "30",
-    test_suites: ["device-tests", "mts-networking"],
+    test_suites: ["device-tests", "mts"],
     test_config: "AndroidTest_Coverage.xml",
     defaults: ["NetworkStackIntegrationTestsJniDefaults"],
     static_libs: [
diff --git a/tests/integration/AndroidManifest_root.xml b/tests/integration/AndroidManifest_root.xml
deleted file mode 100644
index 02b82c5..0000000
--- a/tests/integration/AndroidManifest_root.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2021 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="com.android.server.networkstack.roottests">
-
-    <application android:debuggable="true">
-        <uses-library android:name="android.test.runner" />
-    </application>
-    <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
-        android:targetPackage="com.android.server.networkstack.roottests"
-        android:label="Networking stack integration root tests">
-    </instrumentation>
-</manifest>
diff --git a/tests/integration/lint-baseline.xml b/tests/integration/lint-baseline.xml
index 1868549..eadec6f 100644
--- a/tests/integration/lint-baseline.xml
+++ b/tests/integration/lint-baseline.xml
@@ -7,8 +7,8 @@
         errorLine1="        assertEquals(SERVER_ADDR, captor.getValue().getDhcpServerAddress());"
         errorLine2="                                                    ~~~~~~~~~~~~~~~~~~~~">
         <location
-            file="packages/modules/NetworkStack/tests/integration/common/android/net/ip/IpClientIntegrationTestCommon.java"
-            line="1513"
+            file="packages/modules/NetworkStack/tests/integration/src/android/net/ip/IpClientIntegrationTestCommon.java"
+            line="1327"
             column="53"/>
     </issue>
 
@@ -18,8 +18,8 @@
         errorLine1="                argThat(lp -> Objects.equals(expected, lp.getNat64Prefix())));"
         errorLine2="                                                          ~~~~~~~~~~~~~~">
         <location
-            file="packages/modules/NetworkStack/tests/integration/common/android/net/ip/IpClientIntegrationTestCommon.java"
-            line="1836"
+            file="packages/modules/NetworkStack/tests/integration/src/android/net/ip/IpClientIntegrationTestCommon.java"
+            line="1623"
             column="59"/>
     </issue>
 
@@ -29,8 +29,8 @@
         errorLine1="                lp -> !Objects.equals(unchanged, lp.getNat64Prefix())));"
         errorLine2="                                                    ~~~~~~~~~~~~~~">
         <location
-            file="packages/modules/NetworkStack/tests/integration/common/android/net/ip/IpClientIntegrationTestCommon.java"
-            line="1842"
+            file="packages/modules/NetworkStack/tests/integration/src/android/net/ip/IpClientIntegrationTestCommon.java"
+            line="1629"
             column="53"/>
     </issue>
 
@@ -40,8 +40,8 @@
         errorLine1="        if (lp.getNat64Prefix() != null) {"
         errorLine2="               ~~~~~~~~~~~~~~">
         <location
-            file="packages/modules/NetworkStack/tests/integration/common/android/net/ip/IpClientIntegrationTestCommon.java"
-            line="1873"
+            file="packages/modules/NetworkStack/tests/integration/src/android/net/ip/IpClientIntegrationTestCommon.java"
+            line="1660"
             column="16"/>
     </issue>
 
@@ -51,8 +51,8 @@
         errorLine1="            assertEquals(prefix, lp.getNat64Prefix());"
         errorLine2="                                    ~~~~~~~~~~~~~~">
         <location
-            file="packages/modules/NetworkStack/tests/integration/common/android/net/ip/IpClientIntegrationTestCommon.java"
-            line="1874"
+            file="packages/modules/NetworkStack/tests/integration/src/android/net/ip/IpClientIntegrationTestCommon.java"
+            line="1661"
             column="37"/>
     </issue>
 
diff --git a/tests/integration/signature/android/net/ip/IpClientSignatureTest.kt b/tests/integration/src/android/net/ip/IpClientIntegrationTest.kt
similarity index 96%
rename from tests/integration/signature/android/net/ip/IpClientSignatureTest.kt
rename to tests/integration/src/android/net/ip/IpClientIntegrationTest.kt
index c9e33b5..fa379d3 100644
--- a/tests/integration/signature/android/net/ip/IpClientSignatureTest.kt
+++ b/tests/integration/src/android/net/ip/IpClientIntegrationTest.kt
@@ -32,7 +32,7 @@
 /**
  * Tests for IpClient, run with signature permissions.
  */
-class IpClientSignatureTest : IpClientIntegrationTestCommon() {
+class IpClientIntegrationTest : IpClientIntegrationTestCommon() {
     private val mEnabledFeatures = ArrayMap<String, Boolean>()
 
     override fun makeIIpClient(ifaceName: String, cb: IIpClientCallbacks): IIpClient {
diff --git a/tests/integration/common/android/net/ip/IpClientIntegrationTestCommon.java b/tests/integration/src/android/net/ip/IpClientIntegrationTestCommon.java
similarity index 98%
rename from tests/integration/common/android/net/ip/IpClientIntegrationTestCommon.java
rename to tests/integration/src/android/net/ip/IpClientIntegrationTestCommon.java
index c6c8fcf..78d0bca 100644
--- a/tests/integration/common/android/net/ip/IpClientIntegrationTestCommon.java
+++ b/tests/integration/src/android/net/ip/IpClientIntegrationTestCommon.java
@@ -29,7 +29,6 @@
 import static android.net.dhcp.DhcpPacket.MIN_V6ONLY_WAIT_MS;
 import static android.net.dhcp.DhcpResultsParcelableUtil.fromStableParcelable;
 import static android.net.ip.IpClientLinkObserver.CLAT_PREFIX;
-import static android.net.ip.IpClientLinkObserver.CONFIG_SOCKET_RECV_BUFSIZE;
 import static android.net.ip.IpReachabilityMonitor.MIN_NUD_SOLICIT_NUM;
 import static android.net.ip.IpReachabilityMonitor.NUD_MCAST_RESOLICIT_NUM;
 import static android.net.ip.IpReachabilityMonitor.nudEventTypeToInt;
@@ -553,10 +552,10 @@
     protected abstract void assertIpMemoryNeverStoreNetworkAttributes(String l2Key, long timeout);
 
     protected final boolean testSkipped() {
-        if (!useNetworkStackSignature() && !TestNetworkStackServiceClient.isSupported()) {
-            fail("Device running root tests doesn't support TestNetworkStackServiceClient.");
-        }
-        return !useNetworkStackSignature() && mIsSignatureRequiredTest;
+        // TODO: split out a test suite for root tests, and fail hard instead of skipping the test
+        // if it is run on devices where TestNetworkStackServiceClient is not supported
+        return !useNetworkStackSignature()
+                && (mIsSignatureRequiredTest || !TestNetworkStackServiceClient.isSupported());
     }
 
     protected void setDhcpFeatures(final boolean isDhcpLeaseCacheEnabled,
@@ -633,11 +632,6 @@
         mDependencies.setDeviceConfigProperty(DhcpClient.ARP_PROBE_MAX_MS, 20);
         mDependencies.setDeviceConfigProperty(DhcpClient.ARP_FIRST_ANNOUNCE_DELAY_MS, 10);
         mDependencies.setDeviceConfigProperty(DhcpClient.ARP_ANNOUNCE_INTERVAL_MS, 10);
-
-        // Set the initial netlink socket receive buffer size to a minimum of 10KB to ensure test
-        // cases are still working, meanwhile in order to easily overflow the receive buffer by
-        // sending as few RAs as possible for test case where it's used to verify ENOBUFS.
-        mDependencies.setDeviceConfigProperty(CONFIG_SOCKET_RECV_BUFSIZE, 10 * 1024);
     }
 
     private void awaitIpClientShutdown() throws Exception {
@@ -3770,10 +3764,7 @@
         );
     }
 
-    // Since createTapInterface(boolean, String) method was introduced since T, this method
-    // cannot be found on Q/R/S platform, ignore this test on T- platform.
     @Test
-    @IgnoreUpTo(Build.VERSION_CODES.S_V2)
     public void testIpClientLinkObserver_onClatInterfaceStateUpdate() throws Exception {
         ProvisioningConfiguration config = new ProvisioningConfiguration.Builder()
                 .withoutIPv4()
@@ -3793,46 +3784,4 @@
         removeTestInterface(clatIface.getFileDescriptor().getFileDescriptor());
         verify(mCb, timeout(TEST_TIMEOUT_MS)).setNeighborDiscoveryOffload(true);
     }
-
-    @Test @SignatureRequiredTest(reason = "requires mock callback object")
-    public void testNetlinkSocketReceiveENOBUFS() throws Exception {
-        if (!mIsNetlinkEventParseEnabled) return;
-
-        ProvisioningConfiguration config = new ProvisioningConfiguration.Builder()
-                .withoutIPv4()
-                .build();
-        startIpClientProvisioning(config);
-        doIpv6OnlyProvisioning();
-        HandlerUtils.waitForIdle(mIpc.getHandler(), TEST_TIMEOUT_MS);
-
-        // Block IpClient handler.
-        final CountDownLatch latch = new CountDownLatch(1);
-        mIpc.getHandler().post(() -> {
-            try {
-                latch.await(10_000L /* 10s */, TimeUnit.MILLISECONDS);
-            } catch (InterruptedException e) {
-                // do nothing
-            }
-        });
-
-        // Send large amount of RAs to overflow the netlink socket receive buffer.
-        for (int i = 0; i < 100; i++) {
-            sendBasicRouterAdvertisement(false /* waitRs */);
-        }
-
-        // Unblock the IpClient handler.
-        latch.countDown();
-        HandlerUtils.waitForIdle(mIpc.getHandler(), TEST_TIMEOUT_MS);
-
-        reset(mCb);
-
-        // Send RA with 0 router lifetime to see if IpClient can see the loss of IPv6 default route.
-        // Due to ignoring the ENOBUFS and wait until handler gets idle, IpClient should be still
-        // able to see the RA with 0 router lifetime and the IPv6 default route will be removed.
-        sendRouterAdvertisementWithZeroLifetime();
-        final ArgumentCaptor<LinkProperties> captor = ArgumentCaptor.forClass(LinkProperties.class);
-        verify(mCb, timeout(TEST_TIMEOUT_MS)).onProvisioningFailure(captor.capture());
-        final LinkProperties lp = captor.getValue();
-        assertFalse(lp.hasIpv6DefaultRoute());
-    }
 }
diff --git a/tests/integration/root/android/net/ip/IpClientRootTest.kt b/tests/integration/src/android/net/ip/IpClientRootTest.kt
similarity index 100%
rename from tests/integration/root/android/net/ip/IpClientRootTest.kt
rename to tests/integration/src/android/net/ip/IpClientRootTest.kt
diff --git a/tests/integration/signature/android/net/netlink/InetDiagSocketIntegrationTest.java b/tests/integration/src/android/net/netlink/InetDiagSocketIntegrationTest.java
similarity index 100%
rename from tests/integration/signature/android/net/netlink/InetDiagSocketIntegrationTest.java
rename to tests/integration/src/android/net/netlink/InetDiagSocketIntegrationTest.java
diff --git a/tests/integration/common/android/net/networkstack/TestNetworkStackServiceClient.kt b/tests/integration/src/android/net/networkstack/TestNetworkStackServiceClient.kt
similarity index 99%
rename from tests/integration/common/android/net/networkstack/TestNetworkStackServiceClient.kt
rename to tests/integration/src/android/net/networkstack/TestNetworkStackServiceClient.kt
index 9f5e5e7..47936ac 100644
--- a/tests/integration/common/android/net/networkstack/TestNetworkStackServiceClient.kt
+++ b/tests/integration/src/android/net/networkstack/TestNetworkStackServiceClient.kt
@@ -78,4 +78,4 @@
     fun disconnect() {
         InstrumentationRegistry.getInstrumentation().context.unbindService(serviceConnection)
     }
-}
+}
\ No newline at end of file
diff --git a/tests/integration/signature/android/net/util/NetworkStackUtilsIntegrationTest.kt b/tests/integration/src/android/net/util/NetworkStackUtilsIntegrationTest.kt
similarity index 100%
rename from tests/integration/signature/android/net/util/NetworkStackUtilsIntegrationTest.kt
rename to tests/integration/src/android/net/util/NetworkStackUtilsIntegrationTest.kt