Fix fail on RadioConfigTest#checkPortInfoExistsAndPortActive for dual-SIM detection

The code currently uses 'dsds' to detect dual-SIM configurations,
but it misses 'dsda' configurations, resulting in test failures.
Should use the detection mechanism by adding handling for 'dsda',
ensuring accurate detection of all dual-SIM configurations.

Bug: 277705768
Test: vts -m VtsHalRadioTargetTest -t PerInstance/RadioConfigTest#checkPortInfoExistsAndPortActive/0_android_hardware_radio_config_IRadioConfig_default

Change-Id: Ie73a958ff14e86f440831e18291b6599b6eac30b
Signed-off-by: Jia Jia <jia.jia@zte.com.cn>
This commit is contained in:
Zhang Yuan
2023-04-11 16:35:41 +08:00
committed by Jayachandran C
parent 2d79edf1d8
commit 961b3dccde

View File

@@ -85,7 +85,7 @@ 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();
return !isDsDsEnabled() && !isTsTsEnabled() && !isDsDaEnabled();
}
bool isDsDsEnabled() {
@@ -125,8 +125,8 @@ bool isServiceValidForDeviceConfiguration(std::string& serviceName) {
ALOGI("%s instance is not valid for SSSS device.", serviceName.c_str());
return false;
}
} else if (isDsDsEnabled()) {
// Device is configured as DSDS.
} else if (isDsDsEnabled() || isDsDaEnabled()) {
// Device is configured as DSDS or DSDA.
if (!stringEndsWith(serviceName, RADIO_SERVICE_SLOT1_NAME) &&
!stringEndsWith(serviceName, RADIO_SERVICE_SLOT2_NAME)) {
ALOGI("%s instance is not valid for DSDS device.", serviceName.c_str());