Audio HAL VTS: getDevice() == NONE => not supported
getDevice does not return a Result, thus it can not return NOT_SUPPORTED.
Consider NONE as not supported.
Test: vts-tradefed run vts --module VtsHalAudioV2_0Target
Test: call/play music/record/video...
Bug: 36311550
Change-Id: I3b6f7a1fbc1d1535faf549f5b031461cb39d1722
Signed-off-by: Kevin Rocard <krocard@google.com>
diff --git a/audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp b/audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp
index 6315af8..c31026f 100644
--- a/audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp
+++ b/audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp
@@ -815,10 +815,15 @@
&IStream::getFormat, &IStream::setFormat))
static void testGetDevice(IStream* stream, AudioDevice expectedDevice) {
+ // Unfortunately the interface does not allow the implementation to return
+ // NOT_SUPPORTED
+ // Thus allow NONE as signaling that the call is not supported.
auto ret = stream->getDevice();
ASSERT_TRUE(ret.isOk());
AudioDevice device = ret;
- ASSERT_EQ(expectedDevice, device);
+ ASSERT_TRUE(device == expectedDevice || device == AudioDevice::NONE)
+ << "Expected: " << ::testing::PrintToString(expectedDevice)
+ << "\n Actual: " << ::testing::PrintToString(device);
}
TEST_IO_STREAM(GetDevice,