Merge "Set last probing time to always evaluate stall" am: 8f53706325 am: 0d7d2be276 am: 293996cc16
Original change: https://android-review.googlesource.com/c/platform/packages/modules/NetworkStack/+/1684386
Change-Id: Id392696df5b67fc4fc42b03e37f3d43952e70994
diff --git a/Android.bp b/Android.bp
index 8e5b168..a0ca937 100644
--- a/Android.bp
+++ b/Android.bp
@@ -45,10 +45,6 @@
default_applicable_licenses: ["Android-Apache-2.0"],
}
-// Whether to enable the targets in this file that target current SDKs.
-// Set to false in branches like mainline-prod where API classes are too old to build current code.
-enable_current_sdk_targets = false
-
java_defaults {
name: "NetworkStackDevApiLevel",
min_sdk_version: "29",
@@ -124,7 +120,6 @@
// integer so if the next SDK release happens to use that integer, we don't need to rename them.
java_library {
name: "NetworkStackApi31Shims",
- enabled: enable_current_sdk_targets,
defaults: ["NetworkStackShimsDefaults"],
srcs: [
"apishim/31/**/*.java",
@@ -144,7 +139,6 @@
// called directly by the networkstack code.
java_library {
name: "NetworkStackApiCurrentShims",
- enabled: enable_current_sdk_targets,
defaults: ["NetworkStackShimsDefaults"],
static_libs: [
"NetworkStackShimsCommon",
@@ -212,7 +206,6 @@
],
static_libs: ["NetworkStackApiCurrentShims"],
manifest: "AndroidManifestBase.xml",
- enabled: enable_current_sdk_targets,
visibility: [
"//frameworks/base/tests/net/integration",
"//packages/modules/Connectivity/Tethering/tests/integration",
@@ -286,7 +279,6 @@
// The InProcessNetworkStack goes together with the PlatformCaptivePortalLogin, which replaces
// the default CaptivePortalLogin.
required: ["PlatformNetworkPermissionConfig", "PlatformCaptivePortalLogin"],
- enabled: enable_current_sdk_targets,
}
// Pre-merge the AndroidManifest for NetworkStackNext, so that its manifest can be merged on top
@@ -294,8 +286,7 @@
name: "NetworkStackNextManifestBase",
defaults: ["NetworkStackAppDefaults", "NetworkStackDevApiLevel"],
static_libs: ["NetworkStackApiCurrentLib"],
- manifest: "AndroidManifest.xml",
- enabled: enable_current_sdk_targets,
+ manifest: "AndroidManifest.xml"
}
// NetworkStack build targeting the current API release, for testing on in-development SDK
@@ -307,7 +298,6 @@
manifest: "AndroidManifest_Next.xml",
// The permission configuration *must* be included to ensure security of the device
required: ["NetworkPermissionConfig"],
- enabled: enable_current_sdk_targets,
}
// Updatable network stack for finalized API
diff --git a/AndroidManifest_Next.xml b/AndroidManifest_Next.xml
index 02fcb64..c8fdcac 100644
--- a/AndroidManifest_Next.xml
+++ b/AndroidManifest_Next.xml
@@ -17,6 +17,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.networkstack"
android:sharedUserId="android.uid.networkstack"
- android:versionCode="300000000"
- android:versionName="R-next">
+ android:versionCode="310000000"
+ android:versionName="S-next">
</manifest>
diff --git a/TEST_MAPPING b/TEST_MAPPING
index ed6a1a8..2bb0e61 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -40,7 +40,8 @@
// We must specify at least one module here or the tests won't run. Use the same set as CTS
// so in theory the infra would not need to reinstall/reboot devices to run both.
{
- "name": "NetworkStackTests[CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex]"
+ // TODO: add back tethering when it is updatable in this branch
+ "name": "NetworkStackTests[CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex]"
}
],
"mainline-postsubmit": [
diff --git a/common/moduleutils/Android.bp b/common/moduleutils/Android.bp
index 5d1c9e3..57829cf 100644
--- a/common/moduleutils/Android.bp
+++ b/common/moduleutils/Android.bp
@@ -39,6 +39,8 @@
],
visibility: [
"//frameworks/base/services/net",
+ "//frameworks/base/packages/Connectivity/service",
+ "//packages/modules/Connectivity/service",
]
}
diff --git a/common/networkstackclient/Android.bp b/common/networkstackclient/Android.bp
index 96ff315..633424d 100644
--- a/common/networkstackclient/Android.bp
+++ b/common/networkstackclient/Android.bp
@@ -160,10 +160,10 @@
"networkstack-aidl-interfaces-V10-java",
],
visibility: [
- "//frameworks/base/packages/Tethering",
+ "//frameworks/base/packages/Connectivity/service",
"//packages/modules/Connectivity/Tethering",
+ "//packages/modules/Connectivity/service",
"//frameworks/base/services/net",
- "//frameworks/opt/net/wifi/service",
"//packages/modules/NetworkStack",
],
apex_available: [
diff --git a/lint-baseline-current-lib.xml b/lint-baseline-current-lib.xml
index f7b00f2..e8cfe3e 100644
--- a/lint-baseline-current-lib.xml
+++ b/lint-baseline-current-lib.xml
@@ -3,83 +3,6 @@
<issue
id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#addressAndPortToString`"
- errorLine1=" ConnectivityUtils.addressAndPortToString("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/android/net/apf/ApfFilter.java"
- line="1032"
- column="43"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#addressAndPortToString`"
- errorLine1=" ConnectivityUtils.addressAndPortToString("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/android/net/apf/ApfFilter.java"
- line="1034"
- column="43"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#addressAndPortToString`"
- errorLine1=" ConnectivityUtils.addressAndPortToString("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/android/net/apf/ApfFilter.java"
- line="1087"
- column="43"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#addressAndPortToString`"
- errorLine1=" ConnectivityUtils.addressAndPortToString("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/android/net/apf/ApfFilter.java"
- line="1089"
- column="43"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.CollectionUtils#any`"
- errorLine1=" final boolean haveKeepaliveResponses = CollectionUtils.any(mKeepalivePackets,"
- errorLine2=" ~~~">
- <location
- file="packages/modules/NetworkStack/src/android/net/apf/ApfFilter.java"
- line="1368"
- column="64"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.CollectionUtils#toIntArray`"
- errorLine1=" CollectionUtils.toIntArray(mDnsReturnCode),"
- errorLine2=" ~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/networkstack/metrics/DataStallDetectionStats.java"
- line="302"
- column="37"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.CollectionUtils#toLongArray`"
- errorLine1=" CollectionUtils.toLongArray(mDnsTimeStamp),"
- errorLine2=" ~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/networkstack/metrics/DataStallDetectionStats.java"
- line="303"
- column="37"/>
- </issue>
-
- <issue
- id="NewApi"
message="Call requires API level R (current min is 29): `android.net.LinkProperties#getNat64Prefix`"
errorLine1=" newLp.setNat64Prefix(netlinkLinkProperties.getNat64Prefix());"
errorLine2=" ~~~~~~~~~~~~~~">
@@ -102,50 +25,6 @@
<issue
id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#saturatedCast`"
- errorLine1=" mStatsBuilder.setIpv4LatencyMicros(ConnectivityUtils.saturatedCast(mIpv4Watch.stop()));"
- errorLine2=" ~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/networkstack/metrics/IpProvisioningMetrics.java"
- line="74"
- column="66"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#saturatedCast`"
- errorLine1=" mStatsBuilder.setIpv6LatencyMicros(ConnectivityUtils.saturatedCast(mIpv6Watch.stop()));"
- errorLine2=" ~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/networkstack/metrics/IpProvisioningMetrics.java"
- line="83"
- column="66"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.CollectionUtils#isEmpty`"
- errorLine1=" if (isEmpty(mCaptivePortalFallbackSpecs)) {"
- errorLine2=" ~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java"
- line="2279"
- column="13"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#isIPv6ULA`"
- errorLine1=" || isIPv6ULA(address)) {"
- errorLine2=" ~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java"
- line="2447"
- column="24"/>
- </issue>
-
- <issue
- id="NewApi"
message="Call requires API level R (current min is 29): `android.telephony.NetworkRegistrationInfo#getCellIdentity`"
errorLine1=" nri == null ? null : nri.getCellIdentity());"
errorLine2=" ~~~~~~~~~~~~~~~">
@@ -155,48 +34,4 @@
column="46"/>
</issue>
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#saturatedCast`"
- errorLine1=" int latencyUs = ConnectivityUtils.saturatedCast(durationUs);"
- errorLine2=" ~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkValidationMetrics.java"
- line="198"
- column="43"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#saturatedCast`"
- errorLine1=" .setRemainingTtlSecs(ConnectivityUtils.saturatedCast(secondsRemaining))"
- errorLine2=" ~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkValidationMetrics.java"
- line="209"
- column="56"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#saturatedCast`"
- errorLine1=" ConnectivityUtils.saturatedCast(capportData.getByteLimit() / 1000))"
- errorLine2=" ~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkValidationMetrics.java"
- line="212"
- column="43"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#saturatedCast`"
- errorLine1=" mStatsBuilder.setLatencyMicros(ConnectivityUtils.saturatedCast(mWatch.stop()));"
- errorLine2=" ~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkValidationMetrics.java"
- line="237"
- column="58"/>
- </issue>
-
</issues>
diff --git a/lint-baseline-stable-lib.xml b/lint-baseline-stable-lib.xml
index f7b00f2..e8cfe3e 100644
--- a/lint-baseline-stable-lib.xml
+++ b/lint-baseline-stable-lib.xml
@@ -3,83 +3,6 @@
<issue
id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#addressAndPortToString`"
- errorLine1=" ConnectivityUtils.addressAndPortToString("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/android/net/apf/ApfFilter.java"
- line="1032"
- column="43"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#addressAndPortToString`"
- errorLine1=" ConnectivityUtils.addressAndPortToString("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/android/net/apf/ApfFilter.java"
- line="1034"
- column="43"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#addressAndPortToString`"
- errorLine1=" ConnectivityUtils.addressAndPortToString("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/android/net/apf/ApfFilter.java"
- line="1087"
- column="43"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#addressAndPortToString`"
- errorLine1=" ConnectivityUtils.addressAndPortToString("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/android/net/apf/ApfFilter.java"
- line="1089"
- column="43"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.CollectionUtils#any`"
- errorLine1=" final boolean haveKeepaliveResponses = CollectionUtils.any(mKeepalivePackets,"
- errorLine2=" ~~~">
- <location
- file="packages/modules/NetworkStack/src/android/net/apf/ApfFilter.java"
- line="1368"
- column="64"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.CollectionUtils#toIntArray`"
- errorLine1=" CollectionUtils.toIntArray(mDnsReturnCode),"
- errorLine2=" ~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/networkstack/metrics/DataStallDetectionStats.java"
- line="302"
- column="37"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.CollectionUtils#toLongArray`"
- errorLine1=" CollectionUtils.toLongArray(mDnsTimeStamp),"
- errorLine2=" ~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/networkstack/metrics/DataStallDetectionStats.java"
- line="303"
- column="37"/>
- </issue>
-
- <issue
- id="NewApi"
message="Call requires API level R (current min is 29): `android.net.LinkProperties#getNat64Prefix`"
errorLine1=" newLp.setNat64Prefix(netlinkLinkProperties.getNat64Prefix());"
errorLine2=" ~~~~~~~~~~~~~~">
@@ -102,50 +25,6 @@
<issue
id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#saturatedCast`"
- errorLine1=" mStatsBuilder.setIpv4LatencyMicros(ConnectivityUtils.saturatedCast(mIpv4Watch.stop()));"
- errorLine2=" ~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/networkstack/metrics/IpProvisioningMetrics.java"
- line="74"
- column="66"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#saturatedCast`"
- errorLine1=" mStatsBuilder.setIpv6LatencyMicros(ConnectivityUtils.saturatedCast(mIpv6Watch.stop()));"
- errorLine2=" ~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/networkstack/metrics/IpProvisioningMetrics.java"
- line="83"
- column="66"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.CollectionUtils#isEmpty`"
- errorLine1=" if (isEmpty(mCaptivePortalFallbackSpecs)) {"
- errorLine2=" ~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java"
- line="2279"
- column="13"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#isIPv6ULA`"
- errorLine1=" || isIPv6ULA(address)) {"
- errorLine2=" ~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java"
- line="2447"
- column="24"/>
- </issue>
-
- <issue
- id="NewApi"
message="Call requires API level R (current min is 29): `android.telephony.NetworkRegistrationInfo#getCellIdentity`"
errorLine1=" nri == null ? null : nri.getCellIdentity());"
errorLine2=" ~~~~~~~~~~~~~~~">
@@ -155,48 +34,4 @@
column="46"/>
</issue>
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#saturatedCast`"
- errorLine1=" int latencyUs = ConnectivityUtils.saturatedCast(durationUs);"
- errorLine2=" ~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkValidationMetrics.java"
- line="198"
- column="43"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#saturatedCast`"
- errorLine1=" .setRemainingTtlSecs(ConnectivityUtils.saturatedCast(secondsRemaining))"
- errorLine2=" ~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkValidationMetrics.java"
- line="209"
- column="56"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#saturatedCast`"
- errorLine1=" ConnectivityUtils.saturatedCast(capportData.getByteLimit() / 1000))"
- errorLine2=" ~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkValidationMetrics.java"
- line="212"
- column="43"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 31 (current min is 29): `com.android.net.module.util.ConnectivityUtils#saturatedCast`"
- errorLine1=" mStatsBuilder.setLatencyMicros(ConnectivityUtils.saturatedCast(mWatch.stop()));"
- errorLine2=" ~~~~~~~~~~~~~">
- <location
- file="packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkValidationMetrics.java"
- line="237"
- column="58"/>
- </issue>
-
</issues>
diff --git a/tests/integration/Android.bp b/tests/integration/Android.bp
index 2cffc3d..875b089 100644
--- a/tests/integration/Android.bp
+++ b/tests/integration/Android.bp
@@ -87,7 +87,6 @@
certificate: "networkstack",
platform_apis: true,
test_suites: ["device-tests"],
- enabled: false, // Disabled in mainline-prod
}
// The static lib needs to be jarjared by each module so they do not conflict with each other
diff --git a/tests/unit/Android.bp b/tests/unit/Android.bp
index e308b96..73a844b 100644
--- a/tests/unit/Android.bp
+++ b/tests/unit/Android.bp
@@ -36,7 +36,10 @@
"android.test.base",
"android.test.mock",
],
- defaults: ["libnetworkstackutilsjni_deps"],
+ defaults: [
+ "framework-connectivity-test-defaults",
+ "libnetworkstackutilsjni_deps"
+ ],
jni_libs: [
// For mockito extended
"libdexmakerjvmtiagent",
@@ -54,11 +57,13 @@
min_sdk_version: "29",
srcs: [], // TODO: tests that only apply to the current, non-stable API can be added here
test_suites: ["general-tests"],
- test_mainline_modules: ["CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex"],
+ test_mainline_modules: [
+ "CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex",
+ "CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex"
+ ],
defaults: ["NetworkStackTestsDefaults"],
static_libs: ["NetworkStackApiCurrentLib"],
compile_multilib: "both", // Workaround for b/147785146 for mainline-presubmit
- enabled: false, // Disabled in mainline-prod
}
// Library containing the unit tests. This is used by the coverage test target to pull in the
@@ -81,7 +86,10 @@
min_sdk_version: "29",
target_sdk_version: "30",
test_suites: ["general-tests", "mts"],
- test_mainline_modules: ["CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex"],
+ test_mainline_modules: [
+ "CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex",
+ "CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex"
+ ],
defaults: ["NetworkStackTestsDefaults"],
static_libs: ["NetworkStackApiStableLib"],
compile_multilib: "both",