From 80a2a14a9190a004a60d3cb1101a87fad387ee5f Mon Sep 17 00:00:00 2001 From: Jimi Chen Date: Mon, 2 Jun 2025 05:07:18 +0000 Subject: [PATCH] Skip APF multidevice CTS if device support automotive feature Flag: EXEMPT mainline Bug: 407637806 Test: TH Change-Id: I1dff6c2507455451951314ba0298cecb62d4bb17 --- staticlibs/testutils/host/python/apf_test_base.py | 5 +++++ .../multidevices/snippet/ConnectivityMultiDevicesSnippet.kt | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/staticlibs/testutils/host/python/apf_test_base.py b/staticlibs/testutils/host/python/apf_test_base.py index f77dd42603..b0fe28fdf3 100644 --- a/staticlibs/testutils/host/python/apf_test_base.py +++ b/staticlibs/testutils/host/python/apf_test_base.py @@ -39,6 +39,11 @@ class ApfTestBase(multi_devices_test_base.MultiDevicesTestBase): 'NetworkStack is too old to support send raw packet, skip test.', ) + asserts.abort_class_if( + self.client.hasAutomotiveFeature(), + 'APF GMS-VSR requirements do not apply to automotive devices, skip' + ' test.', + ) # Fetch device properties and storing them locally for later use. # TODO: refactor to separate instances to store client and server device self.server_iface_name, client_network = ( diff --git a/tests/cts/multidevices/snippet/ConnectivityMultiDevicesSnippet.kt b/tests/cts/multidevices/snippet/ConnectivityMultiDevicesSnippet.kt index 3f3a6d34f0..feea1247fd 100644 --- a/tests/cts/multidevices/snippet/ConnectivityMultiDevicesSnippet.kt +++ b/tests/cts/multidevices/snippet/ConnectivityMultiDevicesSnippet.kt @@ -18,6 +18,7 @@ package com.google.snippet.connectivity import android.Manifest.permission.NETWORK_SETTINGS import android.Manifest.permission.OVERRIDE_WIFI_CONFIG +import android.content.pm.PackageManager.FEATURE_AUTOMOTIVE import android.content.pm.PackageManager.FEATURE_TELEPHONY import android.content.pm.PackageManager.FEATURE_WIFI import android.net.ConnectivityManager @@ -81,6 +82,9 @@ class ConnectivityMultiDevicesSnippet : Snippet { @Rpc(description = "Check whether the device has telephony feature.") fun hasTelephonyFeature() = pm.hasSystemFeature(FEATURE_TELEPHONY) + @Rpc(description = "Check whether the device has automotive feature.") + fun hasAutomotiveFeature() = pm.hasSystemFeature(FEATURE_AUTOMOTIVE) + @Rpc(description = "Check whether the device supporters AP + STA concurrency.") fun isStaApConcurrencySupported() = wifiManager.isStaApConcurrencySupported()