summaryrefslogtreecommitdiffstats
path: root/radio
diff options
context:
space:
mode:
authorAmruth Ramachandran <amruthr@google.com>2019-03-21 10:06:29 -0700
committerAmruth Ramachandran <amruthr@google.com>2019-04-01 10:17:07 -0700
commit7c06193d0931df00d4fd3cb5ccf5ffe096188a8c (patch)
treebd19f89578ef19f6589ce88dad7799d8a3d67bd7 /radio
parent7885653276b9db8fb27e970507ae18dda7b3a121 (diff)
downloadandroid_hardware_interfaces-7c06193d0931df00d4fd3cb5ccf5ffe096188a8c.tar.gz
android_hardware_interfaces-7c06193d0931df00d4fd3cb5ccf5ffe096188a8c.tar.bz2
android_hardware_interfaces-7c06193d0931df00d4fd3cb5ccf5ffe096188a8c.zip
Add VTS test for getDataRegistrationState
Bug:112194535 Test: VTS test Change-Id: I32b335c8407a6884216aa1b80216a87e94b6cba6
Diffstat (limited to 'radio')
-rw-r--r--radio/1.4/vts/functional/radio_hidl_hal_api.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/radio/1.4/vts/functional/radio_hidl_hal_api.cpp b/radio/1.4/vts/functional/radio_hidl_hal_api.cpp
index 76d87585a..2093c2547 100644
--- a/radio/1.4/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.4/vts/functional/radio_hidl_hal_api.cpp
@@ -758,3 +758,40 @@ TEST_F(RadioHidlTest_v1_4, setInitialAttachApn_1_4) {
{RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE}));
}
}
+
+/*
+ * Test IRadio.getDataRegistrationStateResponse_1_4() for the response returned.
+ */
+TEST_F(RadioHidlTest_v1_4, getDataRegistrationState_1_4) {
+ int rat;
+ serial = GetRandomSerialNumber();
+
+ Return<void> res = radio_v1_4->getDataRegistrationState(serial);
+ 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);
+
+ ALOGI("getDataRegistrationStateResponse_1_4, rspInfo.error = %s\n",
+ toString(radioRsp_v1_4->rspInfo.error).c_str());
+
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_v1_4->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::NOT_PROVISIONED}));
+
+ rat = radioRsp_v1_4->dataRegResp.base.rat;
+ /*
+ * - Expect Valid vopsinfo when device is on LTE
+ * - Expect empty vopsInfo when device is not on LTE
+ */
+ if (rat == ((int )::android::hardware::radio::V1_4::RadioTechnology::LTE)
+ || (rat == (int )::android::hardware::radio::V1_4::RadioTechnology::LTE_CA)) {
+
+ EXPECT_EQ(::android::hardware::radio::V1_4::DataRegStateResult::VopsInfo::hidl_discriminator
+ ::lteVopsInfo, radioRsp_v1_4->dataRegResp.vopsInfo.getDiscriminator());
+ } else {
+
+ EXPECT_EQ(::android::hardware::radio::V1_4::DataRegStateResult::VopsInfo::hidl_discriminator
+ ::noinit, radioRsp_v1_4->dataRegResp.vopsInfo.getDiscriminator());
+ }
+}