Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72ce6160 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "VTS test for setAfcChannelAllowance" into main

parents a9dd82ea f8b931ba
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -30,6 +30,9 @@

#include "wifi_aidl_test_utils.h"

using aidl::android::hardware::wifi::AfcChannelAllowance;
using aidl::android::hardware::wifi::AvailableAfcChannelInfo;
using aidl::android::hardware::wifi::AvailableAfcFrequencyInfo;
using aidl::android::hardware::wifi::BnWifiChipEventCallback;
using aidl::android::hardware::wifi::IfaceType;
using aidl::android::hardware::wifi::IWifiApIface;
@@ -270,6 +273,23 @@ TEST_P(WifiChipAidlTest, SetCountryCode) {
    EXPECT_TRUE(wifi_chip_->setCountryCode(country_code).isOk());
}

/*
 * Tests the setAfcChannelAllowance() API.
 */
TEST_P(WifiChipAidlTest, SetAfcChannelAllowance) {
    configureChipForConcurrencyType(IfaceConcurrencyType::STA);
    int32_t features = getChipFeatureSet(wifi_chip_);
    AfcChannelAllowance allowance;
    allowance.availableAfcChannelInfos = std::vector<AvailableAfcChannelInfo>();
    allowance.availableAfcFrequencyInfos = std::vector<AvailableAfcFrequencyInfo>();
    auto status = wifi_chip_->setAfcChannelAllowance(allowance);
    if (features & static_cast<int32_t>(IWifiChip::FeatureSetMask::SET_AFC_CHANNEL_ALLOWANCE)) {
        EXPECT_TRUE(status.isOk());
    } else {
        EXPECT_TRUE(checkStatusCode(&status, WifiStatusCode::ERROR_NOT_SUPPORTED));
    }
}

/*
 * SetLatencyMode_normal
 * Tests the setLatencyMode() API with Latency mode NORMAL.