Remove DEBUG_ capabilities from ChipCapabilityMask.

Also update the IWifiChip VTS test to reflect
this change.

Bug: 266521428
Test: atest VtsHalWifiChipTargetTest
Change-Id: I537588c405d8a01091a6818020084acbe2679e14
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl
index fd59888..6d0ddaa 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl
@@ -85,22 +85,14 @@
   const int NO_POWER_CAP_CONSTANT = 0x7FFFFFFF;
   @Backing(type="int") @VintfStability
   enum ChipCapabilityMask {
-    DEBUG_MEMORY_FIRMWARE_DUMP = (1 << 0),
-    DEBUG_MEMORY_DRIVER_DUMP = (1 << 1),
-    DEBUG_RING_BUFFER_CONNECT_EVENT = (1 << 2),
-    DEBUG_RING_BUFFER_POWER_EVENT = (1 << 3),
-    DEBUG_RING_BUFFER_WAKELOCK_EVENT = (1 << 4),
-    DEBUG_RING_BUFFER_VENDOR_DATA = (1 << 5),
-    DEBUG_HOST_WAKE_REASON_STATS = (1 << 6),
-    DEBUG_ERROR_ALERTS = (1 << 7),
-    SET_TX_POWER_LIMIT = (1 << 8),
-    D2D_RTT = (1 << 9),
-    D2AP_RTT = (1 << 10),
-    USE_BODY_HEAD_SAR = (1 << 11),
-    SET_LATENCY_MODE = (1 << 12),
-    P2P_RAND_MAC = (1 << 13),
-    WIGIG = (1 << 14),
-    SET_AFC_CHANNEL_ALLOWANCE = (1 << 15),
+    SET_TX_POWER_LIMIT = (1 << 0) /* 1 */,
+    D2D_RTT = (1 << 1) /* 2 */,
+    D2AP_RTT = (1 << 2) /* 4 */,
+    USE_BODY_HEAD_SAR = (1 << 3) /* 8 */,
+    SET_LATENCY_MODE = (1 << 4) /* 16 */,
+    P2P_RAND_MAC = (1 << 5) /* 32 */,
+    WIGIG = (1 << 6) /* 64 */,
+    SET_AFC_CHANNEL_ALLOWANCE = (1 << 7) /* 128 */,
   }
   @VintfStability
   parcelable ChipConcurrencyCombinationLimit {
@@ -132,9 +124,9 @@
   }
   @Backing(type="int") @VintfStability
   enum CoexRestriction {
-    WIFI_DIRECT = (1 << 0),
-    SOFTAP = (1 << 1),
-    WIFI_AWARE = (1 << 2),
+    WIFI_DIRECT = (1 << 0) /* 1 */,
+    SOFTAP = (1 << 1) /* 2 */,
+    WIFI_AWARE = (1 << 2) /* 4 */,
   }
   @VintfStability
   parcelable CoexUnsafeChannel {
@@ -162,13 +154,13 @@
   }
   @Backing(type="int") @VintfStability
   enum UsableChannelFilter {
-    CELLULAR_COEXISTENCE = (1 << 0),
-    CONCURRENCY = (1 << 1),
-    NAN_INSTANT_MODE = (1 << 2),
+    CELLULAR_COEXISTENCE = (1 << 0) /* 1 */,
+    CONCURRENCY = (1 << 1) /* 2 */,
+    NAN_INSTANT_MODE = (1 << 2) /* 4 */,
   }
   @Backing(type="int") @VintfStability
   enum ChannelCategoryMask {
-    INDOOR_CHANNEL = (1 << 0),
-    DFS_CHANNEL = (1 << 1),
+    INDOOR_CHANNEL = (1 << 0) /* 1 */,
+    DFS_CHANNEL = (1 << 1) /* 2 */,
   }
 }
