From 6807d2dd39163b6789f0cbfea392a82a0f0da413 Mon Sep 17 00:00:00 2001 From: Yuyang Huang Date: Mon, 12 May 2025 22:21:58 +0900 Subject: [PATCH 1/2] Enforce valid APF versions (0, 2, 3, 4, 6000, 6100) This commit adds a check to enforce that reported APF versions are either 0 (indicating no support) or one of the officially valid versions: 2, 3, 4, 6000 or 6100. This ensures consistency and prevents issues arising from device using unsupported APF versions. Test: TH Flag: EXEMPT bugfix Change-Id: Icdefa89fae590ec78146df4cbd2c683b5d8258f7 --- tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt b/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt index b4ad325445..3211725314 100644 --- a/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt +++ b/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt @@ -405,6 +405,8 @@ class ApfIntegrationTest { ) @Test fun testApfCapabilities() { + // If APF is supported, the version must be valid. + assertThat(caps.apfVersionSupported).isAnyOf(0, 2, 3, 4, 6000, 6100) // APF became mandatory in Android 14 VSR. val vsrApiLevel = getVsrApiLevel() assume().that(vsrApiLevel).isAtLeast(34) From 8e5a4fb2c0995c825157e9c36909f105cba0a68b Mon Sep 17 00:00:00 2001 From: Yuyang Huang Date: Mon, 12 May 2025 22:49:37 +0900 Subject: [PATCH 2/2] Skip ApfIntegrationTest on automotive devices This commit modifies ApfIntegrationTest to skip execution on automotive devices. APF GMS-VSR requirements do not apply to automotive devices. APF offer no power benefit automotive devices due to their almost infinite battery power supply. This change aligns the test suite with the platform's specific requirements. Test: TH Flag: EXEMPT bugfix Change-Id: Iad43a122407fe438cab94f59ed8aba8d6080af02 --- tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt b/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt index 3211725314..033092f68f 100644 --- a/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt +++ b/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt @@ -352,6 +352,10 @@ class ApfIntegrationTest { isTvDeviceSupportFullNetworkingUnder2w() ) + // APF GMS-VSR requirements don't apply to automotive devices. There is no power benefit to + // running APF on automotive as the device has almost infinite battery power. + assumeFalse("Skip test: automotive device", pm.hasSystemFeature(FEATURE_AUTOMOTIVE)) + networkCallback = TestableNetworkCallback() cm.requestNetwork( NetworkRequest.Builder()