summaryrefslogtreecommitdiffstats
path: root/radio
diff options
context:
space:
mode:
authorJack Yu <jackyu@google.com>2021-05-25 22:03:35 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-05-25 22:03:35 +0000
commitcf76f68c929b9235ea447d3ecce483df581f5dc7 (patch)
treead69a6af14de58c8083c690e95946675e520c539 /radio
parent29159c728fdb31f94109c3f601adf6c7f3ef5060 (diff)
parentef0d87afcb58a770973973c92d63fdfcb32de75e (diff)
downloadplatform_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')
-rw-r--r--radio/1.0/vts/functional/vts_test_util.cpp7
-rw-r--r--radio/1.0/vts/functional/vts_test_util.h9
-rw-r--r--radio/1.6/vts/functional/radio_hidl_hal_test.cpp33
-rw-r--r--radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h4
4 files changed, 49 insertions, 4 deletions
diff --git a/radio/1.0/vts/functional/vts_test_util.cpp b/radio/1.0/vts/functional/vts_test_util.cpp
index fc372011ed..5b31accbd2 100644
--- a/radio/1.0/vts/functional/vts_test_util.cpp
+++ b/radio/1.0/vts/functional/vts_test_util.cpp
@@ -83,6 +83,13 @@ bool deviceSupportsFeature(const char* feature) {
return hasFeature;
}
+bool isSsSsEnabled() {
+ // Do not use checkSubstringInCommandOutput("getprop persist.radio.multisim.config", "")
+ // until b/148904287 is fixed. We need exact matching instead of partial matching. (i.e.
+ // by definition the empty string "" is a substring of any string).
+ return !isDsDsEnabled() && !isTsTsEnabled();
+}
+
bool isDsDsEnabled() {
return testing::checkSubstringInCommandOutput("getprop persist.radio.multisim.config", "dsds");
}
diff --git a/radio/1.0/vts/functional/vts_test_util.h b/radio/1.0/vts/functional/vts_test_util.h
index eeb1d299ab..fa338a38a5 100644
--- a/radio/1.0/vts/functional/vts_test_util.h
+++ b/radio/1.0/vts/functional/vts_test_util.h
@@ -80,12 +80,17 @@ int GetRandomSerialNumber();
bool deviceSupportsFeature(const char* feature);
/*
- * Check if device is in DSDS.
+ * Check if device is in SsSs (Single SIM Single Standby).
+ */
+bool isSsSsEnabled();
+
+/*
+ * Check if device is in DSDS (Dual SIM Dual Standby).
*/
bool isDsDsEnabled();
/*
- * Check if device is in TSTS.
+ * Check if device is in TSTS (Triple SIM Triple Standby).
*/
bool isTsTsEnabled();
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;