audio VTS: CompressedOffloadOutputStream to check the vendor API level

Update CompressedOffloadOutputStream to fail the test if
compressed offload mix port does not support gapless offload
for a new device launching on T+.

Bug: 219767875
Test: atest VtsHalAudioV7_0TargetTest
Test: atest VtsHalAudioV7_1TargetTest
Change-Id: Iaadf6e9b9bb7340ccaf5bc26c45fda9654190510
Merged-In: Iaadf6e9b9bb7340ccaf5bc26c45fda9654190510
(cherry picked from commit 1bc0dc4ceb)
This commit is contained in:
Mikhail Naganov
2022-07-08 19:54:51 +00:00
parent 56f1666feb
commit 3f2e330990
2 changed files with 9 additions and 1 deletions

View File

@@ -18,6 +18,7 @@
#include <numeric>
#include <android-base/chrono_utils.h>
#include <cutils/properties.h>
#include "Generators.h"
@@ -900,10 +901,16 @@ class CompressedOffloadOutputStreamTest : public PcmOnlyConfigOutputStreamTest {
TEST_P(CompressedOffloadOutputStreamTest, Mp3FormatGaplessOffload) {
doc::test("Check that compressed offload mix ports for MP3 implement gapless offload");
const auto& flags = getOutputFlags();
const bool isNewDeviceLaunchingOnTPlus = property_get_int32("ro.vendor.api_level", 0) >= 33;
if (std::find_if(flags.begin(), flags.end(), [](const auto& flag) {
return flag == toString(xsd::AudioInOutFlag::AUDIO_OUTPUT_FLAG_GAPLESS_OFFLOAD);
}) == flags.end()) {
GTEST_SKIP() << "Compressed offload mix port does not support gapless offload";
if (isNewDeviceLaunchingOnTPlus) {
FAIL() << "New devices launching on Android T+ must support gapless offload, "
<< "see VSR-4.3-001";
} else {
GTEST_SKIP() << "Compressed offload mix port does not support gapless offload";
}
}
// FIXME: The presentation position is not updated if there is no zero padding in data.
std::vector<uint8_t> offloadData(stream->getBufferSize());

View File

@@ -34,6 +34,7 @@ cc_defaults {
],
shared_libs: [
"libbinder",
"libcutils",
"libfmq",
"libxml2",
],