diff --git a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp index 7e4c64db73..c3769f81b1 100644 --- a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp @@ -567,3 +567,91 @@ TEST_F(RadioHidlTest_v1_2, setLinkCapacityReportingCriteria_Geran) { toString(radioRsp_v1_2->rspInfo.error).c_str()); ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::NONE})); } + +/* + * Test IRadio.setupDataCall_1_2() for the response returned. + */ +TEST_F(RadioHidlTest_v1_2, setupDataCall_1_2) { + const int serial = GetRandomSerialNumber(); + + V1_2::AccessNetwork accessNetwork = V1_2::AccessNetwork::EUTRAN; + + DataProfileInfo dataProfileInfo; + memset(&dataProfileInfo, 0, sizeof(dataProfileInfo)); + dataProfileInfo.profileId = DataProfileId::IMS; + dataProfileInfo.apn = hidl_string("VZWIMS"); + dataProfileInfo.protocol = hidl_string("IPV4V6"); + dataProfileInfo.roamingProtocol = hidl_string("IPV6"); + dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP; + dataProfileInfo.user = ""; + dataProfileInfo.password = ""; + dataProfileInfo.type = DataProfileInfoType::THREE_GPP2; + dataProfileInfo.maxConnsTime = 300; + dataProfileInfo.maxConns = 20; + dataProfileInfo.waitTime = 0; + dataProfileInfo.enabled = true; + dataProfileInfo.supportedApnTypesBitmap = 320; + dataProfileInfo.bearerBitmap = 161543; + dataProfileInfo.mtu = 0; + dataProfileInfo.mvnoType = MvnoType::NONE; + dataProfileInfo.mvnoMatchData = hidl_string(); + + bool modemCognitive = false; + bool roamingAllowed = false; + bool isRoaming = false; + + V1_2::DataRequestReason reason = V1_2::DataRequestReason::NORMAL; + std::vector addresses = {""}; + std::vector dnses = {""}; + + Return res = radio_v1_2->setupDataCall_1_2(serial, accessNetwork, dataProfileInfo, + modemCognitive, roamingAllowed, isRoaming, + reason, addresses, dnses); + ASSERT_OK(res); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type); + EXPECT_EQ(serial, radioRsp_v1_2->rspInfo.serial); + + if (cardStatus.cardState == CardState::ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_v1_2->rspInfo.error, + {RadioError::SIM_ABSENT, RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_ARGUMENTS, + RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW, RadioError::REQUEST_NOT_SUPPORTED})); + } else if (cardStatus.cardState == CardState::PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_v1_2->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_ARGUMENTS, + RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW, RadioError::REQUEST_NOT_SUPPORTED})); + } +} + +/* + * Test IRadio.deactivateDataCall_1_2() for the response returned. + */ +TEST_F(RadioHidlTest_v1_2, deactivateDataCall_1_2) { + const int serial = GetRandomSerialNumber(); + int cid = 1; + V1_2::DataRequestReason reason = V1_2::DataRequestReason::NORMAL; + + Return res = radio_v1_2->deactivateDataCall_1_2(serial, cid, reason); + ASSERT_OK(res); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type); + EXPECT_EQ(serial, radioRsp_v1_2->rspInfo.serial); + + if (cardStatus.cardState == CardState::ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_v1_2->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_CALL_ID, + RadioError::INVALID_STATE, RadioError::INVALID_ARGUMENTS, + RadioError::REQUEST_NOT_SUPPORTED, RadioError::CANCELLED, RadioError::SIM_ABSENT})); + } else if (cardStatus.cardState == CardState::PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_v1_2->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_CALL_ID, + RadioError::INVALID_STATE, RadioError::INVALID_ARGUMENTS, + RadioError::REQUEST_NOT_SUPPORTED, RadioError::CANCELLED})); + } +} diff --git a/radio/1.2/vts/functional/radio_response.cpp b/radio/1.2/vts/functional/radio_response.cpp index 3079b9e099..9bf4531f08 100644 --- a/radio/1.2/vts/functional/radio_response.cpp +++ b/radio/1.2/vts/functional/radio_response.cpp @@ -150,8 +150,10 @@ Return RadioResponse_v1_2::sendSMSExpectMoreResponse(const RadioResponseIn return Void(); } -Return RadioResponse_v1_2::setupDataCallResponse(const RadioResponseInfo& /*info*/, +Return RadioResponse_v1_2::setupDataCallResponse(const RadioResponseInfo& info, const SetupDataCallResult& /*dcResponse*/) { + rspInfo = info; + parent_v1_2.notify(); return Void(); } @@ -205,7 +207,9 @@ Return RadioResponse_v1_2::acceptCallResponse(const RadioResponseInfo& /*i return Void(); } -Return RadioResponse_v1_2::deactivateDataCallResponse(const RadioResponseInfo& /*info*/) { +Return RadioResponse_v1_2::deactivateDataCallResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_v1_2.notify(); return Void(); }