Loading radio/1.0/vts/functional/radio_hidl_hal_test.cpp +32 −2 Original line number Diff line number Diff line Loading @@ -17,12 +17,42 @@ #include <android-base/logging.h> #include <radio_hidl_hal_utils_v1_0.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::SetUp() { radio = IRadio::getService(GetParam()); hidl_string serviceName = GetParam(); if (!isServiceValidForDeviceConfiguration(serviceName)) { ALOGI("Skipped the test due to device configuration."); GTEST_SKIP(); } radio = IRadio::getService(serviceName); if (radio == NULL) { LOG(DEBUG) << "Radio is NULL, waiting 1 minute to retry"; sleep(60); radio = IRadio::getService(GetParam()); radio = IRadio::getService(serviceName); } ASSERT_NE(nullptr, radio.get()); Loading radio/1.0/vts/functional/radio_hidl_hal_utils_v1_0.h +10 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #include <android-base/logging.h> #include <log/log.h> #include <chrono> #include <condition_variable> #include <mutex> Loading @@ -41,6 +42,15 @@ using ::android::sp; #define SKIP_TEST_IF_REQUEST_NOT_SUPPORTED_WITH_HAL_VERSION_AT_LEAST(__ver__) \ SKIP_TEST_IF_REQUEST_NOT_SUPPORTED_WITH_HAL(__ver__, radio, radioRsp) // HAL instance name for SIM slot 1 or single SIM device #define RADIO_SERVICE_SLOT1_NAME "slot1" // HAL instance name for SIM slot 2 on dual SIM device #define RADIO_SERVICE_SLOT2_NAME "slot2" // HAL instance name for SIM slot 3 on triple SIM device #define RADIO_SERVICE_SLOT3_NAME "slot3" class RadioHidlTest; extern CardStatus cardStatus; Loading Loading
radio/1.0/vts/functional/radio_hidl_hal_test.cpp +32 −2 Original line number Diff line number Diff line Loading @@ -17,12 +17,42 @@ #include <android-base/logging.h> #include <radio_hidl_hal_utils_v1_0.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::SetUp() { radio = IRadio::getService(GetParam()); hidl_string serviceName = GetParam(); if (!isServiceValidForDeviceConfiguration(serviceName)) { ALOGI("Skipped the test due to device configuration."); GTEST_SKIP(); } radio = IRadio::getService(serviceName); if (radio == NULL) { LOG(DEBUG) << "Radio is NULL, waiting 1 minute to retry"; sleep(60); radio = IRadio::getService(GetParam()); radio = IRadio::getService(serviceName); } ASSERT_NE(nullptr, radio.get()); Loading
radio/1.0/vts/functional/radio_hidl_hal_utils_v1_0.h +10 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #include <android-base/logging.h> #include <log/log.h> #include <chrono> #include <condition_variable> #include <mutex> Loading @@ -41,6 +42,15 @@ using ::android::sp; #define SKIP_TEST_IF_REQUEST_NOT_SUPPORTED_WITH_HAL_VERSION_AT_LEAST(__ver__) \ SKIP_TEST_IF_REQUEST_NOT_SUPPORTED_WITH_HAL(__ver__, radio, radioRsp) // HAL instance name for SIM slot 1 or single SIM device #define RADIO_SERVICE_SLOT1_NAME "slot1" // HAL instance name for SIM slot 2 on dual SIM device #define RADIO_SERVICE_SLOT2_NAME "slot2" // HAL instance name for SIM slot 3 on triple SIM device #define RADIO_SERVICE_SLOT3_NAME "slot3" class RadioHidlTest; extern CardStatus cardStatus; Loading