summaryrefslogtreecommitdiff
path: root/audio/core/all-versions/default/Stream.cpp
diff options
context:
space:
mode:
authorMikhail Naganov <mnaganov@google.com>2019-11-01 16:28:37 -0700
committerMikhail Naganov <mnaganov@google.com>2019-11-11 10:29:06 -0800
commit60bd3ecc5d90d1d8ed4adc697fc8c48cef47e412 (patch)
tree7bf49284a448d27e11ef65a7b606c060e01bf76c /audio/core/all-versions/default/Stream.cpp
parent686af1cc4351de44ed77c1cd32986ec04f8885ca (diff)
audio: Run VTS tests for streams of non-primary modules for HAL V6
Implement parsing of AudioPolicyManager config for finding out supported format configurations of streams. This only applies when running tests for HAL V6. Previously format configurations mandated by CDD were used for testing, this does not work well for non-primary modules. Fix the following issues found while running the tests for "r_submix" and "msd" modules: - IStream::getSupportedFormats must return a status to indicate that this capability is not supported by HAL; - it is allowed for IStream::setDevices to return NOT_SUPPORTED status. Other changes: - Factor out helper functions for generating format configurations; - Fix generation of the channel mask component in the names of tests that use AudioConfig, add sampling rate to test names. Squashed with the following commit to avoid breaking compilation: audio vts: Remove explicit dependency on the new types Avoid using the new ChannelMaskSet and SampleRateSet types directly to simplify upstreaming. Bug: 141989952 Bug: 141847510 Test: atest VtsHalAudioV5_0TargetTest atest VtsHalAudioV6_0TargetTest also, run modified V5_0 test using generators for V6_0 Change-Id: If0d330881901908e546baab89f63d3333003e355 Merged-In: If0d330881901908e546baab89f63d3333003e355
Diffstat (limited to 'audio/core/all-versions/default/Stream.cpp')
-rw-r--r--audio/core/all-versions/default/Stream.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/audio/core/all-versions/default/Stream.cpp b/audio/core/all-versions/default/Stream.cpp
index e62f6d3b0a..5f24a5d781 100644
--- a/audio/core/all-versions/default/Stream.cpp
+++ b/audio/core/all-versions/default/Stream.cpp
@@ -175,8 +175,17 @@ Return<void> Stream::getSupportedFormats(getSupportedFormats_cb _hidl_cb) {
for (size_t i = 0; i < halFormats.size(); ++i) {
formats[i] = AudioFormat(halFormats[i]);
}
+ // Legacy get_parameter does not return a status_t, thus can not advertise of failure.
+ // Note that the method must not return an empty list if this capability is supported.
+ if (formats.size() == 0) {
+ result = Result::NOT_SUPPORTED;
+ }
}
+#if MAJOR_VERSION <= 5
_hidl_cb(formats);
+#elif MAJOR_VERSION >= 6
+ _hidl_cb(result, formats);
+#endif
return Void();
}