Merge "Return INVALID_ ARGUMENTS is the expected result" am: 97af8becd7 am: 5bc5bccb6b am: 3644ef1604 am: 927e1b3bad am: 1b32fe63bd am: 273be36b0c

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2648139

Change-Id: I7f5aa3cc5414607cafd0585fe79fa21cf809cde6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2023-07-06 09:52:37 +00:00 committed by Automerger Merge Worker
commit f566028519
6 changed files with 20 additions and 2 deletions

View file

@ -138,3 +138,7 @@ std::cv_status RadioResponseWaiter::wait() {
count_--;
return status;
}
bool isLteConnected(){
return testing::checkSubstringInCommandOutput("getprop gsm.network.type", "LTE");
}

View file

@ -104,6 +104,11 @@ bool isVoiceEmergencyOnly(RegState state);
*/
bool isVoiceInService(RegState state);
/*
* Check if device is in Lte Connected status.
*/
bool isLteConnected();
/**
* Used when waiting for an asynchronous response from the HAL.
*/

View file

@ -597,7 +597,7 @@ TEST_P(RadioHidlTest_v1_5, startNetworkScan) {
} else if (cardStatus.base.base.base.cardState == CardState::PRESENT) {
// Modems support 3GPP RAT family need to
// support scanning requests combined with some parameters.
if (deviceSupportsFeature(FEATURE_TELEPHONY_GSM)) {
if (deviceSupportsFeature(FEATURE_TELEPHONY_GSM) && isLteConnected()) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error,
{RadioError::NONE, RadioError::OPERATION_NOT_ALLOWED}));
} else {

View file

@ -240,3 +240,7 @@ void RadioServiceTest::updateSimSlotStatus(int physicalSlotId) {
slotStatus = radioConfigRsp->simSlotStatus[physicalSlotId];
}
}
bool isLteConnected(){
return testing::checkSubstringInCommandOutput("getprop gsm.network.type", "LTE");
}

View file

@ -131,6 +131,11 @@ bool isVoiceInService(RegState state);
*/
bool isServiceValidForDeviceConfiguration(std::string& serviceName);
/*
* Check if device is in Lte Connected status.
*/
bool isLteConnected();
/**
* RadioServiceTest base class
*/

View file

@ -886,7 +886,7 @@ TEST_P(RadioNetworkTest, startNetworkScan) {
if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::SIM_ABSENT}));
} else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
if (deviceSupportsFeature(FEATURE_TELEPHONY_GSM)) {
if (deviceSupportsFeature(FEATURE_TELEPHONY_GSM) && isLteConnected()) {
// Modems support 3GPP RAT family need to
// support scanning requests combined with some parameters.
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,