diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2022-02-15 05:27:21 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-02-15 05:27:21 +0000 |
commit | 8e64385bc4c8f45122ae0181e6e73e1428e847a6 (patch) | |
tree | 873a3f82ee907d693df3cbf929d922a9d5a8e93d /radio | |
parent | 690a98e9458e3f8a7bbaae3536b6b665ff51cb92 (diff) | |
parent | 6a57e5041dc6b0e2d1f487d3b6b2523778eaf34c (diff) |
Merge "Run SAP tests on slots based on configs" am: ef8b4bee56 am: a16e677d82 am: 6a57e5041d
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1968993
Change-Id: Ic79f503fe35621651294c99dfe8d1f37ff4edd36
Diffstat (limited to 'radio')
-rw-r--r-- | radio/1.0/vts/functional/sap_hidl_hal_test.cpp | 31 | ||||
-rw-r--r-- | radio/1.0/vts/functional/sap_hidl_hal_utils.h | 10 |
2 files changed, 39 insertions, 2 deletions
diff --git a/radio/1.0/vts/functional/sap_hidl_hal_test.cpp b/radio/1.0/vts/functional/sap_hidl_hal_test.cpp index fe105872b4..5224624719 100644 --- a/radio/1.0/vts/functional/sap_hidl_hal_test.cpp +++ b/radio/1.0/vts/functional/sap_hidl_hal_test.cpp @@ -16,8 +16,37 @@ #include <sap_hidl_hal_utils.h> +bool isServiceValidForDeviceConfiguration(hidl_string& serviceName) { + if (isSsSsEnabled()) { + // Device is configured as SSSS. + if (serviceName != SAP_SERVICE_SLOT1_NAME) { + LOG(DEBUG) << "Not valid for SSSS device."; + return false; + } + } else if (isDsDsEnabled()) { + // Device is configured as DSDS. + if (serviceName != SAP_SERVICE_SLOT1_NAME && serviceName != SAP_SERVICE_SLOT2_NAME) { + LOG(DEBUG) << "Not valid for DSDS device."; + return false; + } + } else if (isTsTsEnabled()) { + // Device is configured as TSTS. + if (serviceName != SAP_SERVICE_SLOT1_NAME && serviceName != SAP_SERVICE_SLOT2_NAME && + serviceName != SAP_SERVICE_SLOT3_NAME) { + LOG(DEBUG) << "Not valid for TSTS device."; + return false; + } + } + return true; +} + void SapHidlTest::SetUp() { - sap = ISap::getService(GetParam()); + hidl_string serviceName = GetParam(); + if (!isServiceValidForDeviceConfiguration(serviceName)) { + LOG(DEBUG) << "Skipped the test due to device configuration."; + GTEST_SKIP(); + } + sap = ISap::getService(serviceName); ASSERT_NE(sap, nullptr); sapCb = new SapCallback(*this); diff --git a/radio/1.0/vts/functional/sap_hidl_hal_utils.h b/radio/1.0/vts/functional/sap_hidl_hal_utils.h index 2fc9ae368e..8e86591bb7 100644 --- a/radio/1.0/vts/functional/sap_hidl_hal_utils.h +++ b/radio/1.0/vts/functional/sap_hidl_hal_utils.h @@ -36,7 +36,15 @@ using ::android::hardware::Void; using ::android::sp; #define TIMEOUT_PERIOD 40 -#define SAP_SERVICE_NAME "slot1" + +// HAL instance name for SIM slot 1 or single SIM device +#define SAP_SERVICE_SLOT1_NAME "slot1" + +// HAL instance name for SIM slot 2 on dual SIM device +#define SAP_SERVICE_SLOT2_NAME "slot2" + +// HAL instance name for SIM slot 3 on triple SIM device +#define SAP_SERVICE_SLOT3_NAME "slot3" class SapHidlTest; |