Use an int to represent bitmaps in
the Vendor HAL AIDL interface.
Bug: 267819850
Test: atest VtsHalWifiChipTargetTest \
VtsHalWifiStaIfaceTargetTest \
VtsHalWifiApIfaceTargetTest \
VtsHalWifiNanIfaceTargetTest \
VtsHalWifiRttControllerTargetTest
Change-Id: Ic72496c654067b2db97109cc3dc9ff50f1f1d1dd
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/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);
}
/*