From 7700c1dc2dc69a841d376eba10eaa0fc4afd567e Mon Sep 17 00:00:00 2001 From: Hongbo Zeng Date: Tue, 30 Mar 2021 17:01:53 +0800 Subject: [PATCH] Fix crash issue for VTS setupDataCall_1_6_osAppId - donot check the osAppId for response if trafficDescriptors is empty due to no matching rule found Bug: 181187711 Test: * run command => atest VtsHalRadioV1_6TargetTest -- --test-arg com.android.tradefed.testtype.GTest:native-test-flag:"--gtest_filter=*slot1") and check the test result is PASSED [2/18] PerInstance/RadioHidlTest_v1_6#setupDataCall_1_6_osAppId/0_slot1: PASSED (24ms) Change-Id: Ic65b7a0eecc14a142ea69c2774344d9b601298fb --- radio/1.6/vts/functional/radio_hidl_hal_api.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/radio/1.6/vts/functional/radio_hidl_hal_api.cpp b/radio/1.6/vts/functional/radio_hidl_hal_api.cpp index e060dae6b8..b330585b2f 100644 --- a/radio/1.6/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.6/vts/functional/radio_hidl_hal_api.cpp @@ -158,6 +158,9 @@ TEST_P(RadioHidlTest_v1_6, setupDataCall_1_6_osAppId) { {::android::hardware::radio::V1_6::RadioError::NONE, ::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE, ::android::hardware::radio::V1_6::RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); + if (radioRsp_v1_6->setupDataCallResult.trafficDescriptors.size() <= 0) { + return; + } EXPECT_EQ(optionalTrafficDescriptor.value().osAppId.value().osAppId, radioRsp_v1_6->setupDataCallResult.trafficDescriptors[0].osAppId.value().osAppId); }