Merge changes from topic "vendor-hal-bitmaps" into udc-dev

* changes:
  Update Vendor HAL service to use ints for bitmaps instead of using enums.
  Use an int to represent bitmaps in the Vendor HAL AIDL interface.
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 2ff6896..23f4030 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
@@ -47,7 +47,7 @@
   @PropagateAllowBlocking android.hardware.wifi.IWifiApIface getApIface(in String ifname);
   String[] getApIfaceNames();
   android.hardware.wifi.IWifiChip.ChipMode[] getAvailableModes();
-  android.hardware.wifi.IWifiChip.ChipCapabilityMask getCapabilities();
+  int getCapabilities();
   android.hardware.wifi.WifiDebugHostWakeReasonStats getDebugHostWakeReasonStats();
   android.hardware.wifi.WifiDebugRingBufferStatus[] getDebugRingBuffersStatus();
   int getId();
@@ -60,7 +60,7 @@
   String[] getStaIfaceNames();
   android.hardware.wifi.WifiRadioCombination[] getSupportedRadioCombinations();
   android.hardware.wifi.WifiChipCapabilities getWifiChipCapabilities();
-  android.hardware.wifi.WifiUsableChannel[] getUsableChannels(in android.hardware.wifi.WifiBand band, in android.hardware.wifi.WifiIfaceMode ifaceModeMask, in android.hardware.wifi.IWifiChip.UsableChannelFilter filterMask);
+  android.hardware.wifi.WifiUsableChannel[] getUsableChannels(in android.hardware.wifi.WifiBand band, in int ifaceModeMask, in int filterMask);
   void setAfcChannelAllowance(in android.hardware.wifi.AvailableAfcFrequencyInfo[] availableAfcFrequencyInfo);
   void registerEventCallback(in android.hardware.wifi.IWifiChipEventCallback callback);
   void removeApIface(in String ifname);
@@ -73,7 +73,7 @@
   byte[] requestFirmwareDebugDump();
   void resetTxPowerScenario();
   void selectTxPowerScenario(in android.hardware.wifi.IWifiChip.TxPowerScenario scenario);
-  void setCoexUnsafeChannels(in android.hardware.wifi.IWifiChip.CoexUnsafeChannel[] unsafeChannels, in android.hardware.wifi.IWifiChip.CoexRestriction restrictions);
+  void setCoexUnsafeChannels(in android.hardware.wifi.IWifiChip.CoexUnsafeChannel[] unsafeChannels, in int restrictions);
   void setCountryCode(in byte[2] code);
   void setLatencyMode(in android.hardware.wifi.IWifiChip.LatencyMode mode);
   void setMultiStaPrimaryConnection(in String ifName);
@@ -81,7 +81,7 @@
   void startLoggingToDebugRingBuffer(in String ringName, in android.hardware.wifi.WifiDebugRingBufferVerboseLevel verboseLevel, in int maxIntervalInSec, in int minDataSizeInBytes);
   void stopLoggingToDebugRingBuffer();
   void triggerSubsystemRestart();
-  void enableStaChannelForPeerNetwork(in android.hardware.wifi.IWifiChip.ChannelCategoryMask channelCategoryEnableFlag);
+  void enableStaChannelForPeerNetwork(in int channelCategoryEnableFlag);
   void setMloMode(in android.hardware.wifi.IWifiChip.ChipMloMode mode);
   const int NO_POWER_CAP_CONSTANT = 0x7FFFFFFF;
   @Backing(type="int") @VintfStability
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl
index 31b6881..a7f2081 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl
@@ -41,7 +41,7 @@
   void enableNdOffload(in boolean enable);
   android.hardware.wifi.StaApfPacketFilterCapabilities getApfPacketFilterCapabilities();
   android.hardware.wifi.StaBackgroundScanCapabilities getBackgroundScanCapabilities();
-  android.hardware.wifi.IWifiStaIface.StaIfaceCapabilityMask getCapabilities();
+  int getCapabilities();
   android.hardware.wifi.WifiDebugRxPacketFateReport[] getDebugRxPacketFates();
   android.hardware.wifi.WifiDebugTxPacketFateReport[] getDebugTxPacketFates();
   byte[6] getFactoryMacAddress();
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl
index b49d406..4e9671a 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl
@@ -38,7 +38,7 @@
   android.hardware.wifi.WifiBand band;
   int[] frequencies;
   int periodInMs;
