Skip slot 2 for other radio modules in single sim mode am: c6a7143b1d

Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/15953283

Change-Id: Ia04dea0e93424c28477e6ee65c75f9d2692a53e4
This commit is contained in:
Shuo Qian
2021-10-01 17:43:09 +00:00
committed by Automerger Merge Worker
10 changed files with 198 additions and 13 deletions

View File

@@ -16,11 +16,40 @@
#include <radio_hidl_hal_utils_v1_1.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_1::SetUp() {
radio_v1_1 = ::android::hardware::radio::V1_1::IRadio::getService(GetParam());
hidl_string serviceName = GetParam();
if (!isServiceValidForDeviceConfiguration(serviceName)) {
ALOGI("Skipped the test due to device configuration.");
GTEST_SKIP();
}
radio_v1_1 = ::android::hardware::radio::V1_1::IRadio::getService(serviceName);
if (radio_v1_1 == NULL) {
sleep(60);
radio_v1_1 = ::android::hardware::radio::V1_1::IRadio::getService(GetParam());
radio_v1_1 = ::android::hardware::radio::V1_1::IRadio::getService(serviceName);
}
ASSERT_NE(nullptr, radio_v1_1.get());

View File

@@ -43,6 +43,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_v1_1, radioRsp_v1_1)
// 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_v1_1;
extern CardStatus cardStatus;

View File

@@ -16,11 +16,40 @@
#include <radio_hidl_hal_utils_v1_2.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_2::SetUp() {
radio_v1_2 = ::android::hardware::radio::V1_2::IRadio::getService(GetParam());
hidl_string serviceName = GetParam();
if (!isServiceValidForDeviceConfiguration(serviceName)) {
ALOGI("Skipped the test due to device configuration.");
GTEST_SKIP();
}
radio_v1_2 = ::android::hardware::radio::V1_2::IRadio::getService(serviceName);
if (radio_v1_2 == NULL) {
sleep(60);
radio_v1_2 = ::android::hardware::radio::V1_2::IRadio::getService(GetParam());
radio_v1_2 = ::android::hardware::radio::V1_2::IRadio::getService(serviceName);
}
ASSERT_NE(nullptr, radio_v1_2.get());

View File

@@ -49,10 +49,18 @@ using ::android::hardware::radio::V1_0::RadioResponseInfo;
using ::android::hardware::radio::V1_0::RadioResponseType;
#define TIMEOUT_PERIOD 75
#define RADIO_SERVICE_NAME "slot1"
#define SKIP_TEST_IF_REQUEST_NOT_SUPPORTED_WITH_HAL_VERSION_AT_LEAST(__ver__) \
SKIP_TEST_IF_REQUEST_NOT_SUPPORTED_WITH_HAL(__ver__, radio_v1_2, radioRsp_v1_2)
// 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_v1_2;
extern ::android::hardware::radio::V1_2::CardStatus cardStatus;

View File

@@ -16,11 +16,40 @@
#include <radio_hidl_hal_utils_v1_3.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_3::SetUp() {
radio_v1_3 = ::android::hardware::radio::V1_3::IRadio::getService(GetParam());
hidl_string serviceName = GetParam();
if (!isServiceValidForDeviceConfiguration(serviceName)) {
ALOGI("Skipped the test due to device configuration.");
GTEST_SKIP();
}
radio_v1_3 = ::android::hardware::radio::V1_3::IRadio::getService(serviceName);
if (radio_v1_3 == NULL) {
sleep(60);
radio_v1_3 = ::android::hardware::radio::V1_3::IRadio::getService(GetParam());
radio_v1_3 = ::android::hardware::radio::V1_3::IRadio::getService(serviceName);
}
ASSERT_NE(nullptr, radio_v1_3.get());

View File

@@ -41,7 +41,15 @@ using ::android::hardware::Return;
using ::android::hardware::Void;
#define TIMEOUT_PERIOD 75
#define RADIO_SERVICE_NAME "slot1"
// 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_v1_3;
extern ::android::hardware::radio::V1_2::CardStatus cardStatus;

View File

@@ -16,12 +16,41 @@
#include <radio_hidl_hal_utils_v1_4.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_4::SetUp() {
radio_v1_4 = ::android::hardware::radio::V1_4::IRadio::getService(GetParam());
hidl_string serviceName = GetParam();
if (!isServiceValidForDeviceConfiguration(serviceName)) {
ALOGI("Skipped the test due to device configuration.");
GTEST_SKIP();
}
radio_v1_4 = ::android::hardware::radio::V1_4::IRadio::getService(serviceName);
if (radio_v1_4 == NULL) {
sleep(60);
radio_v1_4 = ::android::hardware::radio::V1_4::IRadio::getService(GetParam());
radio_v1_4 = ::android::hardware::radio::V1_4::IRadio::getService(serviceName);
}
ASSERT_NE(nullptr, radio_v1_4.get());

View File

@@ -47,7 +47,14 @@ using ::android::hardware::Void;
#define MODEM_EMERGENCY_CALL_ESTABLISH_TIME 3
#define MODEM_EMERGENCY_CALL_DISCONNECT_TIME 3
#define RADIO_SERVICE_NAME "slot1"
// 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_v1_4;
extern ::android::hardware::radio::V1_4::CardStatus cardStatus;

View File

@@ -16,8 +16,38 @@
#include <radio_hidl_hal_utils_v1_5.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_5::SetUp() {
radio_v1_5 = android::hardware::radio::V1_5::IRadio::getService(GetParam());
hidl_string serviceName = GetParam();
if (!isServiceValidForDeviceConfiguration(serviceName)) {
ALOGI("Skipped the test due to device configuration.");
GTEST_SKIP();
}
radio_v1_5 = android::hardware::radio::V1_5::IRadio::getService(serviceName);
ASSERT_NE(nullptr, radio_v1_5.get());
radioRsp_v1_5 = new (std::nothrow) RadioResponse_v1_5(*this);

View File

@@ -54,7 +54,14 @@ using ::android::hardware::Void;
#define VOICE_SERVICE_MAX_WAIT_TIME_SECONDS 10
#define BARRING_INFO_MAX_WAIT_TIME_SECONDS 3
#define RADIO_SERVICE_NAME "slot1"
// 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_v1_5;
extern ::android::hardware::radio::V1_5::CardStatus cardStatus;