[android/platform-hardware-interfaces.git] / audio / core / 4.0 / vts / functional / AudioPrimaryHidlHalTest.cpp
diff --git a/audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp b/audio/core/4.0/vts/functional/AudioPrimaryHidlHalTest.cpp
index de0df400e578837f15f85e44f320354ee75c27e2..0bf32b5788f8ee6b56a24e13bf1dcf7a08708081 100644 (file)
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;
ASSERT_OK(device->setParameters(context, values));
}
+//////////////////////////////////////////////////////////////////////////////
+/////////////////////////////// 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 //////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
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 //////////////////////////////////
//////////////////////////////////////////////////////////////////////////////