-  android.hardware.wifi.StaBackgroundScanBucketEventReportSchemeMask eventReportScheme;
+  int eventReportScheme;
   int exponentialMaxPeriodInMs;
   int exponentialBase;
   int exponentialStepCount;
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanData.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanData.aidl
index 5903760..7c75232 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanData.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanData.aidl
@@ -34,7 +34,7 @@
 package android.hardware.wifi;
 @VintfStability
 parcelable StaScanData {
-  android.hardware.wifi.StaScanDataFlagMask flags;
+  int flags;
   int bucketsScanned;
   android.hardware.wifi.StaScanResult[] results;
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiUsableChannel.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiUsableChannel.aidl
index 94e3a8a..774b242 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiUsableChannel.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiUsableChannel.aidl
@@ -36,5 +36,5 @@
 parcelable WifiUsableChannel {
   int channel;
   android.hardware.wifi.WifiChannelWidthInMhz channelBandwidth;
-  android.hardware.wifi.WifiIfaceMode ifaceModeMask;
+  int ifaceModeMask;
 }
diff --git a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
index c0e41cd..1710f63 100644
--- a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
+++ b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
@@ -590,7 +590,7 @@
      *         |WifiStatusCode.ERROR_NOT_AVAILABLE|,
      *         |WifiStatusCode.ERROR_UNKNOWN|
      */
-    ChipCapabilityMask getCapabilities();
+    int getCapabilities();
 
     /**
      * API to retrieve the wifi wake up reason stats for debugging.
@@ -808,7 +808,7 @@
      *         |WifiStatusCode.FAILURE_UNKNOWN|
      */
     WifiUsableChannel[] getUsableChannels(
-            in WifiBand band, in WifiIfaceMode ifaceModeMask, in UsableChannelFilter filterMask);
+            in WifiBand band, in int ifaceModeMask, in int filterMask);
 
     /*
      * Set the max power level the chip is allowed to transmit on for 6Ghz AFC
@@ -982,8 +982,7 @@
      *         |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
      *         |WifiStatusCode.ERROR_INVALID_ARGS|,
      */
-    void setCoexUnsafeChannels(
-            in CoexUnsafeChannel[] unsafeChannels, in CoexRestriction restrictions);
+    void setCoexUnsafeChannels(in CoexUnsafeChannel[] unsafeChannels, in int restrictions);
 
     /**
      * Set country code for this Wifi chip.
@@ -1110,14 +1109,14 @@
      * If the channel category is enabled and allowed by the regulatory, the HAL method
      * getUsableChannels() will contain the current STA-connected channel if that channel belongs
      * to that category.
-     * @param channelCategoryEnableFlag bitmask of |ChannelCategoryMask|.
+     * @param channelCategoryEnableFlag Bitmask of |ChannelCategoryMask| values.
      *        For each bit, 1 enables the channel category and 0 disables that channel category.
      * @throws ServiceSpecificException with one of the following values:
      *         |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
      *         |WifiStatusCode.ERROR_NOT_SUPPORTED|,
      *         |WifiStatusCode.FAILURE_UNKNOWN|
      */
-    void enableStaChannelForPeerNetwork(in ChannelCategoryMask channelCategoryEnableFlag);
+    void enableStaChannelForPeerNetwork(in int channelCategoryEnableFlag);
 
     /**
      * Multi-Link Operation modes.
diff --git a/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl b/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl
index 28d6a4d..8e9a06d 100644
--- a/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl
+++ b/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl
@@ -198,7 +198,7 @@
      *         |WifiStatusCode.ERROR_NOT_AVAILABLE|,
      *         |WifiStatusCode.ERROR_UNKNOWN|
      */
-    StaIfaceCapabilityMask getCapabilities();
+    int getCapabilities();
 
     /**
      * API to retrieve the fates of inbound packets.
diff --git a/wifi/aidl/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl b/wifi/aidl/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl
index 7bd87b2..76b510d 100644
--- a/wifi/aidl/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl
+++ b/wifi/aidl/android/hardware/wifi/StaBackgroundScanBucketParameters.aidl
@@ -16,7 +16,6 @@
 
 package android.hardware.wifi;
 
-import android.hardware.wifi.StaBackgroundScanBucketEventReportSchemeMask;
 import android.hardware.wifi.WifiBand;
 
 /**
@@ -50,7 +49,7 @@
      * Bitset of |StaBackgroundScanBucketEventReportSchemeMask| values controlling
      * when events for this bucket must be reported.
      */
