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
This commit is contained in:
Hongbo Zeng 2021-03-30 17:01:53 +08:00
parent 02f3e6be8b
commit 7700c1dc2d

View file

@ -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);
}