Merge "Add VTS for setSimCardPower_1_6" am: fb4367c319

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1493663

Change-Id: I5f3301e3bb0ddaf214e4f6f1a05ab8358edfdef8
This commit is contained in:
Jordan Liu 2020-12-01 22:38:48 +00:00 committed by Automerger Merge Worker
commit eada45e9a6
3 changed files with 54 additions and 4 deletions

View file

@ -217,6 +217,13 @@ interface IRadio extends @1.5::IRadio {
* Each subsequent request to this method is processed only after the
* completion of the previous one.
*
* When the SIM is in POWER_DOWN, the modem should send an empty vector of
* AppStatus in CardStatus.applications. If a SIM in the POWER_DOWN state
* is removed and a new SIM is inserted, the new SIM should be in POWER_UP
* mode by default. If the device is turned off or restarted while the SIM
* is in POWER_DOWN, then the SIM should turn on normally in POWER_UP mode
* when the device turns back on.
*
* Response callback is IRadioResponse.setSimCardPowerResponse_1_6().
* Note that this differs from setSimCardPower_1_1 in that the response
* callback should only be sent once the device has finished executing

View file

@ -207,7 +207,6 @@ interface IRadioResponse extends @1.5::IRadioResponse {
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:INVALID_ARGUMENTS
* RadioError:SIM_ERR (indicates a timeout or other issue making the SIM unresponsive)
*

View file

@ -320,7 +320,6 @@ TEST_P(RadioHidlTest_v1_6, setDataThrottling) {
res = radio_v1_6->setDataThrottling(serial, DataThrottlingAction::THROTTLE_ANCHOR_CARRIER, 60);
ASSERT_OK(res);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type);
EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial);
@ -350,7 +349,6 @@ TEST_P(RadioHidlTest_v1_6, setDataThrottling) {
res = radio_v1_6->setDataThrottling(serial, DataThrottlingAction::NO_DATA_THROTTLING, 60);
ASSERT_OK(res);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type);
EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial);
@ -360,4 +358,50 @@ TEST_P(RadioHidlTest_v1_6, setDataThrottling) {
::android::hardware::radio::V1_6::RadioError::MODEM_ERR,
::android::hardware::radio::V1_6::RadioError::NONE,
::android::hardware::radio::V1_6::RadioError::INVALID_ARGUMENTS}));
}
}
/*
* Test IRadio.setSimCardPower_1_6() for the response returned.
*/
TEST_P(RadioHidlTest_v1_6, setSimCardPower_1_6) {
/* Test setSimCardPower power down */
serial = GetRandomSerialNumber();
radio_v1_6->setSimCardPower_1_6(serial, CardPowerState::POWER_DOWN);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type);
EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial);
ASSERT_TRUE(
CheckAnyOfErrors(radioRsp_v1_6->rspInfo.error,
{::android::hardware::radio::V1_6::RadioError::NONE,
::android::hardware::radio::V1_6::RadioError::INVALID_ARGUMENTS,
::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE}));
// setSimCardPower_1_6 does not return until the request is handled, and should not trigger
// CardState::ABSENT when turning off power
if (radioRsp_v1_6->rspInfo.error == ::android::hardware::radio::V1_6::RadioError::NONE) {
/* Wait some time for setting sim power down and then verify it */
updateSimCardStatus();
EXPECT_EQ(CardState::PRESENT, cardStatus.base.base.base.cardState);
// applications should be an empty vector of AppStatus
EXPECT_EQ(0, cardStatus.applications.size());
}
/* Test setSimCardPower power up */
serial = GetRandomSerialNumber();
radio_v1_6->setSimCardPower_1_6(serial, CardPowerState::POWER_UP);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type);
EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial);
ASSERT_TRUE(
CheckAnyOfErrors(radioRsp_v1_6->rspInfo.error,
{::android::hardware::radio::V1_6::RadioError::NONE,
::android::hardware::radio::V1_6::RadioError::INVALID_ARGUMENTS,
::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE}));
// setSimCardPower_1_6 does not return until the request is handled. Just verify that we still
// have CardState::PRESENT after turning the power back on
if (radioRsp_v1_6->rspInfo.error == ::android::hardware::radio::V1_6::RadioError::NONE) {
updateSimCardStatus();
EXPECT_EQ(CardState::PRESENT, cardStatus.base.base.base.cardState);
}
}