Add AUDIO_INPUT_FLAG_DIRECT to Audio HAL constants
This flag used to be framework only. To simplify constants
management it's better to have it defined at all layers.
Currently it is only used for MSD module but potentially
can be used for HDMI inputs.
Bug: 141273649
Test: use AOSP MSD on Pixel
atest VtsHalAudioV6_0TargetTest
Change-Id: I19f6fdb2772878c93e41b635dc6adae83a9fecb0
diff --git a/media/libaudiohal/impl/DeviceHalHidl.cpp b/media/libaudiohal/impl/DeviceHalHidl.cpp
index d52416c..cd3ac1f 100644
--- a/media/libaudiohal/impl/DeviceHalHidl.cpp
+++ b/media/libaudiohal/impl/DeviceHalHidl.cpp
@@ -289,6 +289,10 @@
sinkMetadata.tracks[0].destination.device(std::move(hidlOutputDevice));
}
#endif
+#if MAJOR_VERSION <= 5
+ // Some flags were specific to framework and must not leak to the HAL.
+ flags = static_cast<audio_input_flags_t>(flags & ~AUDIO_INPUT_FLAG_DIRECT);
+#endif
Return<void> ret = mDevice->openInputStream(
handle,
hidlDevice,