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

Commit a66a862e authored by Aaron Tsai's avatar Aaron Tsai Committed by Automerger Merge Worker
Browse files

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

Waiting 10s at the beginning of getBarringInfo test if not yet in-service. am: db3c830b am: 06d32389

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

Change-Id: I614cc895d3c675f6716cde8f3e2609093fd65a31
parents 2e2cba22 06d32389
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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);
+3 −0
Original line number Diff line number Diff line
@@ -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;
+4 −2
Original line number Diff line number Diff line
@@ -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();
}