From 0877d4aa17baadbe315663270aee9b3f33d7fa55 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Mon, 4 Apr 2022 19:06:42 +0000 Subject: [PATCH] VTS: Remove enforce codec2 on ATV for S devices Allow ATV devices to pass codec2 check if launched with Android S or earlier. Codec2 support is only mandatory for Android T on Android TV. Bug: 226932158 Test: atest StoreHidlTest Signed-off-by: Derek Smith Change-Id: I67a855108191da96810ea23c821d8a80752862e7 --- .../VtsHalMediaOmxV1_0TargetStoreTest.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp b/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp index d9a6363ec9..5fa13e7c5a 100644 --- a/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp +++ b/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -377,6 +378,10 @@ static int getFirstApiLevel() { return android::base::GetIntProperty("ro.product.first_api_level", __ANDROID_API_T__); } +static bool isTV() { + return testing::deviceSupportsFeature("android.software.leanback"); +} + // list components and roles. TEST_P(StoreHidlTest, OmxCodecAllowedTest) { hidl_vec componentInfos = getComponentInfoList(omx); @@ -384,9 +389,16 @@ TEST_P(StoreHidlTest, OmxCodecAllowedTest) { for (std::string role : info.mRoles) { if (role.find("video_decoder") != std::string::npos || role.find("video_encoder") != std::string::npos) { - ASSERT_LT(getFirstApiLevel(), __ANDROID_API_S__) - << " Component: " << info.mName.c_str() << " Role: " << role.c_str() - << " not allowed for devices launching with Android S and above"; + // Codec2 is not mandatory on Android TV devices that launched with Android S + if (isTV()) { + ASSERT_LT(getFirstApiLevel(), __ANDROID_API_T__) + << " Component: " << info.mName.c_str() << " Role: " << role.c_str() + << " not allowed for devices launching with Android T and above"; + } else { + ASSERT_LT(getFirstApiLevel(), __ANDROID_API_S__) + << " Component: " << info.mName.c_str() << " Role: " << role.c_str() + << " not allowed for devices launching with Android S and above"; + } } if (role.find("audio_decoder") != std::string::npos || role.find("audio_encoder") != std::string::npos) {