Return INVALID_ ARGUMENTS is the expected result
For devices not in LTE service, the vts test returns INVALID_ ARGUMENTS is an expected result
Bug:289756066
Test:
VtsHalRadioV1_5TargetTest PerInstance/RadioHidlTest_v1_5#startNetworkScan/0_slot1
VtsHalRadioV1_5TargetTest PerInstance/RadioHidlTest_v1_5#startNetworkScan/1_slot2
Change-Id: I873d51e089b27aa0cc0dc9f5f25fd8ffaa4d8f40
Signed-off-by: liuxiangjun <liuxiangjun3@xiaomi.com>
Merged-In: I873d51e089b27aa0cc0dc9f5f25fd8ffaa4d8f40
diff --git a/radio/1.0/vts/functional/vts_test_util.cpp b/radio/1.0/vts/functional/vts_test_util.cpp
index 5b31acc..0515778 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 @@
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 fa338a3..39c7545 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 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 fd44e93..3d3abe4 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 @@
} 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 f18da55..5781b42 100644
--- a/radio/aidl/vts/radio_aidl_hal_utils.cpp
+++ b/radio/aidl/vts/radio_aidl_hal_utils.cpp
@@ -227,3 +227,7 @@
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 8170a01..e68c5c1 100644
--- a/radio/aidl/vts/radio_aidl_hal_utils.h
+++ b/radio/aidl/vts/radio_aidl_hal_utils.h
@@ -128,6 +128,11 @@
*/
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 61b34d7..467e6c7 100644
--- a/radio/aidl/vts/radio_network_test.cpp
+++ b/radio/aidl/vts/radio_network_test.cpp
@@ -858,7 +858,7 @@
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,