Skip slot 2 for other radio modules in single sim mode am: 07f1c21f4a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1850574 Change-Id: Ic0dd661931458dcc598886b417e74a5f04bae9d1
This commit is contained in:
commit
ff5824235e
10 changed files with 198 additions and 13 deletions
|
@ -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());
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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());
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue