From 399c257ecee35f445270c75e8b76aefd6af542df Mon Sep 17 00:00:00 2001 From: Zhang Yuan Date: Sat, 4 Mar 2023 17:05:09 +0800 Subject: [PATCH] Add REQUEST_NOT_SUPPORTED and INVALID_ARGUMENTS to be allowed. For those devices which does not support GSM, returning is not supported or invalid arguments are the expected behavior. Bug: 271642958 Test: atest VtsHalRadioTargetTest Merged-In: I3ac7407fdee82348411db99d340613e62f36a277 Change-Id: I3ac7407fdee82348411db99d340613e62f36a277 Signed-off-by: Jia Jia (cherry picked from commit 5bf6d5777ab5cc67379e57c5e5550c2cffcc6a5b) --- radio/1.5/vts/functional/radio_hidl_hal_api.cpp | 15 ++++++++++----- radio/aidl/vts/radio_network_test.cpp | 11 +++++++++-- 2 files changed, 19 insertions(+), 7 deletions(-) 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 152858f6a8..5994d880d6 100644 --- a/radio/1.5/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.5/vts/functional/radio_hidl_hal_api.cpp @@ -595,12 +595,17 @@ TEST_P(RadioHidlTest_v1_5, startNetworkScan) { if (cardStatus.base.base.base.cardState == CardState::ABSENT) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error, {RadioError::SIM_ABSENT})); } else if (cardStatus.base.base.base.cardState == CardState::PRESENT) { - // OPERATION_NOT_ALLOWED should not be allowed; however, some vendors do - // not support the required manual GSM search functionality. This is - // tracked in b/112206766. Modems have "GSM" rat scan need to + // Modems have "GSM" rat scan need to // support scanning requests combined with some parameters. - ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error, - {RadioError::NONE, RadioError::OPERATION_NOT_ALLOWED})); + if (deviceSupportsFeature(FEATURE_TELEPHONY_GSM)) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error, + {RadioError::NONE, RadioError::OPERATION_NOT_ALLOWED})); + } else { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_v1_5->rspInfo.error, + {RadioError::NONE, RadioError::OPERATION_NOT_ALLOWED, + RadioError::REQUEST_NOT_SUPPORTED, RadioError::INVALID_ARGUMENTS})); + } } if (radioRsp_v1_5->rspInfo.error == RadioError::NONE) { diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp index c83571ee0a..679d6c7796 100644 --- a/radio/aidl/vts/radio_network_test.cpp +++ b/radio/aidl/vts/radio_network_test.cpp @@ -862,8 +862,15 @@ TEST_P(RadioNetworkTest, startNetworkScan) { // not support the required manual GSM search functionality. This is // tracked in b/112206766. Modems have "GSM" rat scan need to // support scanning requests combined with some parameters. - ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, - {RadioError::NONE, RadioError::OPERATION_NOT_ALLOWED})); + if (deviceSupportsFeature(FEATURE_TELEPHONY_GSM)) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::OPERATION_NOT_ALLOWED})); + } else { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::OPERATION_NOT_ALLOWED, RadioError::NONE, + RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED})); + } } if (radioRsp_network->rspInfo.error == RadioError::NONE) {