CSD: return interface for messages to audio server
Whenever the AudioService registers for receiving sound dose callbacks from the
native side, the native sends back the ISoundDose interface.
Test: logs, dumpsys and UT
Bug: 257238734
Change-Id: I5605196e8be91f00a7fbcf65573dfabe6e5c03d3
diff --git a/services/audioflinger/MelReporter.cpp b/services/audioflinger/MelReporter.cpp
index 279f30d..8cc7eab 100644
--- a/services/audioflinger/MelReporter.cpp
+++ b/services/audioflinger/MelReporter.cpp
@@ -108,10 +108,10 @@
}
}
-void AudioFlinger::MelReporter::registerSoundDoseCallback(
+sp<media::ISoundDose> AudioFlinger::MelReporter::getSoundDoseInterface(
const sp<media::ISoundDoseCallback>& callback) {
- // no need to lock since registerSoundDoseCallback is synchronized
- mSoundDoseManager.registerSoundDoseCallback(callback);
+ // no need to lock since getSoundDoseInterface is synchronized
+ return mSoundDoseManager.getSoundDoseInterface(callback);
}
std::string AudioFlinger::MelReporter::dump() {