-    StaBackgroundScanBucketEventReportSchemeMask eventReportScheme;
+    int eventReportScheme;
     /**
      * For exponential back off. If |exponentialMaxPeriodInMs| is non-zero or
      * different than period, then this bucket is an exponential backoff bucket
diff --git a/wifi/aidl/android/hardware/wifi/StaScanData.aidl b/wifi/aidl/android/hardware/wifi/StaScanData.aidl
index 9d6bd53..abc5638 100644
--- a/wifi/aidl/android/hardware/wifi/StaScanData.aidl
+++ b/wifi/aidl/android/hardware/wifi/StaScanData.aidl
@@ -16,7 +16,6 @@
 
 package android.hardware.wifi;
 
-import android.hardware.wifi.StaScanDataFlagMask;
 import android.hardware.wifi.StaScanResult;
 
 /**
@@ -26,9 +25,9 @@
 @VintfStability
 parcelable StaScanData {
     /**
-     * Bitset containing |ScanDataFlagMask| values.
+     * Bitset of |ScanDataFlagMask| values.
      */
-    StaScanDataFlagMask flags;
+    int flags;
     /**
      * Bitset where each bit indicates if the bucket with that index (starting at
      * 0) was scanned.
diff --git a/wifi/aidl/android/hardware/wifi/WifiUsableChannel.aidl b/wifi/aidl/android/hardware/wifi/WifiUsableChannel.aidl
index d92e4cc..077c17e 100644
--- a/wifi/aidl/android/hardware/wifi/WifiUsableChannel.aidl
+++ b/wifi/aidl/android/hardware/wifi/WifiUsableChannel.aidl
@@ -17,7 +17,6 @@
 package android.hardware.wifi;
 
 import android.hardware.wifi.WifiChannelWidthInMhz;
-import android.hardware.wifi.WifiIfaceMode;
 
 /**
  * Wifi usable channel information.
@@ -33,7 +32,8 @@
      */
     WifiChannelWidthInMhz channelBandwidth;
     /**
-     * Iface modes feasible on this channel.
+     * Iface modes feasible on this channel, represented as a bitmask
+     * of |WifiIfaceMode| values.
      */
-    WifiIfaceMode ifaceModeMask;
+    int ifaceModeMask;
 }
diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp
index 5bfdcbb..dfa08a1 100644
--- a/wifi/aidl/default/aidl_struct_util.cpp
+++ b/wifi/aidl/default/aidl_struct_util.cpp
@@ -408,8 +408,8 @@
     aidl_usable_channel->channel = legacy_usable_channel.freq;
     aidl_usable_channel->channelBandwidth =
             convertLegacyWifiChannelWidthToAidl(legacy_usable_channel.width);
-    aidl_usable_channel->ifaceModeMask = static_cast<WifiIfaceMode>(
-            convertLegacyWifiInterfaceModeToAidl(legacy_usable_channel.iface_mode_mask));
+    aidl_usable_channel->ifaceModeMask =
+            convertLegacyWifiInterfaceModeToAidl(legacy_usable_channel.iface_mode_mask);
 
     return true;
 }
@@ -572,7 +572,7 @@
         legacy_bucket_spec.report_events = 0;
         using AidlFlag = StaBackgroundScanBucketEventReportSchemeMask;
         for (const auto flag : {AidlFlag::EACH_SCAN, AidlFlag::FULL_RESULTS, AidlFlag::NO_BATCH}) {
-            if (static_cast<int32_t>(aidl_bucket_spec.eventReportScheme) &
+            if (aidl_bucket_spec.eventReportScheme &
                 static_cast<std::underlying_type<AidlFlag>::type>(flag)) {
                 legacy_bucket_spec.report_events |= convertAidlGscanReportEventFlagToLegacy(flag);
             }
@@ -678,7 +678,7 @@
                     convertLegacyGscanDataFlagToAidl(flag));
         }
     }
