Add aaudio APC opt-out
The opt-out was only present in the java API but not on the native ones.
Test: atest test_attributes
Change-Id: I1b84f1a428508e00de65e615b59405b9ee2ba009
Signed-off-by: Kevin Rocard <krocard@google.com>
diff --git a/services/oboeservice/AAudioServiceEndpointMMAP.cpp b/services/oboeservice/AAudioServiceEndpointMMAP.cpp
index 6c28083..fbf7d10 100644
--- a/services/oboeservice/AAudioServiceEndpointMMAP.cpp
+++ b/services/oboeservice/AAudioServiceEndpointMMAP.cpp
@@ -93,12 +93,14 @@
const audio_source_t source = (direction == AAUDIO_DIRECTION_INPUT)
? AAudioConvert_inputPresetToAudioSource(getInputPreset())
: AUDIO_SOURCE_DEFAULT;
+ const audio_flags_mask_t flags = AUDIO_FLAG_LOW_LATENCY |
+ AAudioConvert_allowCapturePolicyToAudioFlagsMask(getAllowedCapturePolicy());
const audio_attributes_t attributes = {
.content_type = contentType,
.usage = usage,
.source = source,
- .flags = AUDIO_FLAG_LOW_LATENCY,
+ .flags = flags,
.tags = ""
};