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

Commit e5e0792e authored by Sarah Chin's avatar Sarah Chin
Browse files

VTS setSystemSelectionChannels maintain current state

Test: atest VtsHalRadioTargetTest
Bug: 231271472
Change-Id: If261f548da102963130b8cd669eb6392c9270f9a
Merged-In: If261f548da102963130b8cd669eb6392c9270f9a
parent 5609b7b2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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();
}
+20 −4
Original line number Diff line number Diff line
@@ -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);
}

/*
+1 −0
Original line number Diff line number Diff line
@@ -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;