Add metadata format check in bcradio VTS

Added metadata format check in AIDL broadcast radio HAL VTS.

Bug: 318868350
Test: atest VtsHalBroadcastradioAidlTargetTest
Change-Id: I47cdb178e76173941682fd8594fe9da13d661a1b
This commit is contained in:
Weilin Xu 2024-01-10 15:13:43 -08:00
parent 67e83a3c06
commit 2f1dd4cda8

View file

@ -250,6 +250,16 @@ ScopedAStatus TunerCallbackImpl::onCurrentProgramInfoChanged(const ProgramInfo&
}
}
for (const auto& metadataItem : info.metadata) {
bool validMetadata = false;
if (mCallbackAidlVersion == kAidlVersion1) {
validMetadata = bcutils::isValidMetadata(metadataItem);
} else {
validMetadata = bcutils::isValidMetadataV2(metadataItem);
}
EXPECT_TRUE(validMetadata) << "Invalid metadata " << metadataItem.toString().c_str();
}
{
std::lock_guard<std::mutex> lk(mLock);
mCurrentProgramInfo = info;