mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Merge "Remove deprecated method getValidFrequenciesForBand from IWifiApIface and IWifiStaIface." into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c939532af1
@@ -38,7 +38,6 @@ interface IWifiApIface {
|
||||
String[] getBridgedInstances();
|
||||
byte[6] getFactoryMacAddress();
|
||||
void setCountryCode(in byte[2] code);
|
||||
int[] getValidFrequenciesForBand(in android.hardware.wifi.WifiBand band);
|
||||
void resetToFactoryMacAddress();
|
||||
void setMacAddress(in byte[6] mac);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@ interface IWifiStaIface {
|
||||
byte[6] getFactoryMacAddress();
|
||||
android.hardware.wifi.StaLinkLayerStats getLinkLayerStats();
|
||||
android.hardware.wifi.StaRoamingCapabilities getRoamingCapabilities();
|
||||
int[] getValidFrequenciesForBand(in android.hardware.wifi.WifiBand band);
|
||||
void installApfPacketFilter(in byte[] program);
|
||||
byte[] readApfPacketFilterData();
|
||||
void registerEventCallback(in android.hardware.wifi.IWifiStaIfaceEventCallback callback);
|
||||
|
||||
@@ -67,20 +67,6 @@ interface IWifiApIface {
|
||||
*/
|
||||
void setCountryCode(in byte[2] code);
|
||||
|
||||
/**
|
||||
* Used to query the list of valid frequencies (depending on country code set)
|
||||
* for the provided band.
|
||||
*
|
||||
* @param band Band for which the frequency list is being generated.
|
||||
* @return Vector of valid frequencies for the provided band.
|
||||
* @throws ServiceSpecificException with one of the following values:
|
||||
* |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
|
||||
* |WifiStatusCode.ERROR_NOT_SUPPORTED|,
|
||||
* |WifiStatusCode.ERROR_NOT_AVAILABLE|,
|
||||
* |WifiStatusCode.ERROR_UNKNOWN|
|
||||
*/
|
||||
int[] getValidFrequenciesForBand(in WifiBand band);
|
||||
|
||||
/**
|
||||
* Reset all of the AP interfaces' MAC address to the factory MAC address.
|
||||
*
|
||||
|
||||
@@ -287,22 +287,6 @@ interface IWifiStaIface {
|
||||
*/
|
||||
StaRoamingCapabilities getRoamingCapabilities();
|
||||
|
||||
/**
|
||||
* Used to query the list of valid frequencies (depending on the country
|
||||
* code set) for the provided band. These channels may be specified in the
|
||||
* |BackgroundScanBucketParameters.frequenciesInMhz| for a background scan
|
||||
* request.
|
||||
*
|
||||
* @param band Band for which the frequency list is being generated.
|
||||
* @return Vector of valid frequencies for the provided band.
|
||||
* @throws ServiceSpecificException with one of the following values:
|
||||
* |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
|
||||
* |WifiStatusCode.ERROR_NOT_SUPPORTED|,
|
||||
* |WifiStatusCode.ERROR_NOT_AVAILABLE|,
|
||||
* |WifiStatusCode.ERROR_UNKNOWN|
|
||||
*/
|
||||
int[] getValidFrequenciesForBand(in WifiBand band);
|
||||
|
||||
/**
|
||||
* Installs an APF program on this iface, replacing an existing
|
||||
* program if present.
|
||||
|
||||
@@ -64,12 +64,6 @@ ndk::ScopedAStatus WifiApIface::setCountryCode(const std::array<uint8_t, 2>& in_
|
||||
&WifiApIface::setCountryCodeInternal, in_code);
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus WifiApIface::getValidFrequenciesForBand(WifiBand in_band,
|
||||
std::vector<int32_t>* _aidl_return) {
|
||||
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
|
||||
&WifiApIface::getValidFrequenciesForBandInternal, _aidl_return, in_band);
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus WifiApIface::setMacAddress(const std::array<uint8_t, 6>& in_mac) {
|
||||
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
|
||||
&WifiApIface::setMacAddressInternal, in_mac);
|
||||
@@ -101,18 +95,6 @@ ndk::ScopedAStatus WifiApIface::setCountryCodeInternal(const std::array<uint8_t,
|
||||
return createWifiStatusFromLegacyError(legacy_status);
|
||||
}
|
||||
|
||||
std::pair<std::vector<int32_t>, ndk::ScopedAStatus> WifiApIface::getValidFrequenciesForBandInternal(
|
||||
WifiBand band) {
|
||||
static_assert(sizeof(WifiChannelWidthInMhz) == sizeof(int32_t), "Size mismatch");
|
||||
legacy_hal::wifi_error legacy_status;
|
||||
std::vector<uint32_t> valid_frequencies;
|
||||
std::tie(legacy_status, valid_frequencies) = legacy_hal_.lock()->getValidFrequenciesForBand(
|
||||
instances_.size() > 0 ? instances_[0] : ifname_,
|
||||
aidl_struct_util::convertAidlWifiBandToLegacy(band));
|
||||
return {std::vector<int32_t>(valid_frequencies.begin(), valid_frequencies.end()),
|
||||
createWifiStatusFromLegacyError(legacy_status)};
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus WifiApIface::setMacAddressInternal(const std::array<uint8_t, 6>& mac) {
|
||||
// Support random MAC up to 2 interfaces
|
||||
if (instances_.size() == 2) {
|
||||
|
||||
@@ -45,8 +45,6 @@ class WifiApIface : public BnWifiApIface {
|
||||
// AIDL methods exposed.
|
||||
ndk::ScopedAStatus getName(std::string* _aidl_return) override;
|
||||
ndk::ScopedAStatus setCountryCode(const std::array<uint8_t, 2>& in_code) override;
|
||||
ndk::ScopedAStatus getValidFrequenciesForBand(WifiBand in_band,
|
||||
std::vector<int32_t>* _aidl_return) override;
|
||||
ndk::ScopedAStatus setMacAddress(const std::array<uint8_t, 6>& in_mac) override;
|
||||
ndk::ScopedAStatus getFactoryMacAddress(std::array<uint8_t, 6>* _aidl_return) override;
|
||||
ndk::ScopedAStatus resetToFactoryMacAddress() override;
|
||||
@@ -56,8 +54,6 @@ class WifiApIface : public BnWifiApIface {
|
||||
// Corresponding worker functions for the AIDL methods.
|
||||
std::pair<std::string, ndk::ScopedAStatus> getNameInternal();
|
||||
ndk::ScopedAStatus setCountryCodeInternal(const std::array<uint8_t, 2>& code);
|
||||
std::pair<std::vector<int32_t>, ndk::ScopedAStatus> getValidFrequenciesForBandInternal(
|
||||
WifiBand band);
|
||||
ndk::ScopedAStatus setMacAddressInternal(const std::array<uint8_t, 6>& mac);
|
||||
std::pair<std::array<uint8_t, 6>, ndk::ScopedAStatus> getFactoryMacAddressInternal(
|
||||
const std::string& ifaceName);
|
||||
|
||||
@@ -109,13 +109,6 @@ ndk::ScopedAStatus WifiStaIface::getBackgroundScanCapabilities(
|
||||
&WifiStaIface::getBackgroundScanCapabilitiesInternal, _aidl_return);
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus WifiStaIface::getValidFrequenciesForBand(WifiBand in_band,
|
||||
std::vector<int32_t>* _aidl_return) {
|
||||
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
|
||||
&WifiStaIface::getValidFrequenciesForBandInternal, _aidl_return,
|
||||
in_band);
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus WifiStaIface::startBackgroundScan(int32_t in_cmdId,
|
||||
const StaBackgroundScanParameters& in_params) {
|
||||
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
|
||||
@@ -298,17 +291,6 @@ WifiStaIface::getBackgroundScanCapabilitiesInternal() {
|
||||
return {aidl_caps, ndk::ScopedAStatus::ok()};
|
||||
}
|
||||
|
||||
std::pair<std::vector<int32_t>, ndk::ScopedAStatus>
|
||||
WifiStaIface::getValidFrequenciesForBandInternal(WifiBand band) {
|
||||
static_assert(sizeof(WifiChannelWidthInMhz) == sizeof(int32_t), "Size mismatch");
|
||||
legacy_hal::wifi_error legacy_status;
|
||||
std::vector<uint32_t> valid_frequencies;
|
||||
std::tie(legacy_status, valid_frequencies) = legacy_hal_.lock()->getValidFrequenciesForBand(
|
||||
ifname_, aidl_struct_util::convertAidlWifiBandToLegacy(band));
|
||||
return {std::vector<int32_t>(valid_frequencies.begin(), valid_frequencies.end()),
|
||||
createWifiStatusFromLegacyError(legacy_status)};
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus WifiStaIface::startBackgroundScanInternal(
|
||||
int32_t cmd_id, const StaBackgroundScanParameters& params) {
|
||||
legacy_hal::wifi_scan_cmd_params legacy_params;
|
||||
|
||||
@@ -61,8 +61,6 @@ class WifiStaIface : public BnWifiStaIface {
|
||||
ndk::ScopedAStatus readApfPacketFilterData(std::vector<uint8_t>* _aidl_return) override;
|
||||
ndk::ScopedAStatus getBackgroundScanCapabilities(
|
||||
StaBackgroundScanCapabilities* _aidl_return) override;
|
||||
ndk::ScopedAStatus getValidFrequenciesForBand(WifiBand in_band,
|
||||
std::vector<int32_t>* _aidl_return) override;
|
||||
ndk::ScopedAStatus startBackgroundScan(int32_t in_cmdId,
|
||||
const StaBackgroundScanParameters& in_params) override;
|
||||
ndk::ScopedAStatus stopBackgroundScan(int32_t in_cmdId) override;
|
||||
@@ -105,8 +103,6 @@ class WifiStaIface : public BnWifiStaIface {
|
||||
std::pair<std::vector<uint8_t>, ndk::ScopedAStatus> readApfPacketFilterDataInternal();
|
||||
std::pair<StaBackgroundScanCapabilities, ndk::ScopedAStatus>
|
||||
getBackgroundScanCapabilitiesInternal();
|
||||
std::pair<std::vector<int32_t>, ndk::ScopedAStatus> getValidFrequenciesForBandInternal(
|
||||
WifiBand band);
|
||||
ndk::ScopedAStatus startBackgroundScanInternal(int32_t cmd_id,
|
||||
const StaBackgroundScanParameters& params);
|
||||
ndk::ScopedAStatus stopBackgroundScanInternal(int32_t cmd_id);
|
||||
|
||||
@@ -67,19 +67,6 @@ TEST_P(WifiApIfaceAidlTest, SetCountryCode) {
|
||||
EXPECT_TRUE(wifi_ap_iface->setCountryCode(country_code).isOk());
|
||||
}
|
||||
|
||||
/*
|
||||
* GetValidFrequenciesForBand
|
||||
* Ensures that we can retrieve valid frequencies for the 2.4 GHz band.
|
||||
*/
|
||||
TEST_P(WifiApIfaceAidlTest, GetValidFrequenciesForBand) {
|
||||
std::shared_ptr<IWifiApIface> wifi_ap_iface = getWifiApIface(getInstanceName());
|
||||
ASSERT_NE(nullptr, wifi_ap_iface.get());
|
||||
|
||||
std::vector<int32_t> freqs;
|
||||
EXPECT_TRUE(wifi_ap_iface->getValidFrequenciesForBand(WifiBand::BAND_24GHZ, &freqs).isOk());
|
||||
EXPECT_NE(freqs.size(), 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* GetFactoryMacAddress
|
||||
*/
|
||||
|
||||
@@ -113,16 +113,6 @@ TEST_P(WifiStaIfaceAidlTest, GetBackgroundScanCapabilities) {
|
||||
EXPECT_TRUE(wifi_sta_iface_->getBackgroundScanCapabilities(&caps).isOk());
|
||||
}
|
||||
|
||||
/*
|
||||
* GetValidFrequenciesForBand
|
||||
* Ensures that we can retrieve valid frequencies for the 2.4 GHz band.
|
||||
*/
|
||||
TEST_P(WifiStaIfaceAidlTest, GetValidFrequenciesForBand) {
|
||||
std::vector<int> freqs;
|
||||
EXPECT_TRUE(wifi_sta_iface_->getValidFrequenciesForBand(WifiBand::BAND_24GHZ, &freqs).isOk());
|
||||
EXPECT_NE(freqs.size(), 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* GetLinkLayerStats
|
||||
* Ensures that calls to getLinkLayerStats will retrieve a non-empty
|
||||
|
||||
Reference in New Issue
Block a user