Waiting 10s at the beginning of getBarringInfo test if not yet in-service. am: 772801bf8a

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

Change-Id: I85af11ba995cba90fe58fa7b8d060086550122e5
This commit is contained in:
Aaron Tsai
2021-07-22 08:26:52 +00:00
committed by Automerger Merge Worker
3 changed files with 19 additions and 2 deletions

View File

@@ -1251,8 +1251,20 @@ TEST_P(RadioHidlTest_v1_5, sendCdmaSmsExpectMore) {
* Test IRadio.getBarringInfo() for the response returned.
*/
TEST_P(RadioHidlTest_v1_5, getBarringInfo) {
// If the previous setRadioPower_1_5_emergencyCall_cancelled test has just finished.
// Due to radio restarting, modem may need a little more time to acquire network service
// and barring infos. If voice status is in-service, waiting 3s to get barring infos ready.
// Or waiting 10s if voice status is not in-service.
serial = GetRandomSerialNumber();
radio_v1_5->getVoiceRegistrationState_1_5(serial);
EXPECT_EQ(std::cv_status::no_timeout, wait());
if (isVoiceInService(radioRsp_v1_5->voiceRegResp.regState)) {
sleep(BARRING_INFO_MAX_WAIT_TIME_SECONDS);
} else {
sleep(VOICE_SERVICE_MAX_WAIT_TIME_SECONDS);
}
serial = GetRandomSerialNumber();
Return<void> res = radio_v1_5->getBarringInfo(serial);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_5->rspInfo.type);

View File

@@ -51,6 +51,8 @@ using ::android::hardware::Void;
#define TIMEOUT_PERIOD 75
#define MODEM_EMERGENCY_CALL_ESTABLISH_TIME 3
#define MODEM_EMERGENCY_CALL_DISCONNECT_TIME 3
#define VOICE_SERVICE_MAX_WAIT_TIME_SECONDS 10
#define BARRING_INFO_MAX_WAIT_TIME_SECONDS 3
#define RADIO_SERVICE_NAME "slot1"
@@ -69,6 +71,7 @@ class RadioResponse_v1_5 : public ::android::hardware::radio::V1_5::IRadioRespon
// Call
hidl_vec<::android::hardware::radio::V1_2::Call> currentCalls;
::android::hardware::radio::V1_2::VoiceRegStateResult voiceRegResp;
// Modem
bool isModemEnabled;

View File

@@ -763,8 +763,9 @@ Return<void> RadioResponse_v1_5::getCellInfoListResponse_1_2(
Return<void> RadioResponse_v1_5::getVoiceRegistrationStateResponse_1_2(
const RadioResponseInfo& info,
const ::android::hardware::radio::V1_2::VoiceRegStateResult& /*voiceRegResponse*/) {
const ::android::hardware::radio::V1_2::VoiceRegStateResult& voiceRegResponse) {
rspInfo = info;
voiceRegResp = voiceRegResponse;
parent_v1_5.notify(info.serial);
return Void();
}
@@ -989,8 +990,9 @@ Return<void> RadioResponse_v1_5::getBarringInfoResponse(
Return<void> RadioResponse_v1_5::getVoiceRegistrationStateResponse_1_5(
const RadioResponseInfo& info,
const ::android::hardware::radio::V1_5::RegStateResult& /*regResponse*/) {
const ::android::hardware::radio::V1_5::RegStateResult& regResponse) {
rspInfo = info;
voiceRegResp.regState = regResponse.regState;
parent_v1_5.notify(info.serial);
return Void();
}