Exit the Keep Alive and DTIM multiplier
tests early if not supported.

Bug: 388915979
Test: Rerun the failing targets in Treehugger
Change-Id: I2e032d05df6af365157b090879d786049e62df5c
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 f997c43..dc13994 100644
--- a/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
+++ b/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
@@ -543,7 +543,12 @@
  */
 TEST_P(WifiStaIfaceAidlTest, SetDtimMultiplier) {
     // Multiplied value
-    EXPECT_TRUE(wifi_sta_iface_->setDtimMultiplier(2).isOk());
+    auto status = wifi_sta_iface_->setDtimMultiplier(2);
+    if (checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) {
+        GTEST_SKIP() << "SetDtimMultiplier is not supported";
+    }
+    EXPECT_TRUE(status.isOk());
+
     // Driver default value
     EXPECT_TRUE(wifi_sta_iface_->setDtimMultiplier(0).isOk());
 }
@@ -568,12 +573,17 @@
     uint16_t etherType = 0x0800;  // IPv4
     uint32_t periodInMs = 1000;   // 1 sec
 
-    // Expected to fail with test values
-    EXPECT_FALSE(wifi_sta_iface_
-                         ->startSendingKeepAlivePackets(kTestCmdId, ipPacketData, etherType,
-                                                        kTestMacAddr1, kTestMacAddr2, periodInMs)
-                         .isOk());
-    EXPECT_FALSE(wifi_sta_iface_->stopSendingKeepAlivePackets(kTestCmdId).isOk());
+    auto status = wifi_sta_iface_->startSendingKeepAlivePackets(
+            kTestCmdId, ipPacketData, etherType, kTestMacAddr1, kTestMacAddr2, periodInMs);
+    if (!status.isOk()) {
+        // The device may not support this operation or the specific test values
+        GTEST_SKIP() << "StartAndStopSendingKeepAlivePackets is not supported"
+                     << ", status=" << status.getServiceSpecificError();
+    }
+    EXPECT_TRUE(status.isOk());
+
+    // If start was successful, then stop should also work
+    EXPECT_TRUE(wifi_sta_iface_->stopSendingKeepAlivePackets(kTestCmdId).isOk());
 }
 
 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiStaIfaceAidlTest);