From 845f0fbd1e4d940d058cbb18f92ae4c15553ce39 Mon Sep 17 00:00:00 2001 From: Aaron Tsai Date: Fri, 7 May 2021 19:29:24 +0800 Subject: [PATCH] Fix VTS crash for getAvailableNetworks in Radio 1.6 Bug: 187494016 Test: atest VtsHalRadioV1_6TargetTest -- --test-arg com.android.tradefed.testtype.GTest:native-test-flag:"--gtest_filter=*getAvailableNetworks/0_slot1" Change-Id: I3a3b5a0121cc97fbf6782da863d0ff6226504ee8 --- radio/1.6/vts/functional/radio_hidl_hal_misc.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/radio/1.6/vts/functional/radio_hidl_hal_misc.cpp b/radio/1.6/vts/functional/radio_hidl_hal_misc.cpp index 422244178c..8c99d92b7b 100644 --- a/radio/1.6/vts/functional/radio_hidl_hal_misc.cpp +++ b/radio/1.6/vts/functional/radio_hidl_hal_misc.cpp @@ -45,10 +45,8 @@ TEST_P(RadioHidlTest_v1_6, getAvailableNetworks) { ::android::hardware::radio::V1_0::RadioError::NONE) { static const std::regex kOperatorNumericRe("^[0-9]{5,6}$"); for (OperatorInfo info : radioRsp_v1_6->networkInfos) { - if (info.operatorNumeric != nullptr) { - ASSERT_TRUE( - std::regex_match(std::string(info.operatorNumeric), kOperatorNumericRe)); - } + ASSERT_TRUE( + std::regex_match(std::string(info.operatorNumeric), kOperatorNumericRe)); } }