diff --git a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
index 41ff7e6..8d415fd 100644
--- a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
+++ b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
@@ -46,71 +46,38 @@
     @Backing(type="int")
     enum ChipCapabilityMask {
         /**
-         * Memory dump of Firmware.
-         */
-        DEBUG_MEMORY_FIRMWARE_DUMP = 1 << 0,
-        /**
-         * Memory dump of Driver.
-         */
-        DEBUG_MEMORY_DRIVER_DUMP = 1 << 1,
-        /**
-         * Connectivity events reported via debug ring buffer.
-         */
-        DEBUG_RING_BUFFER_CONNECT_EVENT = 1 << 2,
-        /**
-         * Power events reported via debug ring buffer.
-         */
-        DEBUG_RING_BUFFER_POWER_EVENT = 1 << 3,
-        /**
-         * Wakelock events reported via debug ring buffer.
-         */
-        DEBUG_RING_BUFFER_WAKELOCK_EVENT = 1 << 4,
-        /**
-         * Vendor data reported via debug ring buffer.
-         * This mostly contains firmware event logs.
-         */
-        DEBUG_RING_BUFFER_VENDOR_DATA = 1 << 5,
-        /**
-         * Host wake reasons stats collection.
-         */
-        DEBUG_HOST_WAKE_REASON_STATS = 1 << 6,
-        /**
-         * Error alerts.
-         */
-        DEBUG_ERROR_ALERTS = 1 << 7,
-        /**
          * Set/Reset Tx Power limits.
          */
-        SET_TX_POWER_LIMIT = 1 << 8,
+        SET_TX_POWER_LIMIT = 1 << 0,
         /**
          * Device to Device RTT.
          */
-        D2D_RTT = 1 << 9,
+        D2D_RTT = 1 << 1,
         /**
          * Device to AP RTT.
          */
-        D2AP_RTT = 1 << 10,
+        D2AP_RTT = 1 << 2,
         /**
          * Set/Reset Tx Power limits.
          */
-        USE_BODY_HEAD_SAR = 1 << 11,
+        USE_BODY_HEAD_SAR = 1 << 3,
         /**
          * Set Latency Mode.
          */
-        SET_LATENCY_MODE = 1 << 12,
+        SET_LATENCY_MODE = 1 << 4,
         /**
          * Support P2P MAC randomization.
          */
-        P2P_RAND_MAC = 1 << 13,
+        P2P_RAND_MAC = 1 << 5,
         /**
          * Chip can operate in the 60GHz band (WiGig chip).
          */
-        WIGIG = 1 << 14,
+        WIGIG = 1 << 6,
         /**
          * Chip supports setting allowed channels along with PSD in 6GHz band
          * for AFC purposes.
          */
-        SET_AFC_CHANNEL_ALLOWANCE = 1 << 15,
+        SET_AFC_CHANNEL_ALLOWANCE = 1 << 7,
     }
 
     /**
@@ -540,7 +507,6 @@
      * API to enable/disable alert notifications from the chip.
      * These alerts must be used to notify the framework of any fatal error events
      * that the chip encounters via |IWifiChipEventCallback.onDebugErrorAlert| method.
-     * Must fail if |ChipCapabilityMask.DEBUG_ERROR_ALERTS| is not set.
      *
      * @param enable true to enable, false to disable.
      * @throws ServiceSpecificException with one of the following values:
diff --git a/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp
index fec9122..f908be6 100644
--- a/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp
+++ b/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp
@@ -131,16 +131,6 @@
         return {iface1, iface2};
     }
 
-    bool hasAnyRingBufferCapabilities(int32_t caps) {
-        return caps &
-               (static_cast<int32_t>(
-                        IWifiChip::ChipCapabilityMask::DEBUG_RING_BUFFER_CONNECT_EVENT) |
-                static_cast<int32_t>(IWifiChip::ChipCapabilityMask::DEBUG_RING_BUFFER_POWER_EVENT) |
-                static_cast<int32_t>(
-                        IWifiChip::ChipCapabilityMask::DEBUG_RING_BUFFER_WAKELOCK_EVENT) |
-                static_cast<int32_t>(IWifiChip::ChipCapabilityMask::DEBUG_RING_BUFFER_VENDOR_DATA));
-    }
-
     const char* getInstanceName() { return GetParam().c_str(); }
 
     std::shared_ptr<IWifiChip> wifi_chip_;
@@ -452,14 +442,9 @@
  */
 TEST_P(WifiChipAidlTest, RequestFirmwareDebugDump) {
     configureChipForConcurrencyType(IfaceConcurrencyType::STA);
-    int32_t caps = getChipCapabilities(wifi_chip_);
     std::vector<uint8_t> debug_dump;
     auto status = wifi_chip_->requestFirmwareDebugDump(&debug_dump);
-    if (caps & static_cast<int32_t>(IWifiChip::ChipCapabilityMask::DEBUG_MEMORY_FIRMWARE_DUMP)) {
-        EXPECT_TRUE(status.isOk());
-    } else {
-        EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
-    }
+    EXPECT_TRUE(status.isOk() || checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
 }
 
 /*
@@ -467,14 +452,9 @@
  */
 TEST_P(WifiChipAidlTest, RequestDriverDebugDump) {
     configureChipForConcurrencyType(IfaceConcurrencyType::STA);
-    int32_t caps = getChipCapabilities(wifi_chip_);
     std::vector<uint8_t> debug_dump;
     auto status = wifi_chip_->requestDriverDebugDump(&debug_dump);
-    if (caps & static_cast<int32_t>(IWifiChip::ChipCapabilityMask::DEBUG_MEMORY_DRIVER_DUMP)) {
-        EXPECT_TRUE(status.isOk());
-    } else {
-        EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
-    }
+    EXPECT_TRUE(status.isOk() || checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
 }
 
 /*
@@ -482,17 +462,14 @@
  */
 TEST_P(WifiChipAidlTest, GetDebugRingBuffersStatus) {
     configureChipForConcurrencyType(IfaceConcurrencyType::STA);
-    int32_t caps = getChipCapabilities(wifi_chip_);
     std::vector<WifiDebugRingBufferStatus> ring_buffer_status;
     auto status = wifi_chip_->getDebugRingBuffersStatus(&ring_buffer_status);
-    if (hasAnyRingBufferCapabilities(caps)) {
-        EXPECT_TRUE(status.isOk());
+    EXPECT_TRUE(status.isOk() || checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
+    if (status.isOk()) {
         ASSERT_NE(ring_buffer_status.size(), 0);
         for (const auto& ring_buffer : ring_buffer_status) {
             EXPECT_NE(ring_buffer.ringName.size(), 0);
         }
-    } else {
-        EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
     }
 }
 
@@ -501,14 +478,9 @@
  */
 TEST_P(WifiChipAidlTest, GetDebugHostWakeReasonStats) {
     configureChipForConcurrencyType(IfaceConcurrencyType::STA);
-    int32_t caps = getChipCapabilities(wifi_chip_);
     WifiDebugHostWakeReasonStats wake_reason_stats = {};
     auto status = wifi_chip_->getDebugHostWakeReasonStats(&wake_reason_stats);
-    if (caps & static_cast<int32_t>(IWifiChip::ChipCapabilityMask::DEBUG_HOST_WAKE_REASON_STATS)) {
-        EXPECT_TRUE(status.isOk());
-    } else {
-        EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
-    }
+    EXPECT_TRUE(status.isOk() || checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
 }
 
 /*
@@ -516,26 +488,19 @@
  */
 TEST_P(WifiChipAidlTest, StartLoggingToDebugRingBuffer) {
     configureChipForConcurrencyType(IfaceConcurrencyType::STA);
-    int32_t caps = getChipCapabilities(wifi_chip_);
     std::string ring_name;
     std::vector<WifiDebugRingBufferStatus> ring_buffer_status;
-    auto status = wifi_chip_->getDebugRingBuffersStatus(&ring_buffer_status);
 
-    if (hasAnyRingBufferCapabilities(caps)) {
-        EXPECT_TRUE(status.isOk());
+    auto status = wifi_chip_->getDebugRingBuffersStatus(&ring_buffer_status);
+    EXPECT_TRUE(status.isOk() || checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
+    if (status.isOk()) {
         ASSERT_NE(ring_buffer_status.size(), 0);
         ring_name = ring_buffer_status[0].ringName;
-    } else {
-        EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
     }
 
     status = wifi_chip_->startLoggingToDebugRingBuffer(
             ring_name, WifiDebugRingBufferVerboseLevel::VERBOSE, 5, 1024);
-    if (hasAnyRingBufferCapabilities(caps)) {
-        EXPECT_TRUE(status.isOk());
-    } else {
-        EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
-    }
+    EXPECT_TRUE(status.isOk() || checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
 }
 
 /*
@@ -543,25 +508,18 @@
  */
 TEST_P(WifiChipAidlTest, ForceDumpToDebugRingBuffer) {
     configureChipForConcurrencyType(IfaceConcurrencyType::STA);
-    int32_t caps = getChipCapabilities(wifi_chip_);
     std::string ring_name;
     std::vector<WifiDebugRingBufferStatus> ring_buffer_status;
-    auto status = wifi_chip_->getDebugRingBuffersStatus(&ring_buffer_status);
 
-    if (hasAnyRingBufferCapabilities(caps)) {
-        EXPECT_TRUE(status.isOk());
+    auto status = wifi_chip_->getDebugRingBuffersStatus(&ring_buffer_status);
+    EXPECT_TRUE(status.isOk() || checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
+    if (status.isOk()) {
         ASSERT_NE(ring_buffer_status.size(), 0);
         ring_name = ring_buffer_status[0].ringName;
-    } else {
-        EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
     }
 
     status = wifi_chip_->forceDumpToDebugRingBuffer(ring_name);
-    if (hasAnyRingBufferCapabilities(caps)) {
-        EXPECT_TRUE(status.isOk());
-    } else {
-        EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
-    }
+    EXPECT_TRUE(status.isOk() || checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
 }
 
 /*