mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
fix SIM related VTS failures am: fd854fe699 am: 51f43a368c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2053145 Change-Id: Ieb09ccac9a2ea2bf3c79165438b1d1964921c0af Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -206,7 +206,7 @@ void RadioServiceTest::updateSimCardStatus() {
|
|||||||
EXPECT_EQ(RadioError::NONE, radioSimRsp->rspInfo.error);
|
EXPECT_EQ(RadioError::NONE, radioSimRsp->rspInfo.error);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RadioServiceTest::updateSimSlotStatus() {
|
void RadioServiceTest::updateSimSlotStatus(int physicalSlotId) {
|
||||||
// Update SimSlotStatus from RadioConfig
|
// Update SimSlotStatus from RadioConfig
|
||||||
std::shared_ptr<RadioConfigResponse> radioConfigRsp =
|
std::shared_ptr<RadioConfigResponse> radioConfigRsp =
|
||||||
ndk::SharedRefBase::make<RadioConfigResponse>(*this);
|
ndk::SharedRefBase::make<RadioConfigResponse>(*this);
|
||||||
@@ -219,8 +219,7 @@ void RadioServiceTest::updateSimSlotStatus() {
|
|||||||
EXPECT_EQ(RadioResponseType::SOLICITED, radioConfigRsp->rspInfo.type);
|
EXPECT_EQ(RadioResponseType::SOLICITED, radioConfigRsp->rspInfo.type);
|
||||||
EXPECT_EQ(serial, radioConfigRsp->rspInfo.serial);
|
EXPECT_EQ(serial, radioConfigRsp->rspInfo.serial);
|
||||||
EXPECT_EQ(RadioError::NONE, radioConfigRsp->rspInfo.error);
|
EXPECT_EQ(RadioError::NONE, radioConfigRsp->rspInfo.error);
|
||||||
// assuming only 1 slot
|
if (radioConfigRsp->simSlotStatus.size() > physicalSlotId) {
|
||||||
for (const SimSlotStatus& slotStatusResponse : radioConfigRsp->simSlotStatus) {
|
slotStatus = radioConfigRsp->simSlotStatus[physicalSlotId];
|
||||||
slotStatus = slotStatusResponse;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ static constexpr const char* FEATURE_TELEPHONY_CDMA = "android.hardware.telephon
|
|||||||
#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 MODEM_SET_SIM_POWER_DELAY_IN_SECONDS 2
|
#define MODEM_SET_SIM_POWER_DELAY_IN_SECONDS 2
|
||||||
|
#define MODEM_SET_SIM_SLOT_MAPPING_DELAY_IN_SECONDS 6
|
||||||
|
|
||||||
#define RADIO_SERVICE_SLOT1_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 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_SLOT2_NAME "slot2" // HAL instance name for SIM slot 2 on dual SIM device
|
||||||
@@ -146,5 +147,5 @@ class RadioServiceTest {
|
|||||||
void updateSimCardStatus();
|
void updateSimCardStatus();
|
||||||
|
|
||||||
/* Update SIM slot status */
|
/* Update SIM slot status */
|
||||||
void updateSimSlotStatus();
|
void updateSimSlotStatus(int physicalSlotId);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -171,6 +171,15 @@ TEST_P(RadioConfigTest, setSimSlotsMapping) {
|
|||||||
slotPortMapping.physicalSlotId = 0;
|
slotPortMapping.physicalSlotId = 0;
|
||||||
slotPortMapping.portId = 0;
|
slotPortMapping.portId = 0;
|
||||||
std::vector<SlotPortMapping> slotPortMappingList = {slotPortMapping};
|
std::vector<SlotPortMapping> slotPortMappingList = {slotPortMapping};
|
||||||
|
if (isDsDsEnabled()) {
|
||||||
|
slotPortMapping.physicalSlotId = 1;
|
||||||
|
slotPortMappingList.push_back(slotPortMapping);
|
||||||
|
} else if (isTsTsEnabled()) {
|
||||||
|
slotPortMapping.physicalSlotId = 1;
|
||||||
|
slotPortMappingList.push_back(slotPortMapping);
|
||||||
|
slotPortMapping.physicalSlotId = 2;
|
||||||
|
slotPortMappingList.push_back(slotPortMapping);
|
||||||
|
}
|
||||||
ndk::ScopedAStatus res = radio_config->setSimSlotsMapping(serial, slotPortMappingList);
|
ndk::ScopedAStatus res = radio_config->setSimSlotsMapping(serial, slotPortMappingList);
|
||||||
ASSERT_OK(res);
|
ASSERT_OK(res);
|
||||||
EXPECT_EQ(std::cv_status::no_timeout, wait());
|
EXPECT_EQ(std::cv_status::no_timeout, wait());
|
||||||
@@ -179,6 +188,9 @@ TEST_P(RadioConfigTest, setSimSlotsMapping) {
|
|||||||
ALOGI("setSimSlotsMapping, rspInfo.error = %s\n",
|
ALOGI("setSimSlotsMapping, rspInfo.error = %s\n",
|
||||||
toString(radioRsp_config->rspInfo.error).c_str());
|
toString(radioRsp_config->rspInfo.error).c_str());
|
||||||
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_config->rspInfo.error, {RadioError::NONE}));
|
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_config->rspInfo.error, {RadioError::NONE}));
|
||||||
|
|
||||||
|
// Give some time for modem to fully switch SIM configuration
|
||||||
|
sleep(MODEM_SET_SIM_SLOT_MAPPING_DELAY_IN_SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ TEST_P(RadioSimTest, setSimCardPower) {
|
|||||||
// have CardStatus::STATE_PRESENT after turning the power back on
|
// have CardStatus::STATE_PRESENT after turning the power back on
|
||||||
if (radioRsp_sim->rspInfo.error == RadioError::NONE) {
|
if (radioRsp_sim->rspInfo.error == RadioError::NONE) {
|
||||||
updateSimCardStatus();
|
updateSimCardStatus();
|
||||||
updateSimSlotStatus();
|
updateSimSlotStatus(cardStatus.slotMap.physicalSlotId);
|
||||||
EXPECT_EQ(CardStatus::STATE_PRESENT, cardStatus.cardState);
|
EXPECT_EQ(CardStatus::STATE_PRESENT, cardStatus.cardState);
|
||||||
EXPECT_EQ(CardStatus::STATE_PRESENT, slotStatus.cardState);
|
EXPECT_EQ(CardStatus::STATE_PRESENT, slotStatus.cardState);
|
||||||
if (CardStatus::STATE_PRESENT == slotStatus.cardState) {
|
if (CardStatus::STATE_PRESENT == slotStatus.cardState) {
|
||||||
|
|||||||
Reference in New Issue
Block a user