-    aidl_scan_data->flags = static_cast<StaScanDataFlagMask>(flags);
+    aidl_scan_data->flags = flags;
     aidl_scan_data->bucketsScanned = legacy_cached_scan_result.buckets_scanned;
 
     CHECK(legacy_cached_scan_result.num_results >= 0 &&
diff --git a/wifi/aidl/default/aidl_struct_util.h b/wifi/aidl/default/aidl_struct_util.h
index 3da94dc..9a13672 100644
--- a/wifi/aidl/default/aidl_struct_util.h
+++ b/wifi/aidl/default/aidl_struct_util.h
@@ -20,7 +20,10 @@
 #include <aidl/android/hardware/wifi/IWifiChip.h>
 #include <aidl/android/hardware/wifi/IWifiChipEventCallback.h>
 #include <aidl/android/hardware/wifi/NanBandIndex.h>
+#include <aidl/android/hardware/wifi/StaBackgroundScanBucketEventReportSchemeMask.h>
+#include <aidl/android/hardware/wifi/StaScanDataFlagMask.h>
 #include <aidl/android/hardware/wifi/WifiDebugRingBufferFlags.h>
+#include <aidl/android/hardware/wifi/WifiIfaceMode.h>
 
 #include <vector>
 
diff --git a/wifi/aidl/default/wifi_chip.cpp b/wifi/aidl/default/wifi_chip.cpp
index 89edaa4..dd24e6b 100644
--- a/wifi/aidl/default/wifi_chip.cpp
+++ b/wifi/aidl/default/wifi_chip.cpp
@@ -455,7 +455,7 @@
                            &WifiChip::registerEventCallbackInternal, event_callback);
 }
 
-ndk::ScopedAStatus WifiChip::getCapabilities(IWifiChip::ChipCapabilityMask* _aidl_return) {
+ndk::ScopedAStatus WifiChip::getCapabilities(int32_t* _aidl_return) {
     return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
                            &WifiChip::getCapabilitiesInternal, _aidl_return);
 }
@@ -681,7 +681,7 @@
 
 ndk::ScopedAStatus WifiChip::setCoexUnsafeChannels(
         const std::vector<IWifiChip::CoexUnsafeChannel>& in_unsafeChannels,
-        CoexRestriction in_restrictions) {
+        int32_t in_restrictions) {
     return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
                            &WifiChip::setCoexUnsafeChannelsInternal, in_unsafeChannels,
                            in_restrictions);
@@ -692,8 +692,8 @@
                            &WifiChip::setCountryCodeInternal, in_code);
 }
 
-ndk::ScopedAStatus WifiChip::getUsableChannels(WifiBand in_band, WifiIfaceMode in_ifaceModeMask,
-                                               UsableChannelFilter in_filterMask,
+ndk::ScopedAStatus WifiChip::getUsableChannels(WifiBand in_band, int32_t in_ifaceModeMask,
+                                               int32_t in_filterMask,
                                                std::vector<WifiUsableChannel>* _aidl_return) {
     return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
                            &WifiChip::getUsableChannelsInternal, _aidl_return, in_band,
@@ -722,8 +722,7 @@
                            &WifiChip::getWifiChipCapabilitiesInternal, _aidl_return);
 }
 
-ndk::ScopedAStatus WifiChip::enableStaChannelForPeerNetwork(
-        ChannelCategoryMask in_channelCategoryEnableFlag) {
+ndk::ScopedAStatus WifiChip::enableStaChannelForPeerNetwork(int32_t in_channelCategoryEnableFlag) {
     return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
                            &WifiChip::enableStaChannelForPeerNetworkInternal,
                            in_channelCategoryEnableFlag);
@@ -787,7 +786,7 @@
     return ndk::ScopedAStatus::ok();
 }
 
-std::pair<IWifiChip::ChipCapabilityMask, ndk::ScopedAStatus> WifiChip::getCapabilitiesInternal() {
+std::pair<int32_t, ndk::ScopedAStatus> WifiChip::getCapabilitiesInternal() {
     legacy_hal::wifi_error legacy_status;
     uint64_t legacy_feature_set;
     uint32_t legacy_logger_feature_set;
@@ -795,7 +794,7 @@
     std::tie(legacy_status, legacy_feature_set) =
             legacy_hal_.lock()->getSupportedFeatureSet(ifname);
     if (legacy_status != legacy_hal::WIFI_SUCCESS) {
-        return {IWifiChip::ChipCapabilityMask{}, createWifiStatusFromLegacyError(legacy_status)};
+        return {0, createWifiStatusFromLegacyError(legacy_status)};
     }
     std::tie(legacy_status, legacy_logger_feature_set) =
             legacy_hal_.lock()->getLoggerSupportedFeatureSet(ifname);
@@ -806,9 +805,9 @@
     uint32_t aidl_caps;
     if (!aidl_struct_util::convertLegacyFeaturesToAidlChipCapabilities(legacy_feature_set,
                                                                        &aidl_caps)) {
-        return {IWifiChip::ChipCapabilityMask{}, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)};
+        return {0, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)};
     }
