Soundpool: use audio attributes instead of legacy stream type
Use audio attributes to specifcy the use case and make sure performance flags
in audio attributes are reflecting the output flags passed to the AudioTrack by
Stream::play_l().
Bug: 283003710
Test: make
Change-Id: If9c53e807425abe71f4172b5160af0a5be24e81c
diff --git a/media/jni/soundpool/StreamManager.cpp b/media/jni/soundpool/StreamManager.cpp
index acd4bad..52060f1 100644
--- a/media/jni/soundpool/StreamManager.cpp
+++ b/media/jni/soundpool/StreamManager.cpp
@@ -109,7 +109,10 @@
int32_t streams, size_t threads, const audio_attributes_t& attributes,
std::string opPackageName)
: StreamMap(streams)
- , mAttributes(attributes)
+ , mAttributes([attributes](){
+ audio_attributes_t attr = attributes;
+ attr.flags = static_cast<audio_flags_mask_t>(attr.flags | AUDIO_FLAG_LOW_LATENCY);
+ return attr; }())
, mOpPackageName(std::move(opPackageName))
, mLockStreamManagerStop(streams == 1 || kForceLockStreamManagerStop)
{