VTS: Fix IRadio.setAllowedCarriers and IRadio.nvResetConfig

1) IRadio.setAllowedCarriers
Fix IRadio.setAllowedCarriers to pass no restrictions.
Passing restrictions will block all other SIM cards until
a new IRadio.setAllowedCarriers with no restriction is
invoked. Even factory reset will not recover.

2) IRadio.nvResetConfig
IRadio.nvResetConfig with ResetNvType RELOAD causes radio restart.
All subsuquent scripts fail with cause RADIO_NOT_AVAILABLE.
Fix to use ResetNvType ERASE which does not restart the radio.

Test: VTS
Bug: 37946160

Change-Id: Ib671758414cc97e1a596358306f89eed13918c48
This commit is contained in:
Jayachandran C
2017-05-03 00:42:51 -07:00
parent d22e2c5a87
commit 21e28b71da

View File

@@ -556,7 +556,7 @@ TEST_F(RadioHidlTest, nvWriteCdmaPrl) {
TEST_F(RadioHidlTest, nvResetConfig) {
int serial = 1;
radio->nvResetConfig(++serial, ResetNvType::RELOAD);
radio->nvResetConfig(++serial, ResetNvType::ERASE);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
@@ -733,6 +733,8 @@ TEST_F(RadioHidlTest, getModemActivityInfo) {
TEST_F(RadioHidlTest, setAllowedCarriers) {
int serial = 1;
CarrierRestrictions carriers;
/* Carrier restriction with one carrier */
memset(&carriers, 0, sizeof(carriers));
carriers.allowedCarriers.resize(1);
carriers.excludedCarriers.resize(0);
@@ -749,6 +751,20 @@ TEST_F(RadioHidlTest, setAllowedCarriers) {
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
}
/* Reset back to no carrier restriction */
memset(&carriers, 0, sizeof(carriers));
carriers.allowedCarriers.resize(0);
carriers.excludedCarriers.resize(0);
radio->setAllowedCarriers(++serial, true, carriers);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
}
}
/*
@@ -816,4 +832,4 @@ TEST_F(RadioHidlTest, setSimCardPower) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE
|| radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
}
}
}