diff options
author | Jack Yu <jackyu@google.com> | 2021-05-25 22:03:35 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-05-25 22:03:35 +0000 |
commit | cf76f68c929b9235ea447d3ecce483df581f5dc7 (patch) | |
tree | ad69a6af14de58c8083c690e95946675e520c539 /radio/1.6 | |
parent | 29159c728fdb31f94109c3f601adf6c7f3ef5060 (diff) | |
parent | ef0d87afcb58a770973973c92d63fdfcb32de75e (diff) | |
download | platform_hardware_interfaces-cf76f68c929b9235ea447d3ecce483df581f5dc7.tar.gz platform_hardware_interfaces-cf76f68c929b9235ea447d3ecce483df581f5dc7.tar.bz2 platform_hardware_interfaces-cf76f68c929b9235ea447d3ecce483df581f5dc7.zip |
Merge "Skip tests for single SIM devices"
Diffstat (limited to 'radio/1.6')
-rw-r--r-- | radio/1.6/vts/functional/radio_hidl_hal_test.cpp | 33 | ||||
-rw-r--r-- | radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h | 4 |
2 files changed, 35 insertions, 2 deletions
diff --git a/radio/1.6/vts/functional/radio_hidl_hal_test.cpp b/radio/1.6/vts/functional/radio_hidl_hal_test.cpp index 5d514a0e6e..00f4468dce 100644 --- a/radio/1.6/vts/functional/radio_hidl_hal_test.cpp +++ b/radio/1.6/vts/functional/radio_hidl_hal_test.cpp @@ -16,8 +16,39 @@ #include <radio_hidl_hal_utils_v1_6.h> +bool isServiceValidForDeviceConfiguration(hidl_string& serviceName) { + if (isSsSsEnabled()) { + // Device is configured as SSSS. + if (serviceName != RADIO_SERVICE_SLOT1_NAME) { + ALOGI("%s instance is not valid for SSSS device.", serviceName.c_str()); + return false; + } + } else if (isDsDsEnabled()) { + // Device is configured as DSDS. + if (serviceName != RADIO_SERVICE_SLOT1_NAME && serviceName != RADIO_SERVICE_SLOT2_NAME) { + ALOGI("%s instance is not valid for DSDS device.", serviceName.c_str()); + return false; + } + } else if (isTsTsEnabled()) { + // Device is configured as TSTS. + if (serviceName != RADIO_SERVICE_SLOT1_NAME && serviceName != RADIO_SERVICE_SLOT2_NAME && + serviceName != RADIO_SERVICE_SLOT3_NAME) { + ALOGI("%s instance is not valid for TSTS device.", serviceName.c_str()); + return false; + } + } + return true; +} + void RadioHidlTest_v1_6::SetUp() { - radio_v1_6 = android::hardware::radio::V1_6::IRadio::getService(GetParam()); + hidl_string serviceName = GetParam(); + + if (!isServiceValidForDeviceConfiguration(serviceName)) { + ALOGI("Skipped the test due to device configuration."); + GTEST_SKIP(); + } + + radio_v1_6 = android::hardware::radio::V1_6::IRadio::getService(serviceName); ASSERT_NE(nullptr, radio_v1_6.get()); radioRsp_v1_6 = new (std::nothrow) RadioResponse_v1_6(*this); diff --git a/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h b/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h index 3185f98364..54c297719f 100644 --- a/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h +++ b/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h @@ -48,7 +48,9 @@ using ::android::hardware::Void; #define MODEM_EMERGENCY_CALL_ESTABLISH_TIME 3 #define MODEM_EMERGENCY_CALL_DISCONNECT_TIME 3 -#define RADIO_SERVICE_NAME "slot1" +#define RADIO_SERVICE_SLOT1_NAME "slot1" // HAL instance name for SIM slot 1 or single SIM device +#define RADIO_SERVICE_SLOT2_NAME "slot2" // HAL instance name for SIM slot 2 on dual SIM device +#define RADIO_SERVICE_SLOT3_NAME "slot3" // HAL instance name for SIM slot 3 on triple SIM device class RadioHidlTest_v1_6; extern ::android::hardware::radio::V1_5::CardStatus cardStatus; |