CSD: forward the native MEL exposure to AudioService
Added new aidl interface for the communication between the
SoundDoseManager and the SoundDoseHelper. Currently only the momentary
exposure warning is reported.
Test: manual
Bug: 257238734
Change-Id: I61560f81fedd31c30c39d676b7adf0ce087b495c
diff --git a/services/audioflinger/MelReporter.cpp b/services/audioflinger/MelReporter.cpp
index 6fc756b..279f30d 100644
--- a/services/audioflinger/MelReporter.cpp
+++ b/services/audioflinger/MelReporter.cpp
@@ -20,6 +20,7 @@
#include "AudioFlinger.h"
+#include <android/media/ISoundDoseCallback.h>
#include <audio_utils/power.h>
#include <utils/Log.h>
@@ -107,6 +108,12 @@
}
}
+void AudioFlinger::MelReporter::registerSoundDoseCallback(
+ const sp<media::ISoundDoseCallback>& callback) {
+ // no need to lock since registerSoundDoseCallback is synchronized
+ mSoundDoseManager.registerSoundDoseCallback(callback);
+}
+
std::string AudioFlinger::MelReporter::dump() {
std::lock_guard _l(mLock);
std::string output("\nSound Dose:\n");