-    return {static_cast<IWifiChip::ChipCapabilityMask>(aidl_caps), ndk::ScopedAStatus::ok()};
+    return {aidl_caps, ndk::ScopedAStatus::ok()};
 }
 
 std::pair<std::vector<IWifiChip::ChipMode>, ndk::ScopedAStatus>
@@ -1385,13 +1384,12 @@
 }
 
 ndk::ScopedAStatus WifiChip::setCoexUnsafeChannelsInternal(
-        std::vector<IWifiChip::CoexUnsafeChannel> unsafe_channels, CoexRestriction restrictions) {
+        std::vector<IWifiChip::CoexUnsafeChannel> unsafe_channels, int32_t aidl_restrictions) {
     std::vector<legacy_hal::wifi_coex_unsafe_channel> legacy_unsafe_channels;
     if (!aidl_struct_util::convertAidlVectorOfCoexUnsafeChannelToLegacy(unsafe_channels,
                                                                         &legacy_unsafe_channels)) {
         return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
     }
-    uint32_t aidl_restrictions = static_cast<uint32_t>(restrictions);
     uint32_t legacy_restrictions = 0;
     if (aidl_restrictions & static_cast<uint32_t>(CoexRestriction::WIFI_DIRECT)) {
         legacy_restrictions |= legacy_hal::wifi_coex_restriction::WIFI_DIRECT;
@@ -1413,15 +1411,13 @@
 }
 
 std::pair<std::vector<WifiUsableChannel>, ndk::ScopedAStatus> WifiChip::getUsableChannelsInternal(
-        WifiBand band, WifiIfaceMode ifaceModeMask, UsableChannelFilter filterMask) {
+        WifiBand band, int32_t ifaceModeMask, int32_t filterMask) {
     legacy_hal::wifi_error legacy_status;
     std::vector<legacy_hal::wifi_usable_channel> legacy_usable_channels;
     std::tie(legacy_status, legacy_usable_channels) = legacy_hal_.lock()->getUsableChannels(
             aidl_struct_util::convertAidlWifiBandToLegacyMacBand(band),
-            aidl_struct_util::convertAidlWifiIfaceModeToLegacy(
-                    static_cast<uint32_t>(ifaceModeMask)),
-            aidl_struct_util::convertAidlUsableChannelFilterToLegacy(
-                    static_cast<uint32_t>(filterMask)));
+            aidl_struct_util::convertAidlWifiIfaceModeToLegacy(ifaceModeMask),
+            aidl_struct_util::convertAidlUsableChannelFilterToLegacy(filterMask));
 
     if (legacy_status != legacy_hal::WIFI_SUCCESS) {
         return {std::vector<WifiUsableChannel>(), createWifiStatusFromLegacyError(legacy_status)};
@@ -1483,10 +1479,9 @@
 }
 
 ndk::ScopedAStatus WifiChip::enableStaChannelForPeerNetworkInternal(
-        ChannelCategoryMask channelCategoryEnableFlag) {
+        int32_t channelCategoryEnableFlag) {
     auto legacy_status = legacy_hal_.lock()->enableStaChannelForPeerNetwork(
-            aidl_struct_util::convertAidlChannelCategoryToLegacy(
-                    static_cast<uint32_t>(channelCategoryEnableFlag)));
+            aidl_struct_util::convertAidlChannelCategoryToLegacy(channelCategoryEnableFlag));
     return createWifiStatusFromLegacyError(legacy_status);
 }
 
diff --git a/wifi/aidl/default/wifi_chip.h b/wifi/aidl/default/wifi_chip.h
index eca68ed..c5dcee7 100644
--- a/wifi/aidl/default/wifi_chip.h
+++ b/wifi/aidl/default/wifi_chip.h
@@ -85,7 +85,7 @@
     ndk::ScopedAStatus getId(int32_t* _aidl_return) override;
     ndk::ScopedAStatus registerEventCallback(
             const std::shared_ptr<IWifiChipEventCallback>& in_callback) override;
