Loading radio/1.4/vts/functional/radio_hidl_hal_api.cpp +56 −1 Original line number Diff line number Diff line Loading @@ -94,3 +94,58 @@ TEST_F(RadioHidlTest_v1_4, emergencyDial_withEmergencyRouting) { toString(radioRsp_v1_4->rspInfo.error).c_str()); EXPECT_EQ(RadioError::NONE, radioRsp_v1_4->rspInfo.error); } /* * Test IRadio.setupDataCall_1_4() for the response returned. */ TEST_F(RadioHidlTest_v1_4, setupDataCall_1_4) { serial = GetRandomSerialNumber(); ::android::hardware::radio::V1_4::AccessNetwork accessNetwork = ::android::hardware::radio::V1_4::AccessNetwork::EUTRAN; android::hardware::radio::V1_4::DataProfileInfo dataProfileInfo; memset(&dataProfileInfo, 0, sizeof(dataProfileInfo)); dataProfileInfo.profileId = DataProfileId::DEFAULT; dataProfileInfo.apn = hidl_string("internet"); dataProfileInfo.protocol = PdpProtocolType::IPV4V6; dataProfileInfo.roamingProtocol = PdpProtocolType::IPV4V6; dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP; dataProfileInfo.user = hidl_string("username"); dataProfileInfo.password = hidl_string("password"); dataProfileInfo.type = DataProfileInfoType::THREE_GPP; dataProfileInfo.maxConnsTime = 300; dataProfileInfo.maxConns = 20; dataProfileInfo.waitTime = 0; dataProfileInfo.enabled = true; dataProfileInfo.supportedApnTypesBitmap = 320; dataProfileInfo.bearerBitmap = 161543; dataProfileInfo.mtu = 0; dataProfileInfo.preferred = true; dataProfileInfo.persistent = false; bool roamingAllowed = false; ::android::hardware::radio::V1_2::DataRequestReason reason = ::android::hardware::radio::V1_2::DataRequestReason::NORMAL; std::vector<hidl_string> addresses = {""}; std::vector<hidl_string> dnses = {""}; Return<void> res = radio_v1_4->setupDataCall_1_4(serial, accessNetwork, dataProfileInfo, roamingAllowed, reason, addresses, dnses); ASSERT_OK(res); EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_4->rspInfo.type); EXPECT_EQ(serial, radioRsp_v1_4->rspInfo.serial); if (cardStatus.base.base.cardState == CardState::ABSENT) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_4->rspInfo.error, {RadioError::SIM_ABSENT, RadioError::RADIO_NOT_AVAILABLE, RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); } else if (cardStatus.base.base.cardState == CardState::PRESENT) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_4->rspInfo.error, {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); } } Loading
radio/1.4/vts/functional/radio_hidl_hal_api.cpp +56 −1 Original line number Diff line number Diff line Loading @@ -94,3 +94,58 @@ TEST_F(RadioHidlTest_v1_4, emergencyDial_withEmergencyRouting) { toString(radioRsp_v1_4->rspInfo.error).c_str()); EXPECT_EQ(RadioError::NONE, radioRsp_v1_4->rspInfo.error); } /* * Test IRadio.setupDataCall_1_4() for the response returned. */ TEST_F(RadioHidlTest_v1_4, setupDataCall_1_4) { serial = GetRandomSerialNumber(); ::android::hardware::radio::V1_4::AccessNetwork accessNetwork = ::android::hardware::radio::V1_4::AccessNetwork::EUTRAN; android::hardware::radio::V1_4::DataProfileInfo dataProfileInfo; memset(&dataProfileInfo, 0, sizeof(dataProfileInfo)); dataProfileInfo.profileId = DataProfileId::DEFAULT; dataProfileInfo.apn = hidl_string("internet"); dataProfileInfo.protocol = PdpProtocolType::IPV4V6; dataProfileInfo.roamingProtocol = PdpProtocolType::IPV4V6; dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP; dataProfileInfo.user = hidl_string("username"); dataProfileInfo.password = hidl_string("password"); dataProfileInfo.type = DataProfileInfoType::THREE_GPP; dataProfileInfo.maxConnsTime = 300; dataProfileInfo.maxConns = 20; dataProfileInfo.waitTime = 0; dataProfileInfo.enabled = true; dataProfileInfo.supportedApnTypesBitmap = 320; dataProfileInfo.bearerBitmap = 161543; dataProfileInfo.mtu = 0; dataProfileInfo.preferred = true; dataProfileInfo.persistent = false; bool roamingAllowed = false; ::android::hardware::radio::V1_2::DataRequestReason reason = ::android::hardware::radio::V1_2::DataRequestReason::NORMAL; std::vector<hidl_string> addresses = {""}; std::vector<hidl_string> dnses = {""}; Return<void> res = radio_v1_4->setupDataCall_1_4(serial, accessNetwork, dataProfileInfo, roamingAllowed, reason, addresses, dnses); ASSERT_OK(res); EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_4->rspInfo.type); EXPECT_EQ(serial, radioRsp_v1_4->rspInfo.serial); if (cardStatus.base.base.cardState == CardState::ABSENT) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_4->rspInfo.error, {RadioError::SIM_ABSENT, RadioError::RADIO_NOT_AVAILABLE, RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); } else if (cardStatus.base.base.cardState == CardState::PRESENT) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_4->rspInfo.error, {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); } }