summaryrefslogtreecommitdiffstats
path: root/radio/1.2
diff options
context:
space:
mode:
authorJack Yu <jackyu@google.com>2018-03-01 07:13:53 +0000
committerandroid-build-merger <android-build-merger@google.com>2018-03-01 07:13:53 +0000
commit668583d52900b1f653bbd9c66c91cd318e0b9b46 (patch)
tree0ccc000f2aeff25570f48dcd99bfd831d02a3f6c /radio/1.2
parentb7724bec9ea591fd779cce6664a4354c88f3550f (diff)
parent20d65fe38f7fd400c1e3de82eb47529cf63a4095 (diff)
downloadplatform_hardware_interfaces-668583d52900b1f653bbd9c66c91cd318e0b9b46.tar.gz
platform_hardware_interfaces-668583d52900b1f653bbd9c66c91cd318e0b9b46.tar.bz2
platform_hardware_interfaces-668583d52900b1f653bbd9c66c91cd318e0b9b46.zip
Added new VTS test cases for v1.2 data call APIs am: ac1844fac4 am: 67e9c401ec
am: 20d65fe38f Change-Id: Ic4e1a3aa90769ab3568706f303a12acf5b6f6298
Diffstat (limited to 'radio/1.2')
-rw-r--r--radio/1.2/vts/functional/radio_hidl_hal_api.cpp88
-rw-r--r--radio/1.2/vts/functional/radio_response.cpp8
2 files changed, 94 insertions, 2 deletions
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<hidl_string> addresses = {""};
+ std::vector<hidl_string> dnses = {""};
+
+ Return<void> 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<void> 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<void> RadioResponse_v1_2::sendSMSExpectMoreResponse(const RadioResponseIn
return Void();
}
-Return<void> RadioResponse_v1_2::setupDataCallResponse(const RadioResponseInfo& /*info*/,
+Return<void> RadioResponse_v1_2::setupDataCallResponse(const RadioResponseInfo& info,
const SetupDataCallResult& /*dcResponse*/) {
+ rspInfo = info;
+ parent_v1_2.notify();
return Void();
}
@@ -205,7 +207,9 @@ Return<void> RadioResponse_v1_2::acceptCallResponse(const RadioResponseInfo& /*i
return Void();
}
-Return<void> RadioResponse_v1_2::deactivateDataCallResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse_v1_2::deactivateDataCallResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_v1_2.notify();
return Void();
}