mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:23:37 +00:00
Waiting 10s at the beginning of getBarringInfo test if not yet in-service. am: db3c830bc8
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/15258818 Change-Id: I7b85fd286f3abeb3a990957cecd617c70cace01f
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user