diff --git a/radio/1.0/vts/functional/vts_test_util.cpp b/radio/1.0/vts/functional/vts_test_util.cpp index 5b31accbd2..0515778029 100644 --- a/radio/1.0/vts/functional/vts_test_util.cpp +++ b/radio/1.0/vts/functional/vts_test_util.cpp @@ -138,3 +138,7 @@ std::cv_status RadioResponseWaiter::wait() { count_--; return status; } + +bool isLteConnected(){ + return testing::checkSubstringInCommandOutput("getprop gsm.network.type", "LTE"); +} diff --git a/radio/1.0/vts/functional/vts_test_util.h b/radio/1.0/vts/functional/vts_test_util.h index fa338a38a5..39c754584a 100644 --- a/radio/1.0/vts/functional/vts_test_util.h +++ b/radio/1.0/vts/functional/vts_test_util.h @@ -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. */ diff --git a/radio/1.5/vts/functional/radio_hidl_hal_api.cpp b/radio/1.5/vts/functional/radio_hidl_hal_api.cpp index fd44e9309e..3d3abe4050 100644 --- a/radio/1.5/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.5/vts/functional/radio_hidl_hal_api.cpp @@ -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 { diff --git a/radio/aidl/vts/radio_aidl_hal_utils.cpp b/radio/aidl/vts/radio_aidl_hal_utils.cpp index f18da55c3f..5781b4212e 100644 --- a/radio/aidl/vts/radio_aidl_hal_utils.cpp +++ b/radio/aidl/vts/radio_aidl_hal_utils.cpp @@ -227,3 +227,7 @@ void RadioServiceTest::updateSimSlotStatus(int physicalSlotId) { slotStatus = radioConfigRsp->simSlotStatus[physicalSlotId]; } } + +bool isLteConnected(){ + return testing::checkSubstringInCommandOutput("getprop gsm.network.type", "LTE"); +} diff --git a/radio/aidl/vts/radio_aidl_hal_utils.h b/radio/aidl/vts/radio_aidl_hal_utils.h index 8170a0114b..e68c5c185a 100644 --- a/radio/aidl/vts/radio_aidl_hal_utils.h +++ b/radio/aidl/vts/radio_aidl_hal_utils.h @@ -128,6 +128,11 @@ bool isVoiceInService(RegState state); */ bool isServiceValidForDeviceConfiguration(std::string& serviceName); +/* + * Check if device is in Lte Connected status. + */ +bool isLteConnected(); + /** * RadioServiceTest base class */ diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp index 61b34d7db5..467e6c7b7b 100644 --- a/radio/aidl/vts/radio_network_test.cpp +++ b/radio/aidl/vts/radio_network_test.cpp @@ -858,7 +858,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,