Update APF VTS to include the vendor API level check
APF is support is mandatory since VSR 14. Before that, the APF
requirement is optional. Vendors can opted into upgrading their
HAL to AIDL, so the VTS need to check if vendor API level on the device
and only mandate the APF capability check if the vendor API level is
greater or equal to 14.
Bug: 283181837
Test: atest VtsHalWifiStaIfaceTargetTest
Change-Id: I21513187d4ca99d721d0e9dc5e243adad77ab8c6
diff --git a/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
index 288f20a..f12d873 100644
--- a/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
+++ b/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
@@ -24,6 +24,7 @@
#include <android/binder_status.h>
#include <binder/IServiceManager.h>
#include <binder/ProcessState.h>
+#include <cutils/properties.h>
#include "wifi_aidl_test_utils.h"
@@ -98,16 +99,23 @@
*/
// @VsrTest = 5.3.12
TEST_P(WifiStaIfaceAidlTest, CheckApfIsSupported) {
- // It is not required to check the vendor API level is at least U here
- // because the Wi-Fi AIDL interface is launched with Android U(VSR-14).
- // TODO: Add wavier list to the chipsets that doesn't support APF.
- EXPECT_TRUE(isFeatureSupported(IWifiStaIface::FeatureSetMask::APF));
- StaApfPacketFilterCapabilities apf_caps = {};
- EXPECT_TRUE(wifi_sta_iface_->getApfPacketFilterCapabilities(&apf_caps).isOk());
- // The APF version must be 4 and the usable memory must be at least
- // 1024 bytes.
- EXPECT_EQ(apf_caps.version, 4);
- EXPECT_GE(apf_caps.maxLength, 1024);
+ int vendor_api_level = property_get_int32("ro.vendor.api_level", 0);
+ // Before VSR 14, APF support is optional.
+ if (vendor_api_level < __ANDROID_API_U__) {
+ if (!isFeatureSupported(IWifiStaIface::FeatureSetMask::APF)) {
+ GTEST_SKIP() << "APF packet filter capabilities are not supported.";
+ }
+ StaApfPacketFilterCapabilities apf_caps = {};
+ EXPECT_TRUE(wifi_sta_iface_->getApfPacketFilterCapabilities(&apf_caps).isOk());
+ } else {
+ EXPECT_TRUE(isFeatureSupported(IWifiStaIface::FeatureSetMask::APF));
+ StaApfPacketFilterCapabilities apf_caps = {};
+ EXPECT_TRUE(wifi_sta_iface_->getApfPacketFilterCapabilities(&apf_caps).isOk());
+ // The APF version must be 4 and the usable memory must be at least
+ // 1024 bytes.
+ EXPECT_EQ(apf_caps.version, 4);
+ EXPECT_GE(apf_caps.maxLength, 1024);
+ }
}
/*