Merge "Add ACTION_VPN_MANAGER_EVENT in ConstantsShim" into tm-dev
diff --git a/Android.bp b/Android.bp
index 7ecfed3..7fcd206 100644
--- a/Android.bp
+++ b/Android.bp
@@ -45,6 +45,10 @@
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
@@ -72,11 +76,12 @@
java_defaults {
name: "NetworkStackReleaseApiLevel",
- sdk_version: "module_31",
+ sdk_version: module_33_version,
min_sdk_version: "29",
- target_sdk_version: "31",
+ target_sdk_version: "33",
libs: [
"framework-connectivity",
+ "framework-connectivity-t",
"framework-statsd",
"framework-wifi",
]
@@ -142,9 +147,6 @@
},
}
-// 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"],
@@ -161,10 +163,6 @@
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"],
@@ -185,6 +183,34 @@
"framework-tethering",
"android.net.ipsec.ike.stubs.module_lib",
],
+ 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"],
}
@@ -194,15 +220,19 @@
// called directly by the networkstack code.
java_library {
name: "NetworkStackApiCurrentShims",
- defaults: ["NetworkStackShimsDefaults", "ConnectivityNextEnableDefaults"],
+ defaults: [
+ "NetworkStackShimsDefaults",
+ "NetworkStackDevApiLevel",
+ "ConnectivityNextEnableDefaults",
+ ],
static_libs: [
"NetworkStackShimsCommon",
"NetworkStackApi29Shims",
"NetworkStackApi30Shims",
"NetworkStackApi31Shims",
"NetworkStackApi33Shims",
+ "NetworkStackApi34Shims",
],
- sdk_version: "module_current",
visibility: [
"//packages/modules/Connectivity/Tethering",
"//packages/modules/Connectivity/service",
@@ -217,15 +247,15 @@
// the networkstack code.
java_library {
name: "NetworkStackApiStableShims",
- defaults: ["NetworkStackShimsDefaults"],
+ defaults: ["NetworkStackShimsDefaults", "NetworkStackReleaseApiLevel"],
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",
diff --git a/apishim/33/com/android/networkstack/apishim/BluetoothPanShimImpl.java b/apishim/33/com/android/networkstack/apishim/api33/BluetoothPanShimImpl.java
similarity index 97%
rename from apishim/33/com/android/networkstack/apishim/BluetoothPanShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/api33/BluetoothPanShimImpl.java
index 990a312..09a3573 100644
--- a/apishim/33/com/android/networkstack/apishim/BluetoothPanShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/BluetoothPanShimImpl.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.apishim;
+package com.android.networkstack.apishim.api33;
import static com.android.modules.utils.build.SdkLevel.isAtLeastT;
diff --git a/apishim/33/com/android/networkstack/apishim/CaptivePortalDataShimImpl.java b/apishim/33/com/android/networkstack/apishim/api33/CaptivePortalDataShimImpl.java
similarity index 96%
rename from apishim/33/com/android/networkstack/apishim/CaptivePortalDataShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/api33/CaptivePortalDataShimImpl.java
index 63fa021..7a4dbba 100644
--- a/apishim/33/com/android/networkstack/apishim/CaptivePortalDataShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/CaptivePortalDataShimImpl.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.apishim;
+package com.android.networkstack.apishim.api33;
import android.net.CaptivePortalData;
import android.os.Build;
diff --git a/apishim/33/com/android/networkstack/apishim/ConnectivityFrameworkInitShimImpl.java b/apishim/33/com/android/networkstack/apishim/api33/ConnectivityFrameworkInitShimImpl.java
similarity index 96%
rename from apishim/33/com/android/networkstack/apishim/ConnectivityFrameworkInitShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/api33/ConnectivityFrameworkInitShimImpl.java
index 2fc4ca1..a97e717 100644
--- a/apishim/33/com/android/networkstack/apishim/ConnectivityFrameworkInitShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/ConnectivityFrameworkInitShimImpl.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.apishim;
+package com.android.networkstack.apishim.api33;
import android.net.ConnectivityFrameworkInitializerTiramisu;
import android.os.Build;
diff --git a/apishim/33/com/android/networkstack/apishim/ConnectivityManagerShimImpl.java b/apishim/33/com/android/networkstack/apishim/api33/ConnectivityManagerShimImpl.java
similarity index 95%
rename from apishim/33/com/android/networkstack/apishim/ConnectivityManagerShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/api33/ConnectivityManagerShimImpl.java
index 7675960..1cb36ae 100644
--- a/apishim/33/com/android/networkstack/apishim/ConnectivityManagerShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/ConnectivityManagerShimImpl.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.apishim;
+package com.android.networkstack.apishim.api33;
import android.content.Context;
import android.os.Build;
diff --git a/apishim/33/com/android/networkstack/apishim/ConstantsShim.java b/apishim/33/com/android/networkstack/apishim/api33/ConstantsShim.java
similarity index 95%
rename from apishim/33/com/android/networkstack/apishim/ConstantsShim.java
rename to apishim/33/com/android/networkstack/apishim/api33/ConstantsShim.java
index 6d146f5..227b60c 100644
--- a/apishim/33/com/android/networkstack/apishim/ConstantsShim.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/ConstantsShim.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.apishim;
+package com.android.networkstack.apishim.api33;
import androidx.annotation.VisibleForTesting;
diff --git a/apishim/33/com/android/networkstack/apishim/EthernetManagerShimImpl.java b/apishim/33/com/android/networkstack/apishim/api33/EthernetManagerShimImpl.java
similarity index 98%
rename from apishim/33/com/android/networkstack/apishim/EthernetManagerShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/api33/EthernetManagerShimImpl.java
index 82a8f35..5bd6487 100644
--- a/apishim/33/com/android/networkstack/apishim/EthernetManagerShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/EthernetManagerShimImpl.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.apishim;
+package com.android.networkstack.apishim.api33;
import static com.android.modules.utils.build.SdkLevel.isAtLeastT;
diff --git a/apishim/33/com/android/networkstack/apishim/Ikev2VpnProfileBuilderShimImpl.java b/apishim/33/com/android/networkstack/apishim/api33/Ikev2VpnProfileBuilderShimImpl.java
similarity index 96%
rename from apishim/33/com/android/networkstack/apishim/Ikev2VpnProfileBuilderShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/api33/Ikev2VpnProfileBuilderShimImpl.java
index 634b6b5..f8c92ee 100644
--- a/apishim/33/com/android/networkstack/apishim/Ikev2VpnProfileBuilderShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/Ikev2VpnProfileBuilderShimImpl.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.apishim;
+package com.android.networkstack.apishim.api33;
import android.net.Ikev2VpnProfile;
import android.net.ipsec.ike.IkeTunnelConnectionParams;
@@ -32,7 +32,7 @@
@RequiresApi(Build.VERSION_CODES.TIRAMISU)
public class Ikev2VpnProfileBuilderShimImpl
extends com.android.networkstack.apishim.api31.Ikev2VpnProfileBuilderShimImpl {
- private Ikev2VpnProfileBuilderShimImpl(@Nullable String serverAddr,
+ protected Ikev2VpnProfileBuilderShimImpl(@Nullable String serverAddr,
@Nullable String identity, @Nullable Object params) {
super(serverAddr, identity, params);
diff --git a/apishim/33/com/android/networkstack/apishim/Ikev2VpnProfileShimImpl.java b/apishim/33/com/android/networkstack/apishim/api33/Ikev2VpnProfileShimImpl.java
similarity index 96%
rename from apishim/33/com/android/networkstack/apishim/Ikev2VpnProfileShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/api33/Ikev2VpnProfileShimImpl.java
index c3e35d3..e846a64 100644
--- a/apishim/33/com/android/networkstack/apishim/Ikev2VpnProfileShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/Ikev2VpnProfileShimImpl.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.apishim;
+package com.android.networkstack.apishim.api33;
import android.net.Ikev2VpnProfile;
import android.os.Build;
diff --git a/apishim/33/com/android/networkstack/apishim/NetworkAgentConfigShimImpl.java b/apishim/33/com/android/networkstack/apishim/api33/NetworkAgentConfigShimImpl.java
similarity index 97%
rename from apishim/33/com/android/networkstack/apishim/NetworkAgentConfigShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/api33/NetworkAgentConfigShimImpl.java
index 912b721..ee7f026 100644
--- a/apishim/33/com/android/networkstack/apishim/NetworkAgentConfigShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/NetworkAgentConfigShimImpl.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.apishim;
+package com.android.networkstack.apishim.api33;
import static com.android.modules.utils.build.SdkLevel.isAtLeastT;
diff --git a/apishim/33/com/android/networkstack/apishim/NetworkInformationShimImpl.java b/apishim/33/com/android/networkstack/apishim/api33/NetworkInformationShimImpl.java
similarity index 97%
rename from apishim/33/com/android/networkstack/apishim/NetworkInformationShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/api33/NetworkInformationShimImpl.java
index 46ba098..5d6ada1 100644
--- a/apishim/33/com/android/networkstack/apishim/NetworkInformationShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/NetworkInformationShimImpl.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.apishim;
+package com.android.networkstack.apishim.api33;
import static com.android.modules.utils.build.SdkLevel.isAtLeastT;
diff --git a/apishim/33/com/android/networkstack/apishim/NetworkRequestShimImpl.java b/apishim/33/com/android/networkstack/apishim/api33/NetworkRequestShimImpl.java
similarity index 95%
rename from apishim/33/com/android/networkstack/apishim/NetworkRequestShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/api33/NetworkRequestShimImpl.java
index 72dfef2..a73d6a1 100644
--- a/apishim/33/com/android/networkstack/apishim/NetworkRequestShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/NetworkRequestShimImpl.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.apishim;
+package com.android.networkstack.apishim.api33;
import android.os.Build;
diff --git a/apishim/33/com/android/networkstack/apishim/NetworkShimImpl.java b/apishim/33/com/android/networkstack/apishim/api33/NetworkShimImpl.java
similarity index 95%
rename from apishim/33/com/android/networkstack/apishim/NetworkShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/api33/NetworkShimImpl.java
index 0968c4c..d084c01 100644
--- a/apishim/33/com/android/networkstack/apishim/NetworkShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/NetworkShimImpl.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.apishim;
+package com.android.networkstack.apishim.api33;
import android.net.Network;
import android.os.Build;
diff --git a/apishim/33/com/android/networkstack/apishim/NsdShimImpl.java b/apishim/33/com/android/networkstack/apishim/api33/NsdShimImpl.java
similarity index 98%
rename from apishim/33/com/android/networkstack/apishim/NsdShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/api33/NsdShimImpl.java
index 2f13397..1f0907f 100644
--- a/apishim/33/com/android/networkstack/apishim/NsdShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/NsdShimImpl.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.apishim;
+package com.android.networkstack.apishim.api33;
import android.net.Network;
import android.net.NetworkRequest;
diff --git a/apishim/33/com/android/networkstack/apishim/ProcessShimImpl.java b/apishim/33/com/android/networkstack/apishim/api33/ProcessShimImpl.java
similarity index 96%
rename from apishim/33/com/android/networkstack/apishim/ProcessShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/api33/ProcessShimImpl.java
index 882dfbf..a6c282e 100644
--- a/apishim/33/com/android/networkstack/apishim/ProcessShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/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;
+package com.android.networkstack.apishim.api33;
import android.os.Build;
import android.os.Process;
diff --git a/apishim/33/com/android/networkstack/apishim/SettingsShimImpl.java b/apishim/33/com/android/networkstack/apishim/api33/SettingsShimImpl.java
similarity index 95%
rename from apishim/33/com/android/networkstack/apishim/SettingsShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/api33/SettingsShimImpl.java
index cd3a463..113b013 100644
--- a/apishim/33/com/android/networkstack/apishim/SettingsShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/SettingsShimImpl.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.apishim;
+package com.android.networkstack.apishim.api33;
import android.os.Build;
diff --git a/apishim/33/com/android/networkstack/apishim/SocketUtilsShimImpl.java b/apishim/33/com/android/networkstack/apishim/api33/SocketUtilsShimImpl.java
similarity index 95%
rename from apishim/33/com/android/networkstack/apishim/SocketUtilsShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/api33/SocketUtilsShimImpl.java
index d4ab534..1da7ea2 100644
--- a/apishim/33/com/android/networkstack/apishim/SocketUtilsShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/SocketUtilsShimImpl.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.apishim;
+package com.android.networkstack.apishim.api33;
import android.os.Build;
diff --git a/apishim/33/com/android/networkstack/apishim/TelephonyManagerShimImpl.java b/apishim/33/com/android/networkstack/apishim/api33/TelephonyManagerShimImpl.java
similarity index 98%
rename from apishim/33/com/android/networkstack/apishim/TelephonyManagerShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/api33/TelephonyManagerShimImpl.java
index af481b6..473db91 100644
--- a/apishim/33/com/android/networkstack/apishim/TelephonyManagerShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/TelephonyManagerShimImpl.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.apishim;
+package com.android.networkstack.apishim.api33;
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/VpnManagerShimImpl.java b/apishim/33/com/android/networkstack/apishim/api33/VpnManagerShimImpl.java
similarity index 97%
rename from apishim/33/com/android/networkstack/apishim/VpnManagerShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/api33/VpnManagerShimImpl.java
index ffd3da3..37a58df 100644
--- a/apishim/33/com/android/networkstack/apishim/VpnManagerShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/VpnManagerShimImpl.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.apishim;
+package com.android.networkstack.apishim.api33;
import static com.android.modules.utils.build.SdkLevel.isAtLeastT;
diff --git a/apishim/33/com/android/networkstack/apishim/VpnProfileStateShimImpl.java b/apishim/33/com/android/networkstack/apishim/api33/VpnProfileStateShimImpl.java
similarity index 97%
rename from apishim/33/com/android/networkstack/apishim/VpnProfileStateShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/api33/VpnProfileStateShimImpl.java
index 7c61b02..4521364 100644
--- a/apishim/33/com/android/networkstack/apishim/VpnProfileStateShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/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;
+package com.android.networkstack.apishim.api33;
import android.net.VpnProfileState;
import android.os.Build;
diff --git a/apishim/33/com/android/networkstack/apishim/VpnServiceBuilderShimImpl.java b/apishim/33/com/android/networkstack/apishim/api33/VpnServiceBuilderShimImpl.java
similarity index 97%
rename from apishim/33/com/android/networkstack/apishim/VpnServiceBuilderShimImpl.java
rename to apishim/33/com/android/networkstack/apishim/api33/VpnServiceBuilderShimImpl.java
index da8f774..464da3c 100644
--- a/apishim/33/com/android/networkstack/apishim/VpnServiceBuilderShimImpl.java
+++ b/apishim/33/com/android/networkstack/apishim/api33/VpnServiceBuilderShimImpl.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.apishim;
+package com.android.networkstack.apishim.api33;
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
new file mode 100644
index 0000000..94c3d38
--- /dev/null
+++ b/apishim/34/com/android/networkstack/apishim/BluetoothPanShimImpl.java
@@ -0,0 +1,35 @@
+/*
+ * 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/33/com/android/networkstack/apishim/CaptivePortalDataShimImpl.java b/apishim/34/com/android/networkstack/apishim/CaptivePortalDataShimImpl.java
similarity index 76%
copy from apishim/33/com/android/networkstack/apishim/CaptivePortalDataShimImpl.java
copy to apishim/34/com/android/networkstack/apishim/CaptivePortalDataShimImpl.java
index 63fa021..94814aa 100644
--- a/apishim/33/com/android/networkstack/apishim/CaptivePortalDataShimImpl.java
+++ b/apishim/34/com/android/networkstack/apishim/CaptivePortalDataShimImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * 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.
@@ -27,10 +27,11 @@
/**
* Compatibility implementation of {@link CaptivePortalDataShim}.
*/
-@RequiresApi(Build.VERSION_CODES.TIRAMISU)
+// 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.api31.CaptivePortalDataShimImpl {
- // Currently identical to the API 31 shim, so inherit everything
+ 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
new file mode 100644
index 0000000..a343b67
--- /dev/null
+++ b/apishim/34/com/android/networkstack/apishim/ConnectivityFrameworkInitShimImpl.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;
+
+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/33/com/android/networkstack/apishim/ConnectivityManagerShimImpl.java b/apishim/34/com/android/networkstack/apishim/ConnectivityManagerShimImpl.java
similarity index 75%
copy from apishim/33/com/android/networkstack/apishim/ConnectivityManagerShimImpl.java
copy to apishim/34/com/android/networkstack/apishim/ConnectivityManagerShimImpl.java
index 7675960..7f6ad39 100644
--- a/apishim/33/com/android/networkstack/apishim/ConnectivityManagerShimImpl.java
+++ b/apishim/34/com/android/networkstack/apishim/ConnectivityManagerShimImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * 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.
@@ -26,10 +26,11 @@
/**
* Compatibility implementation of {@link ConnectivityManagerShim}.
*/
-@RequiresApi(Build.VERSION_CODES.TIRAMISU)
+// 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.api31.ConnectivityManagerShimImpl {
- // Currently identical to the API 31 shim, so inherit everything
+ 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/33/com/android/networkstack/apishim/ConstantsShim.java b/apishim/34/com/android/networkstack/apishim/ConstantsShim.java
similarity index 77%
copy from apishim/33/com/android/networkstack/apishim/ConstantsShim.java
copy to apishim/34/com/android/networkstack/apishim/ConstantsShim.java
index 6d146f5..9df84d5 100644
--- a/apishim/33/com/android/networkstack/apishim/ConstantsShim.java
+++ b/apishim/34/com/android/networkstack/apishim/ConstantsShim.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * 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.
@@ -16,12 +16,17 @@
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.
*/
-public class ConstantsShim extends com.android.networkstack.apishim.api31.ConstantsShim {
+// 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.
@@ -29,5 +34,5 @@
* the shimmed objects and methods themselves.
*/
@VisibleForTesting
- public static final int VERSION = 33;
+ public static final int VERSION = 34;
}
diff --git a/apishim/34/com/android/networkstack/apishim/EthernetManagerShimImpl.java b/apishim/34/com/android/networkstack/apishim/EthernetManagerShimImpl.java
new file mode 100644
index 0000000..e9a33a1
--- /dev/null
+++ b/apishim/34/com/android/networkstack/apishim/EthernetManagerShimImpl.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;
+
+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 34.
+ */
+// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
+@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
+public class EthernetManagerShimImpl
+ extends com.android.networkstack.apishim.api33.EthernetManagerShimImpl {
+ protected EthernetManagerShimImpl(Context context) {
+ super(context);
+ }
+}
diff --git a/apishim/34/com/android/networkstack/apishim/Ikev2VpnProfileBuilderShimImpl.java b/apishim/34/com/android/networkstack/apishim/Ikev2VpnProfileBuilderShimImpl.java
new file mode 100644
index 0000000..305f469
--- /dev/null
+++ b/apishim/34/com/android/networkstack/apishim/Ikev2VpnProfileBuilderShimImpl.java
@@ -0,0 +1,35 @@
+/*
+ * 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.Nullable;
+import androidx.annotation.RequiresApi;
+
+/**
+ * A shim for Ikev2VpnProfile.Builder
+ */
+// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
+@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
+public class Ikev2VpnProfileBuilderShimImpl
+ extends com.android.networkstack.apishim.api33.Ikev2VpnProfileBuilderShimImpl {
+ protected Ikev2VpnProfileBuilderShimImpl(@Nullable String serverAddr,
+ @Nullable String identity, @Nullable Object params) {
+ super(serverAddr, identity, params);
+ }
+}
diff --git a/apishim/33/com/android/networkstack/apishim/Ikev2VpnProfileShimImpl.java b/apishim/34/com/android/networkstack/apishim/Ikev2VpnProfileShimImpl.java
similarity index 65%
copy from apishim/33/com/android/networkstack/apishim/Ikev2VpnProfileShimImpl.java
copy to apishim/34/com/android/networkstack/apishim/Ikev2VpnProfileShimImpl.java
index c3e35d3..c6c3ac9 100644
--- a/apishim/33/com/android/networkstack/apishim/Ikev2VpnProfileShimImpl.java
+++ b/apishim/34/com/android/networkstack/apishim/Ikev2VpnProfileShimImpl.java
@@ -24,26 +24,11 @@
/**
* A shim for Ikev2VpnProfile
*/
-@RequiresApi(Build.VERSION_CODES.TIRAMISU)
+// TODO: when available in all active branches: @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
+@RequiresApi(Build.VERSION_CODES.CUR_DEVELOPMENT)
public class Ikev2VpnProfileShimImpl
- extends com.android.networkstack.apishim.api31.Ikev2VpnProfileShimImpl {
+ extends com.android.networkstack.apishim.api33.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/34/com/android/networkstack/apishim/NetworkAgentConfigShimImpl.java b/apishim/34/com/android/networkstack/apishim/NetworkAgentConfigShimImpl.java
new file mode 100644
index 0000000..4d8ede2
--- /dev/null
+++ b/apishim/34/com/android/networkstack/apishim/NetworkAgentConfigShimImpl.java
@@ -0,0 +1,35 @@
+/*
+ * 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
new file mode 100644
index 0000000..b8905e8
--- /dev/null
+++ b/apishim/34/com/android/networkstack/apishim/NetworkInformationShimImpl.java
@@ -0,0 +1,33 @@
+/*
+ * 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/33/com/android/networkstack/apishim/NetworkRequestShimImpl.java b/apishim/34/com/android/networkstack/apishim/NetworkRequestShimImpl.java
similarity index 69%
copy from apishim/33/com/android/networkstack/apishim/NetworkRequestShimImpl.java
copy to apishim/34/com/android/networkstack/apishim/NetworkRequestShimImpl.java
index 72dfef2..61c9d09 100644
--- a/apishim/33/com/android/networkstack/apishim/NetworkRequestShimImpl.java
+++ b/apishim/34/com/android/networkstack/apishim/NetworkRequestShimImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * 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.
@@ -23,12 +23,13 @@
import com.android.networkstack.apishim.common.NetworkRequestShim;
/**
- * Implementation of {@link NetworkRequestShim} for API 33.
+ * Implementation of {@link NetworkRequestShim} for API 34.
*/
-@RequiresApi(Build.VERSION_CODES.TIRAMISU)
+// 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.api31.NetworkRequestShimImpl {
- // Currently identical to the API 31 shim, so inherit everything
+ extends com.android.networkstack.apishim.api33.NetworkRequestShimImpl {
+ // Currently identical to the API 33 shim, so inherit everything
protected NetworkRequestShimImpl() {
super();
}
diff --git a/apishim/33/com/android/networkstack/apishim/NetworkShimImpl.java b/apishim/34/com/android/networkstack/apishim/NetworkShimImpl.java
similarity index 77%
copy from apishim/33/com/android/networkstack/apishim/NetworkShimImpl.java
copy to apishim/34/com/android/networkstack/apishim/NetworkShimImpl.java
index 0968c4c..683d1eb 100644
--- a/apishim/33/com/android/networkstack/apishim/NetworkShimImpl.java
+++ b/apishim/34/com/android/networkstack/apishim/NetworkShimImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * 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.
@@ -25,9 +25,10 @@
/**
* Compatibility implementation of {@link com.android.networkstack.apishim.common.NetworkShim}.
*/
-@RequiresApi(Build.VERSION_CODES.TIRAMISU)
-public class NetworkShimImpl extends com.android.networkstack.apishim.api30.NetworkShimImpl {
- // Currently, this is the same as the API 31 shim, so inherit everything from that.
+// 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/33/com/android/networkstack/apishim/SocketUtilsShimImpl.java b/apishim/34/com/android/networkstack/apishim/NsdShimImpl.java
similarity index 61%
copy from apishim/33/com/android/networkstack/apishim/SocketUtilsShimImpl.java
copy to apishim/34/com/android/networkstack/apishim/NsdShimImpl.java
index d4ab534..c7b2b7a 100644
--- a/apishim/33/com/android/networkstack/apishim/SocketUtilsShimImpl.java
+++ b/apishim/34/com/android/networkstack/apishim/NsdShimImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * 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.
@@ -20,12 +20,13 @@
import androidx.annotation.RequiresApi;
+import com.android.networkstack.apishim.common.NsdShim;
+
/**
- * Implementation of {@link com.android.networkstack.apishim.common.SocketUtilsShim}.
+ * Implementation of {@link NsdShim}.
*/
-@RequiresApi(Build.VERSION_CODES.TIRAMISU)
-public class SocketUtilsShimImpl
- extends com.android.networkstack.apishim.api30.SocketUtilsShimImpl {
- // Currently, this is the same as the API 31 shim, so inherit everything from that.
- protected SocketUtilsShimImpl() {}
+// 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/33/com/android/networkstack/apishim/SocketUtilsShimImpl.java b/apishim/34/com/android/networkstack/apishim/ProcessShimImpl.java
similarity index 60%
copy from apishim/33/com/android/networkstack/apishim/SocketUtilsShimImpl.java
copy to apishim/34/com/android/networkstack/apishim/ProcessShimImpl.java
index d4ab534..460ed46 100644
--- a/apishim/33/com/android/networkstack/apishim/SocketUtilsShimImpl.java
+++ b/apishim/34/com/android/networkstack/apishim/ProcessShimImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * 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.
@@ -13,19 +13,17 @@
* 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}.
- */
-@RequiresApi(Build.VERSION_CODES.TIRAMISU)
-public class SocketUtilsShimImpl
- extends com.android.networkstack.apishim.api30.SocketUtilsShimImpl {
- // Currently, this is the same as the API 31 shim, so inherit everything from that.
- protected SocketUtilsShimImpl() {}
+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/33/com/android/networkstack/apishim/SettingsShimImpl.java b/apishim/34/com/android/networkstack/apishim/SettingsShimImpl.java
similarity index 72%
copy from apishim/33/com/android/networkstack/apishim/SettingsShimImpl.java
copy to apishim/34/com/android/networkstack/apishim/SettingsShimImpl.java
index cd3a463..aa12005 100644
--- a/apishim/33/com/android/networkstack/apishim/SettingsShimImpl.java
+++ b/apishim/34/com/android/networkstack/apishim/SettingsShimImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * 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.
@@ -23,11 +23,12 @@
import com.android.networkstack.apishim.common.SettingsShim;
/**
- * Compatibility implementation of {@link SettingsShim} for API 33.
+ * Compatibility implementation of {@link SettingsShim} for API 34.
*/
-@RequiresApi(Build.VERSION_CODES.TIRAMISU)
+// 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.api30.SettingsShimImpl {
- // Currently identical to the API 31 shim, so inherit everything
+ extends com.android.networkstack.apishim.api33.SettingsShimImpl {
+ // Currently identical to the API 33 shim, so inherit everything
protected SettingsShimImpl() { }
}
diff --git a/apishim/33/com/android/networkstack/apishim/SocketUtilsShimImpl.java b/apishim/34/com/android/networkstack/apishim/SocketUtilsShimImpl.java
similarity index 72%
copy from apishim/33/com/android/networkstack/apishim/SocketUtilsShimImpl.java
copy to apishim/34/com/android/networkstack/apishim/SocketUtilsShimImpl.java
index d4ab534..ca7b64c 100644
--- a/apishim/33/com/android/networkstack/apishim/SocketUtilsShimImpl.java
+++ b/apishim/34/com/android/networkstack/apishim/SocketUtilsShimImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * 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.
@@ -23,9 +23,10 @@
/**
* Implementation of {@link com.android.networkstack.apishim.common.SocketUtilsShim}.
*/
-@RequiresApi(Build.VERSION_CODES.TIRAMISU)
+// 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.api30.SocketUtilsShimImpl {
- // Currently, this is the same as the API 31 shim, so inherit everything from that.
+ 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
new file mode 100644
index 0000000..ed81f52
--- /dev/null
+++ b/apishim/34/com/android/networkstack/apishim/TelephonyManagerShimImpl.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;
+
+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/33/com/android/networkstack/apishim/ConnectivityManagerShimImpl.java b/apishim/34/com/android/networkstack/apishim/VpnManagerShimImpl.java
similarity index 60%
copy from apishim/33/com/android/networkstack/apishim/ConnectivityManagerShimImpl.java
copy to apishim/34/com/android/networkstack/apishim/VpnManagerShimImpl.java
index 7675960..d7f6280 100644
--- a/apishim/33/com/android/networkstack/apishim/ConnectivityManagerShimImpl.java
+++ b/apishim/34/com/android/networkstack/apishim/VpnManagerShimImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * 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.
@@ -21,16 +21,15 @@
import androidx.annotation.RequiresApi;
-import com.android.networkstack.apishim.common.ConnectivityManagerShim;
+import com.android.networkstack.apishim.common.VpnManagerShim;
/**
- * Compatibility implementation of {@link ConnectivityManagerShim}.
+ * Compatibility implementation of {@link VpnManagerShim}.
*/
-@RequiresApi(Build.VERSION_CODES.TIRAMISU)
-public class ConnectivityManagerShimImpl
- extends com.android.networkstack.apishim.api31.ConnectivityManagerShimImpl {
- // Currently identical to the API 31 shim, so inherit everything
- protected ConnectivityManagerShimImpl(Context context) {
+// 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
new file mode 100644
index 0000000..23f346d
--- /dev/null
+++ b/apishim/34/com/android/networkstack/apishim/VpnProfileStateShimImpl.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;
+
+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
new file mode 100644
index 0000000..b78a77b
--- /dev/null
+++ b/apishim/34/com/android/networkstack/apishim/VpnServiceBuilderShimImpl.java
@@ -0,0 +1,33 @@
+/*
+ * 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/jarjar-rules-compat.txt b/apishim/jarjar-rules-compat.txt
index 4f34ccb..09fa04d 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 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
+# 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
diff --git a/src/android/net/ip/IpClientLinkObserver.java b/src/android/net/ip/IpClientLinkObserver.java
index b1dbabd..f0126e6 100644
--- a/src/android/net/ip/IpClientLinkObserver.java
+++ b/src/android/net/ip/IpClientLinkObserver.java
@@ -21,6 +21,7 @@
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;
@@ -203,7 +204,7 @@
private boolean isNetlinkEventParsingEnabled() {
return mDependencies.isFeatureEnabled(mContext, IPCLIENT_PARSE_NETLINK_EVENTS_VERSION,
- false /* default value */);
+ isAtLeastT() /* default value */);
}
@Override
diff --git a/tests/unit/src/android/net/testutils/DeviceInfoUtilsTest.java b/tests/unit/src/android/net/testutils/DeviceInfoUtilsTest.java
new file mode 100644
index 0000000..f99700a
--- /dev/null
+++ b/tests/unit/src/android/net/testutils/DeviceInfoUtilsTest.java
@@ -0,0 +1,45 @@
+/*
+ * 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.testutils;
+
+import static org.junit.Assert.assertEquals;
+
+import androidx.test.filters.SmallTest;
+
+import org.junit.Test;
+
+@SmallTest
+public final class DeviceInfoUtilsTest {
+ /**
+ * Verifies that version string compare logic returns expected result for various cases.
+ * Note that only major and minor number are compared.
+ */
+ @Test
+ public void testMajorMinorVersionCompare() {
+ assertEquals(0, DeviceInfoUtils.compareMajorMinorVersion("4.8.1", "4.8"));
+ assertEquals(1, DeviceInfoUtils.compareMajorMinorVersion("4.9", "4.8.1"));
+ assertEquals(1, DeviceInfoUtils.compareMajorMinorVersion("5.0", "4.8"));
+ assertEquals(1, DeviceInfoUtils.compareMajorMinorVersion("5", "4.8"));
+ assertEquals(0, DeviceInfoUtils.compareMajorMinorVersion("5", "5.0"));
+ assertEquals(1, DeviceInfoUtils.compareMajorMinorVersion("5-beta1", "4.8"));
+ assertEquals(0, DeviceInfoUtils.compareMajorMinorVersion("4.8.0.0", "4.8"));
+ assertEquals(0, DeviceInfoUtils.compareMajorMinorVersion("4.8-RC1", "4.8"));
+ assertEquals(0, DeviceInfoUtils.compareMajorMinorVersion("4.8", "4.8"));
+ assertEquals(-1, DeviceInfoUtils.compareMajorMinorVersion("3.10", "4.8.0"));
+ assertEquals(-1, DeviceInfoUtils.compareMajorMinorVersion("4.7.10.10", "4.8"));
+ }
+}