-    ndk::ScopedAStatus getCapabilities(IWifiChip::ChipCapabilityMask* _aidl_return) override;
+    ndk::ScopedAStatus getCapabilities(int32_t* _aidl_return) override;
     ndk::ScopedAStatus getAvailableModes(std::vector<IWifiChip::ChipMode>* _aidl_return) override;
     ndk::ScopedAStatus configureChip(int32_t in_modeId) override;
     ndk::ScopedAStatus getMode(int32_t* _aidl_return) override;
@@ -136,10 +136,10 @@
     ndk::ScopedAStatus setMultiStaUseCase(IWifiChip::MultiStaUseCase in_useCase) override;
     ndk::ScopedAStatus setCoexUnsafeChannels(
             const std::vector<IWifiChip::CoexUnsafeChannel>& in_unsafeChannels,
-            CoexRestriction in_restrictions) override;
+            int32_t in_restrictions) override;
     ndk::ScopedAStatus setCountryCode(const std::array<uint8_t, 2>& in_code) override;
-    ndk::ScopedAStatus getUsableChannels(WifiBand in_band, WifiIfaceMode in_ifaceModeMask,
-                                         UsableChannelFilter in_filterMask,
+    ndk::ScopedAStatus getUsableChannels(WifiBand in_band, int32_t in_ifaceModeMask,
+                                         int32_t in_filterMask,
                                          std::vector<WifiUsableChannel>* _aidl_return) override;
     ndk::ScopedAStatus setAfcChannelAllowance(
             const std::vector<AvailableAfcFrequencyInfo>& availableAfcFrequencyInfo) override;
@@ -148,7 +148,7 @@
             std::vector<WifiRadioCombination>* _aidl_return) override;
     ndk::ScopedAStatus getWifiChipCapabilities(WifiChipCapabilities* _aidl_return) override;
     ndk::ScopedAStatus enableStaChannelForPeerNetwork(
-            ChannelCategoryMask in_channelCategoryEnableFlag) override;
+            int32_t in_channelCategoryEnableFlag) override;
     binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
     ndk::ScopedAStatus setMloMode(const ChipMloMode in_mode) override;
 
@@ -162,7 +162,7 @@
     std::pair<int32_t, ndk::ScopedAStatus> getIdInternal();
     ndk::ScopedAStatus registerEventCallbackInternal(
             const std::shared_ptr<IWifiChipEventCallback>& event_callback);
-    std::pair<IWifiChip::ChipCapabilityMask, ndk::ScopedAStatus> getCapabilitiesInternal();
+    std::pair<int32_t, ndk::ScopedAStatus> getCapabilitiesInternal();
     std::pair<std::vector<IWifiChip::ChipMode>, ndk::ScopedAStatus> getAvailableModesInternal();
     ndk::ScopedAStatus configureChipInternal(std::unique_lock<std::recursive_mutex>* lock,
                                              int32_t mode_id);
@@ -214,13 +214,11 @@
     ndk::ScopedAStatus setMultiStaPrimaryConnectionInternal(const std::string& ifname);
     ndk::ScopedAStatus setMultiStaUseCaseInternal(IWifiChip::MultiStaUseCase use_case);
     ndk::ScopedAStatus setCoexUnsafeChannelsInternal(
-            std::vector<IWifiChip::CoexUnsafeChannel> unsafe_channels,
-            CoexRestriction restrictions);
+            std::vector<IWifiChip::CoexUnsafeChannel> unsafe_channels, int32_t restrictions);
     ndk::ScopedAStatus setCountryCodeInternal(const std::array<uint8_t, 2>& in_code);
     std::pair<std::vector<WifiUsableChannel>, ndk::ScopedAStatus> getUsableChannelsInternal(
-            WifiBand band, WifiIfaceMode ifaceModeMask, UsableChannelFilter filterMask);
-    ndk::ScopedAStatus enableStaChannelForPeerNetworkInternal(
-            ChannelCategoryMask channelCategoryEnableFlag);
+            WifiBand band, int32_t ifaceModeMask, int32_t filterMask);
+    ndk::ScopedAStatus enableStaChannelForPeerNetworkInternal(int32_t channelCategoryEnableFlag);
     ndk::ScopedAStatus setAfcChannelAllowanceInternal(
             const std::vector<AvailableAfcFrequencyInfo>& availableAfcFrequencyInfo);
     ndk::ScopedAStatus handleChipConfiguration(std::unique_lock<std::recursive_mutex>* lock,
diff --git a/wifi/aidl/default/wifi_sta_iface.cpp b/wifi/aidl/default/wifi_sta_iface.cpp
index 300316a..eceeeb5 100644
--- a/wifi/aidl/default/wifi_sta_iface.cpp
+++ b/wifi/aidl/default/wifi_sta_iface.cpp
@@ -82,8 +82,7 @@
                            &WifiStaIface::registerEventCallbackInternal, in_callback);
 }
 
