audio VTS: CompressedOffloadOutputStream to check the vendor API level am: 3f2e330990
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/19340462
Change-Id: I85785803514d775f765e1ae4217a17591d7e4fb7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp b/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp
index 37992ae..13068dc 100644
--- a/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp
+++ b/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp
@@ -18,6 +18,7 @@
#include <numeric>
#include <android-base/chrono_utils.h>
+#include <cutils/properties.h>
#include "Generators.h"
@@ -900,10 +901,16 @@
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());
diff --git a/audio/core/all-versions/vts/functional/Android.bp b/audio/core/all-versions/vts/functional/Android.bp
index 5b0a7f2..daed7a8 100644
--- a/audio/core/all-versions/vts/functional/Android.bp
+++ b/audio/core/all-versions/vts/functional/Android.bp
@@ -34,6 +34,7 @@
],
shared_libs: [
"libbinder",
+ "libcutils",
"libfmq",
"libxml2",
],