diff options
author | Wonsik Kim <wonsik@google.com> | 2023-03-02 04:13:23 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-03-02 04:13:23 +0000 |
commit | 0bc597ad2c4eb0301d2c35a79e1e237ef3b49a4c (patch) | |
tree | d79dd5254dd87ccbdffa607a2d7d5e0c3b4d7063 | |
parent | a1e9dcd344a9fe88e1a9e861c69375ee2b392a0d (diff) | |
parent | 238e67aa3e353384753eca518412cb147e2c86a1 (diff) |
VtsHalMediaOmx: fix OmxCodecAllowedTest to match requirement am: 86e97b5f11 am: da8e650fdd am: 238e67aa3e
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2461813
Change-Id: Ie8828dd9f773ceed8be32caa6e8d3f3565dd8708
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--[-rwxr-xr-x] | media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp | 25 |
1 files changed, 10 insertions, 15 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 00e9837710..d80e651bcf 100755..100644 --- a/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp +++ b/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp @@ -374,21 +374,16 @@ TEST_P(StoreHidlTest, ListRoles) { } } -static int getFirstApiLevel() { - int boardApiLevel = android::base::GetIntProperty("ro.board.first_api_level", 0); - if (boardApiLevel != 0) { - return boardApiLevel; - } - - 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) { + static int sBoardFirstApiLevel = android::base::GetIntProperty("ro.board.first_api_level", 0); + if (sBoardFirstApiLevel == 0) { + GTEST_SKIP() << "board first API level not detected"; + } hidl_vec<IOmx::ComponentInfo> componentInfos = getComponentInfoList(omx); for (IOmx::ComponentInfo info : componentInfos) { for (std::string role : info.mRoles) { @@ -396,27 +391,27 @@ TEST_P(StoreHidlTest, OmxCodecAllowedTest) { role.find("video_encoder") != std::string::npos) { // Codec2 is not mandatory on Android TV devices that launched with Android S if (isTV()) { - ASSERT_LT(getFirstApiLevel(), __ANDROID_API_T__) + ASSERT_LT(sBoardFirstApiLevel, __ANDROID_API_T__) << " Component: " << info.mName.c_str() << " Role: " << role.c_str() << " not allowed for devices launching with Android T and above"; } else { std::string codecName = info.mName; bool isAndroidCodec = (codecName.rfind("OMX.google", 0) != std::string::npos); - if (isAndroidCodec && (getFirstApiLevel() <= __ANDROID_API_S__)) { + if (isAndroidCodec && (sBoardFirstApiLevel <= __ANDROID_API_S__)) { // refer b/230582620 // S AOSP build did not remove the OMX.google video codecs // so it is infeasible to require no OMX.google.* video codecs // on S launching devices } 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"; + ASSERT_LT(sBoardFirstApiLevel, __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) { - ASSERT_LT(getFirstApiLevel(), __ANDROID_API_T__) + ASSERT_LT(sBoardFirstApiLevel, __ANDROID_API_T__) << " Component: " << info.mName.c_str() << " Role: " << role.c_str() << " not allowed for devices launching with Android T and above"; } |