-ndk::ScopedAStatus WifiStaIface::getCapabilities(
-        IWifiStaIface::StaIfaceCapabilityMask* _aidl_return) {
+ndk::ScopedAStatus WifiStaIface::getCapabilities(int32_t* _aidl_return) {
     return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
                            &WifiStaIface::getCapabilitiesInternal, _aidl_return);
 }
@@ -239,24 +238,20 @@
     return ndk::ScopedAStatus::ok();
 }
 
-std::pair<IWifiStaIface::StaIfaceCapabilityMask, ndk::ScopedAStatus>
-WifiStaIface::getCapabilitiesInternal() {
+std::pair<int32_t, ndk::ScopedAStatus> WifiStaIface::getCapabilitiesInternal() {
     legacy_hal::wifi_error legacy_status;
     uint64_t legacy_feature_set;
     std::tie(legacy_status, legacy_feature_set) =
             legacy_hal_.lock()->getSupportedFeatureSet(ifname_);
     if (legacy_status != legacy_hal::WIFI_SUCCESS) {
-        return {IWifiStaIface::StaIfaceCapabilityMask{},
-                createWifiStatusFromLegacyError(legacy_status)};
+        return {0, createWifiStatusFromLegacyError(legacy_status)};
     }
     uint32_t aidl_caps;
     if (!aidl_struct_util::convertLegacyFeaturesToAidlStaCapabilities(legacy_feature_set,
                                                                       &aidl_caps)) {
-        return {IWifiStaIface::StaIfaceCapabilityMask{},
-                createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)};
+        return {0, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)};
     }
-    return {static_cast<IWifiStaIface::StaIfaceCapabilityMask>(aidl_caps),
-            ndk::ScopedAStatus::ok()};
+    return {aidl_caps, ndk::ScopedAStatus::ok()};
 }
 
 std::pair<StaApfPacketFilterCapabilities, ndk::ScopedAStatus>
diff --git a/wifi/aidl/default/wifi_sta_iface.h b/wifi/aidl/default/wifi_sta_iface.h
index 2e4403a..0831e16 100644
--- a/wifi/aidl/default/wifi_sta_iface.h
+++ b/wifi/aidl/default/wifi_sta_iface.h
@@ -54,8 +54,7 @@
     ndk::ScopedAStatus getName(std::string* _aidl_return) override;
     ndk::ScopedAStatus registerEventCallback(
             const std::shared_ptr<IWifiStaIfaceEventCallback>& in_callback) override;
-    ndk::ScopedAStatus getCapabilities(
-            IWifiStaIface::StaIfaceCapabilityMask* _aidl_return) override;
+    ndk::ScopedAStatus getCapabilities(int32_t* _aidl_return) override;
     ndk::ScopedAStatus getApfPacketFilterCapabilities(
             StaApfPacketFilterCapabilities* _aidl_return) override;
     ndk::ScopedAStatus installApfPacketFilter(const std::vector<uint8_t>& in_program) override;
@@ -99,7 +98,7 @@
     std::pair<std::string, ndk::ScopedAStatus> getNameInternal();
     ndk::ScopedAStatus registerEventCallbackInternal(
             const std::shared_ptr<IWifiStaIfaceEventCallback>& callback);
-    std::pair<IWifiStaIface::StaIfaceCapabilityMask, ndk::ScopedAStatus> getCapabilitiesInternal();
+    std::pair<int32_t, ndk::ScopedAStatus> getCapabilitiesInternal();
     std::pair<StaApfPacketFilterCapabilities, ndk::ScopedAStatus>
     getApfPacketFilterCapabilitiesInternal();
     ndk::ScopedAStatus installApfPacketFilterInternal(const std::vector<uint8_t>& program);
