UsecaseValidator: ignore special use cases when usage is unknown
The game usecase validator must ignore special routing use cases
indicated by audio attributes flags (BT SCO, TTS...) when the usage
is unknown.
Also fix a problem in ToneGenerator where the attributes flags were
overwritten when the low latency flag was set.
Bug: 283014940
Test: repro steps in bug
Change-Id: I4d5a038436b0dd2453dd8320dafba478970bb06e
diff --git a/media/libaudioclient/ToneGenerator.cpp b/media/libaudioclient/ToneGenerator.cpp
index 7c0ce57..9c4ccb8 100644
--- a/media/libaudioclient/ToneGenerator.cpp
+++ b/media/libaudioclient/ToneGenerator.cpp
@@ -1306,7 +1306,7 @@
streamType = AUDIO_STREAM_DTMF;
}
attr = AudioSystem::streamTypeToAttributes(streamType);
- attr.flags = AUDIO_FLAG_LOW_LATENCY;
+ attr.flags = static_cast<audio_flags_mask_t>(attr.flags | AUDIO_FLAG_LOW_LATENCY);
const size_t frameCount = mProcessSize;
status_t status = mpAudioTrack->set(