Rename getCapabilities to getFeatureSet
in IWifiChip and IWifiStaIface. Main purpose is to distinguish between the 2 capability methods in IWifiChip: - getCapabilities (renamed here) - getWifiChipCapabilities Bug: 267819850 Test: atest VtsHalWifiChipTargetTest \ VtsHalWifiStaIfaceTargetTest Change-Id: I03c15d652d02aef99b219c2d630b69acb4d9e43c
This commit is contained in:
parent
0040f27177
commit
2a391a09df
8 changed files with 50 additions and 50 deletions
|
@ -47,7 +47,7 @@ interface IWifiChip {
|
|||
@PropagateAllowBlocking android.hardware.wifi.IWifiApIface getApIface(in String ifname);
|
||||
String[] getApIfaceNames();
|
||||
android.hardware.wifi.IWifiChip.ChipMode[] getAvailableModes();
|
||||
int getCapabilities();
|
||||
int getFeatureSet();
|
||||
android.hardware.wifi.WifiDebugHostWakeReasonStats getDebugHostWakeReasonStats();
|
||||
android.hardware.wifi.WifiDebugRingBufferStatus[] getDebugRingBuffersStatus();
|
||||
int getId();
|
||||
|
@ -85,7 +85,7 @@ interface IWifiChip {
|
|||
void setMloMode(in android.hardware.wifi.IWifiChip.ChipMloMode mode);
|
||||
const int NO_POWER_CAP_CONSTANT = 0x7FFFFFFF;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum ChipCapabilityMask {
|
||||
enum FeatureSetMask {
|
||||
SET_TX_POWER_LIMIT = (1 << 0) /* 1 */,
|
||||
D2D_RTT = (1 << 1) /* 2 */,
|
||||
D2AP_RTT = (1 << 2) /* 4 */,
|
||||
|
|
|
@ -41,7 +41,7 @@ interface IWifiStaIface {
|
|||
void enableNdOffload(in boolean enable);
|
||||
android.hardware.wifi.StaApfPacketFilterCapabilities getApfPacketFilterCapabilities();
|
||||
android.hardware.wifi.StaBackgroundScanCapabilities getBackgroundScanCapabilities();
|
||||
int getCapabilities();
|
||||
int getFeatureSet();
|
||||
android.hardware.wifi.WifiDebugRxPacketFateReport[] getDebugRxPacketFates();
|
||||
android.hardware.wifi.WifiDebugTxPacketFateReport[] getDebugTxPacketFates();
|
||||
byte[6] getFactoryMacAddress();
|
||||
|
@ -63,7 +63,7 @@ interface IWifiStaIface {
|
|||
void stopSendingKeepAlivePackets(in int cmdId);
|
||||
void setDtimMultiplier(in int multiplier);
|
||||
@Backing(type="int") @VintfStability
|
||||
enum StaIfaceCapabilityMask {
|
||||
enum FeatureSetMask {
|
||||
APF = (1 << 0) /* 1 */,
|
||||
BACKGROUND_SCAN = (1 << 1) /* 2 */,
|
||||
LINK_LAYER_STATS = (1 << 2) /* 4 */,
|
||||
|
|
|
@ -44,7 +44,7 @@ interface IWifiChip {
|
|||
*/
|
||||
@VintfStability
|
||||
@Backing(type="int")
|
||||
enum ChipCapabilityMask {
|
||||
enum FeatureSetMask {
|
||||
/**
|
||||
* Set/Reset Tx Power limits.
|
||||
*/
|
||||
|
@ -582,15 +582,15 @@ interface IWifiChip {
|
|||
ChipMode[] getAvailableModes();
|
||||
|
||||
/**
|
||||
* Get the capabilities supported by this chip.
|
||||
* Get the features supported by this chip.
|
||||
*
|
||||
* @return Bitset of |ChipCapabilityMask| values.
|
||||
* @return Bitset of |FeatureSetMask| values.
|
||||
* @throws ServiceSpecificException with one of the following values:
|
||||
* |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
|
||||
* |WifiStatusCode.ERROR_NOT_AVAILABLE|,
|
||||
* |WifiStatusCode.ERROR_UNKNOWN|
|
||||
*/
|
||||
int getCapabilities();
|
||||
int getFeatureSet();
|
||||
|
||||
/**
|
||||
* API to retrieve the wifi wake up reason stats for debugging.
|
||||
|
|
|
@ -38,7 +38,7 @@ interface IWifiStaIface {
|
|||
*/
|
||||
@VintfStability
|
||||
@Backing(type="int")
|
||||
enum StaIfaceCapabilityMask {
|
||||
enum FeatureSetMask {
|
||||
/**
|
||||
* Support for APF APIs. APF (Android Packet Filter) is a
|
||||
* BPF-like packet filtering bytecode executed by the firmware.
|
||||
|
@ -190,15 +190,15 @@ interface IWifiStaIface {
|
|||
StaBackgroundScanCapabilities getBackgroundScanCapabilities();
|
||||
|
||||
/**
|
||||
* Get the capabilities supported by this STA iface.
|
||||
* Get the features supported by this STA iface.
|
||||
*
|
||||
* @return Bitset of |StaIfaceCapabilityMask| values.
|
||||
* @return Bitset of |FeatureSetMask| values.
|
||||
* @throws ServiceSpecificException with one of the following values:
|
||||
* |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
|
||||
* |WifiStatusCode.ERROR_NOT_AVAILABLE|,
|
||||
* |WifiStatusCode.ERROR_UNKNOWN|
|
||||
*/
|
||||
int getCapabilities();
|
||||
int getFeatureSet();
|
||||
|
||||
/**
|
||||
* API to retrieve the fates of inbound packets.
|
||||
|
|
|
@ -207,10 +207,10 @@ void stopWifiService(const char* instance_name) {
|
|||
}
|
||||
}
|
||||
|
||||
int32_t getChipCapabilities(const std::shared_ptr<IWifiChip>& wifi_chip) {
|
||||
int32_t caps = 0;
|
||||
if (wifi_chip->getCapabilities(&caps).isOk()) {
|
||||
return caps;
|
||||
int32_t getChipFeatureSet(const std::shared_ptr<IWifiChip>& wifi_chip) {
|
||||
int32_t features = 0;
|
||||
if (wifi_chip->getFeatureSet(&features).isOk()) {
|
||||
return features;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -44,6 +44,6 @@ bool configureChipToSupportConcurrencyType(const std::shared_ptr<IWifiChip>& wif
|
|||
IfaceConcurrencyType type, int* configured_mode_id);
|
||||
// Used to trigger IWifi.stop() at the end of every test.
|
||||
void stopWifiService(const char* instance_name);
|
||||
int32_t getChipCapabilities(const std::shared_ptr<IWifiChip>& wifi_chip);
|
||||
int32_t getChipFeatureSet(const std::shared_ptr<IWifiChip>& wifi_chip);
|
||||
bool checkStatusCode(ndk::ScopedAStatus* status, WifiStatusCode expected_code);
|
||||
bool isAidlServiceAvailable(const char* instance_name);
|
||||
|
|
|
@ -185,12 +185,12 @@ TEST_P(WifiChipAidlTest, RegisterEventCallback) {
|
|||
}
|
||||
|
||||
/*
|
||||
* GetCapabilities
|
||||
* GetFeatureSet
|
||||
*/
|
||||
TEST_P(WifiChipAidlTest, GetCapabilities) {
|
||||
TEST_P(WifiChipAidlTest, GetFeatureSet) {
|
||||
configureChipForConcurrencyType(IfaceConcurrencyType::STA);
|
||||
int32_t caps = getChipCapabilities(wifi_chip_);
|
||||
EXPECT_NE(static_cast<int32_t>(caps), 0);
|
||||
int32_t features = getChipFeatureSet(wifi_chip_);
|
||||
EXPECT_NE(features, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -269,9 +269,9 @@ TEST_P(WifiChipAidlTest, SetCountryCode) {
|
|||
*/
|
||||
TEST_P(WifiChipAidlTest, SetLatencyMode_normal) {
|
||||
configureChipForConcurrencyType(IfaceConcurrencyType::STA);
|
||||
int32_t caps = getChipCapabilities(wifi_chip_);
|
||||
int32_t features = getChipFeatureSet(wifi_chip_);
|
||||
auto status = wifi_chip_->setLatencyMode(IWifiChip::LatencyMode::NORMAL);
|
||||
if (caps & static_cast<int32_t>(IWifiChip::ChipCapabilityMask::SET_LATENCY_MODE)) {
|
||||
if (features & static_cast<int32_t>(IWifiChip::FeatureSetMask::SET_LATENCY_MODE)) {
|
||||
EXPECT_TRUE(status.isOk());
|
||||
} else {
|
||||
EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
|
||||
|
@ -284,9 +284,9 @@ TEST_P(WifiChipAidlTest, SetLatencyMode_normal) {
|
|||
*/
|
||||
TEST_P(WifiChipAidlTest, SetLatencyMode_low) {
|
||||
configureChipForConcurrencyType(IfaceConcurrencyType::STA);
|
||||
int32_t caps = getChipCapabilities(wifi_chip_);
|
||||
int32_t features = getChipFeatureSet(wifi_chip_);
|
||||
auto status = wifi_chip_->setLatencyMode(IWifiChip::LatencyMode::LOW);
|
||||
if (caps & static_cast<int32_t>(IWifiChip::ChipCapabilityMask::SET_LATENCY_MODE)) {
|
||||
if (features & static_cast<int32_t>(IWifiChip::FeatureSetMask::SET_LATENCY_MODE)) {
|
||||
EXPECT_TRUE(status.isOk());
|
||||
} else {
|
||||
EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
|
||||
|
@ -366,12 +366,12 @@ TEST_P(WifiChipAidlTest, SetCoexUnsafeChannels) {
|
|||
*/
|
||||
TEST_P(WifiChipAidlTest, SelectTxPowerScenario_body) {
|
||||
configureChipForConcurrencyType(IfaceConcurrencyType::STA);
|
||||
int32_t caps = getChipCapabilities(wifi_chip_);
|
||||
int32_t expected_caps =
|
||||
static_cast<int32_t>(IWifiChip::ChipCapabilityMask::SET_TX_POWER_LIMIT) |
|
||||
static_cast<int32_t>(IWifiChip::ChipCapabilityMask::USE_BODY_HEAD_SAR);
|
||||
int32_t features = getChipFeatureSet(wifi_chip_);
|
||||
int32_t expected_features =
|
||||
static_cast<int32_t>(IWifiChip::FeatureSetMask::SET_TX_POWER_LIMIT) |
|
||||
static_cast<int32_t>(IWifiChip::FeatureSetMask::USE_BODY_HEAD_SAR);
|
||||
auto status = wifi_chip_->selectTxPowerScenario(IWifiChip::TxPowerScenario::ON_BODY_CELL_OFF);
|
||||
if (caps & expected_caps) {
|
||||
if (features & expected_features) {
|
||||
EXPECT_TRUE(status.isOk());
|
||||
} else {
|
||||
EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
|
||||
|
@ -383,9 +383,9 @@ TEST_P(WifiChipAidlTest, SelectTxPowerScenario_body) {
|
|||
*/
|
||||
TEST_P(WifiChipAidlTest, SelectTxPowerScenario_voiceCall) {
|
||||
configureChipForConcurrencyType(IfaceConcurrencyType::STA);
|
||||
int32_t caps = getChipCapabilities(wifi_chip_);
|
||||
int32_t features = getChipFeatureSet(wifi_chip_);
|
||||
auto status = wifi_chip_->selectTxPowerScenario(IWifiChip::TxPowerScenario::VOICE_CALL);
|
||||
if (caps & static_cast<int32_t>(IWifiChip::ChipCapabilityMask::SET_TX_POWER_LIMIT)) {
|
||||
if (features & static_cast<int32_t>(IWifiChip::FeatureSetMask::SET_TX_POWER_LIMIT)) {
|
||||
EXPECT_TRUE(status.isOk());
|
||||
} else {
|
||||
EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
|
||||
|
@ -397,9 +397,9 @@ TEST_P(WifiChipAidlTest, SelectTxPowerScenario_voiceCall) {
|
|||
*/
|
||||
TEST_P(WifiChipAidlTest, ResetTxPowerScenario) {
|
||||
configureChipForConcurrencyType(IfaceConcurrencyType::STA);
|
||||
int32_t caps = getChipCapabilities(wifi_chip_);
|
||||
int32_t features = getChipFeatureSet(wifi_chip_);
|
||||
auto status = wifi_chip_->resetTxPowerScenario();
|
||||
if (caps & static_cast<int32_t>(IWifiChip::ChipCapabilityMask::SET_TX_POWER_LIMIT)) {
|
||||
if (features & static_cast<int32_t>(IWifiChip::FeatureSetMask::SET_TX_POWER_LIMIT)) {
|
||||
EXPECT_TRUE(status.isOk());
|
||||
} else {
|
||||
EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
|
||||
|
|
|
@ -53,10 +53,10 @@ class WifiStaIfaceAidlTest : public testing::TestWithParam<std::string> {
|
|||
void TearDown() override { stopWifiService(getInstanceName()); }
|
||||
|
||||
protected:
|
||||
bool isCapabilitySupported(IWifiStaIface::StaIfaceCapabilityMask expected) {
|
||||
int32_t caps = 0;
|
||||
EXPECT_TRUE(wifi_sta_iface_->getCapabilities(&caps).isOk());
|
||||
return caps & static_cast<int32_t>(expected);
|
||||
bool isFeatureSupported(IWifiStaIface::FeatureSetMask expected) {
|
||||
int32_t features = 0;
|
||||
EXPECT_TRUE(wifi_sta_iface_->getFeatureSet(&features).isOk());
|
||||
return features & static_cast<int32_t>(expected);
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus createStaIface(std::shared_ptr<IWifiStaIface>* sta_iface) {
|
||||
|
@ -83,19 +83,19 @@ TEST_P(WifiStaIfaceAidlTest, GetFactoryMacAddress) {
|
|||
}
|
||||
|
||||
/*
|
||||
* GetCapabilities
|
||||
* GetFeatureSet
|
||||
*/
|
||||
TEST_P(WifiStaIfaceAidlTest, GetCapabilities) {
|
||||
int32_t caps = 0;
|
||||
EXPECT_TRUE(wifi_sta_iface_->getCapabilities(&caps).isOk());
|
||||
EXPECT_NE(caps, 0);
|
||||
TEST_P(WifiStaIfaceAidlTest, GetFeatureSet) {
|
||||
int32_t features = 0;
|
||||
EXPECT_TRUE(wifi_sta_iface_->getFeatureSet(&features).isOk());
|
||||
EXPECT_NE(features, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* GetApfPacketFilterCapabilities
|
||||
*/
|
||||
TEST_P(WifiStaIfaceAidlTest, GetApfPacketFilterCapabilities) {
|
||||
if (!isCapabilitySupported(IWifiStaIface::StaIfaceCapabilityMask::APF)) {
|
||||
if (!isFeatureSupported(IWifiStaIface::FeatureSetMask::APF)) {
|
||||
GTEST_SKIP() << "APF packet filter capabilities are not supported.";
|
||||
}
|
||||
StaApfPacketFilterCapabilities apf_caps = {};
|
||||
|
@ -106,7 +106,7 @@ TEST_P(WifiStaIfaceAidlTest, GetApfPacketFilterCapabilities) {
|
|||
* GetBackgroundScanCapabilities
|
||||
*/
|
||||
TEST_P(WifiStaIfaceAidlTest, GetBackgroundScanCapabilities) {
|
||||
if (!isCapabilitySupported(IWifiStaIface::StaIfaceCapabilityMask::BACKGROUND_SCAN)) {
|
||||
if (!isFeatureSupported(IWifiStaIface::FeatureSetMask::BACKGROUND_SCAN)) {
|
||||
GTEST_SKIP() << "Background scan capabilities are not supported.";
|
||||
}
|
||||
StaBackgroundScanCapabilities caps = {};
|
||||
|
@ -129,7 +129,7 @@ TEST_P(WifiStaIfaceAidlTest, GetValidFrequenciesForBand) {
|
|||
* StaLinkLayerStats after link layer stats collection is enabled.
|
||||
*/
|
||||
TEST_P(WifiStaIfaceAidlTest, GetLinkLayerStats) {
|
||||
if (!isCapabilitySupported(IWifiStaIface::StaIfaceCapabilityMask::LINK_LAYER_STATS)) {
|
||||
if (!isFeatureSupported(IWifiStaIface::FeatureSetMask::LINK_LAYER_STATS)) {
|
||||
GTEST_SKIP() << "Skipping this test since link layer stats are not supported.";
|
||||
}
|
||||
|
||||
|
@ -176,7 +176,7 @@ TEST_P(WifiStaIfaceAidlTest, SetScanMode) {
|
|||
* LinkLayerStatsCollection
|
||||
*/
|
||||
TEST_P(WifiStaIfaceAidlTest, LinkLayerStatsCollection) {
|
||||
if (!isCapabilitySupported(IWifiStaIface::StaIfaceCapabilityMask::LINK_LAYER_STATS)) {
|
||||
if (!isFeatureSupported(IWifiStaIface::FeatureSetMask::LINK_LAYER_STATS)) {
|
||||
GTEST_SKIP() << "Link layer stats collection is not supported.";
|
||||
}
|
||||
|
||||
|
@ -197,7 +197,7 @@ TEST_P(WifiStaIfaceAidlTest, LinkLayerStatsCollection) {
|
|||
* if the device is not connected to an AP.
|
||||
*/
|
||||
TEST_P(WifiStaIfaceAidlTest, RSSIMonitoring) {
|
||||
if (!isCapabilitySupported(IWifiStaIface::StaIfaceCapabilityMask::RSSI_MONITOR)) {
|
||||
if (!isFeatureSupported(IWifiStaIface::FeatureSetMask::RSSI_MONITOR)) {
|
||||
GTEST_SKIP() << "RSSI monitoring is not supported.";
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ TEST_P(WifiStaIfaceAidlTest, RSSIMonitoring) {
|
|||
* RoamingControl
|
||||
*/
|
||||
TEST_P(WifiStaIfaceAidlTest, RoamingControl) {
|
||||
if (!isCapabilitySupported(IWifiStaIface::StaIfaceCapabilityMask::CONTROL_ROAMING)) {
|
||||
if (!isFeatureSupported(IWifiStaIface::FeatureSetMask::CONTROL_ROAMING)) {
|
||||
GTEST_SKIP() << "Roaming control is not supported.";
|
||||
}
|
||||
|
||||
|
@ -245,7 +245,7 @@ TEST_P(WifiStaIfaceAidlTest, RoamingControl) {
|
|||
* EnableNDOffload
|
||||
*/
|
||||
TEST_P(WifiStaIfaceAidlTest, EnableNDOffload) {
|
||||
if (!isCapabilitySupported(IWifiStaIface::StaIfaceCapabilityMask::ND_OFFLOAD)) {
|
||||
if (!isFeatureSupported(IWifiStaIface::FeatureSetMask::ND_OFFLOAD)) {
|
||||
GTEST_SKIP() << "ND offload is not supported.";
|
||||
}
|
||||
EXPECT_TRUE(wifi_sta_iface_->enableNdOffload(true).isOk());
|
||||
|
|
Loading…
Reference in a new issue