diff --git a/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp b/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp
index 463545b..4cf14a2 100644
--- a/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp
+++ b/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp
@@ -208,9 +208,9 @@
 }
 
 int32_t getChipCapabilities(const std::shared_ptr<IWifiChip>& wifi_chip) {
-    IWifiChip::ChipCapabilityMask caps = {};
+    int32_t caps = 0;
     if (wifi_chip->getCapabilities(&caps).isOk()) {
-        return static_cast<int32_t>(caps);
+        return caps;
     }
     return 0;
 }
diff --git a/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp
index d0b7014..dbff949 100644
--- a/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp
+++ b/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp
@@ -22,6 +22,7 @@
 #include <aidl/Vintf.h>
 #include <aidl/android/hardware/wifi/BnWifi.h>
 #include <aidl/android/hardware/wifi/BnWifiChipEventCallback.h>
+#include <aidl/android/hardware/wifi/WifiIfaceMode.h>
 #include <android/binder_manager.h>
 #include <android/binder_status.h>
 #include <binder/IServiceManager.h>
@@ -232,9 +233,7 @@
 
     std::vector<WifiUsableChannel> channels;
     configureChipForConcurrencyType(IfaceConcurrencyType::STA);
-    auto status = wifi_chip_->getUsableChannels(
-            band, static_cast<WifiIfaceMode>(ifaceModeMask),
-            static_cast<IWifiChip::UsableChannelFilter>(filterMask), &channels);
+    auto status = wifi_chip_->getUsableChannels(band, ifaceModeMask, filterMask, &channels);
     if (checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED)) {
         GTEST_SKIP() << "getUsableChannels() is not supported by vendor.";
     }
@@ -337,7 +336,7 @@
 
     // Test with an empty vector of CoexUnsafeChannels.
     std::vector<IWifiChip::CoexUnsafeChannel> vec;
-    IWifiChip::CoexRestriction restrictions = static_cast<IWifiChip::CoexRestriction>(0);
+    int restrictions = 0;
     auto status = wifi_chip_->setCoexUnsafeChannels(vec, restrictions);
     if (!status.isOk()) {
         EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
@@ -352,10 +351,9 @@
     unsafeChannel5Ghz.band = WifiBand::BAND_5GHZ;
     unsafeChannel5Ghz.channel = 36;
     vec.push_back(unsafeChannel5Ghz);
-    restrictions = static_cast<IWifiChip::CoexRestriction>(
-            static_cast<int32_t>(IWifiChip::CoexRestriction::WIFI_AWARE) |
-            static_cast<int32_t>(IWifiChip::CoexRestriction::SOFTAP) |
-            static_cast<int32_t>(IWifiChip::CoexRestriction::WIFI_DIRECT));
+    restrictions = static_cast<int32_t>(IWifiChip::CoexRestriction::WIFI_AWARE) |
+                   static_cast<int32_t>(IWifiChip::CoexRestriction::SOFTAP) |
+                   static_cast<int32_t>(IWifiChip::CoexRestriction::WIFI_DIRECT);
 
     status = wifi_chip_->setCoexUnsafeChannels(vec, restrictions);
     if (!status.isOk()) {
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 fe32be5..b772bc3 100644
--- a/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
+++ b/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
@@ -54,9 +54,9 @@
 
   protected:
     bool isCapabilitySupported(IWifiStaIface::StaIfaceCapabilityMask expected) {
-        IWifiStaIface::StaIfaceCapabilityMask caps = {};
+        int32_t caps = 0;
         EXPECT_TRUE(wifi_sta_iface_->getCapabilities(&caps).isOk());
-        return static_cast<uint32_t>(caps) & static_cast<uint32_t>(expected);
+        return caps & static_cast<int32_t>(expected);
     }
 
     ndk::ScopedAStatus createStaIface(std::shared_ptr<IWifiStaIface>* sta_iface) {
@@ -86,9 +86,9 @@
  * GetCapabilities
  */
 TEST_P(WifiStaIfaceAidlTest, GetCapabilities) {
-    IWifiStaIface::StaIfaceCapabilityMask caps = {};
+    int32_t caps = 0;
     EXPECT_TRUE(wifi_sta_iface_->getCapabilities(&caps).isOk());
-    EXPECT_NE(static_cast<int32_t>(caps), 0);
+    EXPECT_NE(caps, 0);
 }
 
 /*