mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
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:
@@ -16,11 +16,40 @@
|
|||||||
|
|
||||||
#include <radio_hidl_hal_utils_v1_1.h>
|
#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() {
|
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) {
|
if (radio_v1_1 == NULL) {
|
||||||
sleep(60);
|
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());
|
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__) \
|
#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)
|
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;
|
class RadioHidlTest_v1_1;
|
||||||
extern CardStatus cardStatus;
|
extern CardStatus cardStatus;
|
||||||
|
|
||||||
|
|||||||
@@ -16,11 +16,40 @@
|
|||||||
|
|
||||||
#include <radio_hidl_hal_utils_v1_2.h>
|
#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() {
|
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) {
|
if (radio_v1_2 == NULL) {
|
||||||
sleep(60);
|
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());
|
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;
|
using ::android::hardware::radio::V1_0::RadioResponseType;
|
||||||
|
|
||||||
#define TIMEOUT_PERIOD 75
|
#define TIMEOUT_PERIOD 75
|
||||||
#define RADIO_SERVICE_NAME "slot1"
|
|
||||||
#define SKIP_TEST_IF_REQUEST_NOT_SUPPORTED_WITH_HAL_VERSION_AT_LEAST(__ver__) \
|
#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)
|
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;
|
class RadioHidlTest_v1_2;
|
||||||
extern ::android::hardware::radio::V1_2::CardStatus cardStatus;
|
extern ::android::hardware::radio::V1_2::CardStatus cardStatus;
|
||||||
|
|
||||||
|
|||||||
@@ -16,11 +16,40 @@
|
|||||||
|
|
||||||
#include <radio_hidl_hal_utils_v1_3.h>
|
#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() {
|
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) {
|
if (radio_v1_3 == NULL) {
|
||||||
sleep(60);
|
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());
|
ASSERT_NE(nullptr, radio_v1_3.get());
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,15 @@ using ::android::hardware::Return;
|
|||||||
using ::android::hardware::Void;
|
using ::android::hardware::Void;
|
||||||
|
|
||||||
#define TIMEOUT_PERIOD 75
|
#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;
|
class RadioHidlTest_v1_3;
|
||||||
extern ::android::hardware::radio::V1_2::CardStatus cardStatus;
|
extern ::android::hardware::radio::V1_2::CardStatus cardStatus;
|
||||||
|
|||||||
@@ -16,12 +16,41 @@
|
|||||||
|
|
||||||
#include <radio_hidl_hal_utils_v1_4.h>
|
#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() {
|
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) {
|
if (radio_v1_4 == NULL) {
|
||||||
sleep(60);
|
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());
|
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_ESTABLISH_TIME 3
|
||||||
#define MODEM_EMERGENCY_CALL_DISCONNECT_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;
|
class RadioHidlTest_v1_4;
|
||||||
extern ::android::hardware::radio::V1_4::CardStatus cardStatus;
|
extern ::android::hardware::radio::V1_4::CardStatus cardStatus;
|
||||||
|
|||||||
@@ -16,8 +16,38 @@
|
|||||||
|
|
||||||
#include <radio_hidl_hal_utils_v1_5.h>
|
#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() {
|
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());
|
ASSERT_NE(nullptr, radio_v1_5.get());
|
||||||
|
|
||||||
radioRsp_v1_5 = new (std::nothrow) RadioResponse_v1_5(*this);
|
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 VOICE_SERVICE_MAX_WAIT_TIME_SECONDS 10
|
||||||
#define BARRING_INFO_MAX_WAIT_TIME_SECONDS 3
|
#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;
|
class RadioHidlTest_v1_5;
|
||||||
extern ::android::hardware::radio::V1_5::CardStatus cardStatus;
|
extern ::android::hardware::radio::V1_5::CardStatus cardStatus;
|
||||||
|
|||||||
Reference in New Issue
Block a user