Fix null pointer crash in AIDL radio HAL VTS

Bug: 277531858
Test: atest VtsHalBroadcastradioAidlTargetTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:978de0a8a4968774e81e10e716a46bd9e1369479)
Merged-In: Icb67c27b9a747411a9bfbd48647e6e6046cf5e8d
Change-Id: Icb67c27b9a747411a9bfbd48647e6e6046cf5e8d
This commit is contained in:
Weilin Xu 2023-07-19 17:20:19 +00:00 committed by Cherrypicker Worker
parent d8f18469c3
commit cf892db1ef

View file

@ -997,13 +997,12 @@ TEST_P(BroadcastRadioHalTest, SetConfigFlags) {
LOG(DEBUG) << "SetConfigFlags Test"; LOG(DEBUG) << "SetConfigFlags Test";
auto get = [&](ConfigFlag flag) -> bool { auto get = [&](ConfigFlag flag) -> bool {
bool* gotValue = nullptr; bool gotValue;
auto halResult = mModule->isConfigFlagSet(flag, gotValue); auto halResult = mModule->isConfigFlagSet(flag, &gotValue);
EXPECT_FALSE(gotValue == nullptr);
EXPECT_TRUE(halResult.isOk()); EXPECT_TRUE(halResult.isOk());
return *gotValue; return gotValue;
}; };
auto notSupportedError = resultToInt(Result::NOT_SUPPORTED); auto notSupportedError = resultToInt(Result::NOT_SUPPORTED);