VTS setSystemSelectionChannels maintain current state

Test: atest VtsHalRadioTargetTest
Bug: 231271472
Change-Id: If261f548da102963130b8cd669eb6392c9270f9a
This commit is contained in:
Sarah Chin
2022-05-18 15:59:32 -07:00
parent ec60f05823
commit 479ec9e172
3 changed files with 23 additions and 5 deletions

View File

@@ -109,8 +109,9 @@ ndk::ScopedAStatus RadioNetworkResponse::getSignalStrengthResponse(
}
ndk::ScopedAStatus RadioNetworkResponse::getSystemSelectionChannelsResponse(
const RadioResponseInfo& info, const std::vector<RadioAccessSpecifier>& /*specifier*/) {
const RadioResponseInfo& info, const std::vector<RadioAccessSpecifier>& specifiers) {
rspInfo = info;
this->specifiers = specifiers;
parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}

View File

@@ -769,6 +769,16 @@ TEST_P(RadioNetworkTest, setLinkCapacityReportingCriteria_Geran) {
*/
TEST_P(RadioNetworkTest, setSystemSelectionChannels) {
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->getSystemSelectionChannels(serial);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
if (radioRsp_network->specifiers.size() == 0) {
// TODO (b/189255895): Throw an error once getSystemSelectionChannels is functional.
ALOGI("Skipped the test due to empty system selection channels.");
GTEST_SKIP();
}
std::vector<RadioAccessSpecifier> originalSpecifiers = radioRsp_network->specifiers;
RadioAccessSpecifierBands bandP900 =
RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
@@ -781,8 +791,8 @@ TEST_P(RadioNetworkTest, setSystemSelectionChannels) {
RadioAccessSpecifier specifier850 = {
.accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
ndk::ScopedAStatus res =
radio_network->setSystemSelectionChannels(serial, true, {specifierP900, specifier850});
serial = GetRandomSerialNumber();
res = radio_network->setSystemSelectionChannels(serial, true, {specifierP900, specifier850});
ASSERT_OK(res);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
@@ -795,8 +805,8 @@ TEST_P(RadioNetworkTest, setSystemSelectionChannels) {
if (radioRsp_network->rspInfo.error == RadioError::NONE) {
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->setSystemSelectionChannels(
serial, false, {specifierP900, specifier850});
res = radio_network->setSystemSelectionChannels(serial, false,
{specifierP900, specifier850});
ASSERT_OK(res);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
@@ -805,6 +815,12 @@ TEST_P(RadioNetworkTest, setSystemSelectionChannels) {
toString(radioRsp_network->rspInfo.error).c_str());
EXPECT_EQ(RadioError::NONE, radioRsp_network->rspInfo.error);
}
serial = GetRandomSerialNumber();
res = radio_network->setSystemSelectionChannels(serial, true, originalSpecifiers);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
}
/*

View File

@@ -45,6 +45,7 @@ class RadioNetworkResponse : public BnRadioNetworkResponse {
CellIdentity barringCellIdentity;
std::vector<BarringInfo> barringInfoList;
UsageSetting usageSetting;
std::vector<RadioAccessSpecifier> specifiers;
virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override;