CSD: enable CSD for MMap threads
Using the buffer provided by the AAudio service to add values to the
sound dosage.
Test: OboeTester with AAudio and MMap
Bug: 264254430
Change-Id: I38b7d3b69bc8d6923f848bc504c6290ae1961cbc
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 3b73333..27428b9 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -3679,6 +3679,20 @@
return thread;
}
+// checkOutputThread_l() must be called with AudioFlinger::mLock held
+sp<AudioFlinger::ThreadBase> AudioFlinger::checkOutputThread_l(audio_io_handle_t ioHandle) const
+{
+ if (audio_unique_id_get_use(ioHandle) != AUDIO_UNIQUE_ID_USE_OUTPUT) {
+ return nullptr;
+ }
+
+ sp<AudioFlinger::ThreadBase> thread = mPlaybackThreads.valueFor(ioHandle);
+ if (thread == nullptr) {
+ thread = mMmapThreads.valueFor(ioHandle);
+ }
+ return thread;
+}
+
// checkPlaybackThread_l() must be called with AudioFlinger::mLock held
AudioFlinger::PlaybackThread *AudioFlinger::checkPlaybackThread_l(audio_io_handle_t output) const
{