Add vts for microphone enumeration APIs.
Bug: 64038649
Test: run vts --module VtsHalAudioV4_0Target
Change-Id: If75ee585a9d865d010fc7d2a081b930fba022a20
diff --git a/audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp b/audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp
index de0df40..0bf32b5 100644
--- a/audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp
+++ b/audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp
@@ -74,6 +74,7 @@
using ReadStatus = ::android::hardware::audio::V4_0::IStreamIn::ReadStatus;
using ::android::hardware::audio::V4_0::IStreamOut;
using ::android::hardware::audio::V4_0::IStreamOutCallback;
+using ::android::hardware::audio::V4_0::MicrophoneInfo;
using ::android::hardware::audio::V4_0::MmapBufferInfo;
using ::android::hardware::audio::V4_0::MmapPosition;
using ::android::hardware::audio::V4_0::ParameterValue;
@@ -478,6 +479,17 @@
}
//////////////////////////////////////////////////////////////////////////////
+/////////////////////////////// getMicrophones ///////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+
+TEST_F(AudioPrimaryHidlTest, GetMicrophonesTest) {
+ doc::test("Make sure getMicrophones always succeeds");
+ hidl_vec<MicrophoneInfo> microphones;
+ ASSERT_OK(device->getMicrophones(returnIn(res, microphones)));
+ ASSERT_OK(res);
+}
+
+//////////////////////////////////////////////////////////////////////////////
//////////////////////////////// debugDebug //////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
@@ -1081,6 +1093,14 @@
ASSERT_OK(stream->updateSinkMetadata(initialMetadata));
}
+TEST_P(InputStreamTest, getActiveMicrophones) {
+ doc::test("Getting active microphones should always succeed");
+ hidl_vec<MicrophoneInfo> microphones;
+ ASSERT_OK(device->getMicrophones(returnIn(res, microphones)));
+ ASSERT_OK(res);
+ ASSERT_TRUE(microphones.size() > 0);
+}
+
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////// StreamOut //////////////////////////////////
//////////////////////////////////////////////////////////////////////////////