mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Skip tests for single SIM devices
When device is configured as single SIM device, skip VTS on 2nd vendor radio service instance. Fix: 187998097 Test: atest VtsHalRadioV1_6TargetTest Change-Id: Ib634b22dd75f10e5059c9482764ca481184162be
This commit is contained in:
@@ -83,6 +83,13 @@ bool deviceSupportsFeature(const char* feature) {
|
||||
return hasFeature;
|
||||
}
|
||||
|
||||
bool isSsSsEnabled() {
|
||||
// Do not use checkSubstringInCommandOutput("getprop persist.radio.multisim.config", "")
|
||||
// until b/148904287 is fixed. We need exact matching instead of partial matching. (i.e.
|
||||
// by definition the empty string "" is a substring of any string).
|
||||
return !isDsDsEnabled() && !isTsTsEnabled();
|
||||
}
|
||||
|
||||
bool isDsDsEnabled() {
|
||||
return testing::checkSubstringInCommandOutput("getprop persist.radio.multisim.config", "dsds");
|
||||
}
|
||||
|
||||
@@ -80,12 +80,17 @@ int GetRandomSerialNumber();
|
||||
bool deviceSupportsFeature(const char* feature);
|
||||
|
||||
/*
|
||||
* Check if device is in DSDS.
|
||||
* Check if device is in SsSs (Single SIM Single Standby).
|
||||
*/
|
||||
bool isSsSsEnabled();
|
||||
|
||||
/*
|
||||
* Check if device is in DSDS (Dual SIM Dual Standby).
|
||||
*/
|
||||
bool isDsDsEnabled();
|
||||
|
||||
/*
|
||||
* Check if device is in TSTS.
|
||||
* Check if device is in TSTS (Triple SIM Triple Standby).
|
||||
*/
|
||||
bool isTsTsEnabled();
|
||||
|
||||
|
||||
@@ -16,8 +16,39 @@
|
||||
|
||||
#include <radio_hidl_hal_utils_v1_6.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_6::SetUp() {
|
||||
radio_v1_6 = android::hardware::radio::V1_6::IRadio::getService(GetParam());
|
||||
hidl_string serviceName = GetParam();
|
||||
|
||||
if (!isServiceValidForDeviceConfiguration(serviceName)) {
|
||||
ALOGI("Skipped the test due to device configuration.");
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
radio_v1_6 = android::hardware::radio::V1_6::IRadio::getService(serviceName);
|
||||
ASSERT_NE(nullptr, radio_v1_6.get());
|
||||
|
||||
radioRsp_v1_6 = new (std::nothrow) RadioResponse_v1_6(*this);
|
||||
|
||||
@@ -48,7 +48,9 @@ using ::android::hardware::Void;
|
||||
#define MODEM_EMERGENCY_CALL_ESTABLISH_TIME 3
|
||||
#define MODEM_EMERGENCY_CALL_DISCONNECT_TIME 3
|
||||
|
||||
#define RADIO_SERVICE_NAME "slot1"
|
||||
#define RADIO_SERVICE_SLOT1_NAME "slot1" // HAL instance name for SIM slot 1 or single SIM device
|
||||
#define RADIO_SERVICE_SLOT2_NAME "slot2" // HAL instance name for SIM slot 2 on dual SIM device
|
||||
#define RADIO_SERVICE_SLOT3_NAME "slot3" // HAL instance name for SIM slot 3 on triple SIM device
|
||||
|
||||
class RadioHidlTest_v1_6;
|
||||
extern ::android::hardware::radio::V1_5::CardStatus cardStatus;
|
||||
|
||||
Reference in New Issue
Block a user