CSD: rename get/setOutputRs2 to include upper bound
RS2 represents an interval of power levels. This is why it is clearer to
specify upper bound in the naming to make it clear that we refer to the
upper limit which when exceeded will trigger a momentary exposure.
Test: atest sounddosemanager_tests
Bug: 273961110
Change-Id: I4e155f2a8cdb23f85623c471364ba1e5d245386b
diff --git a/services/audioflinger/sounddose/SoundDoseManager.h b/services/audioflinger/sounddose/SoundDoseManager.h
index f31a5d9..9e07d38 100644
--- a/services/audioflinger/sounddose/SoundDoseManager.h
+++ b/services/audioflinger/sounddose/SoundDoseManager.h
@@ -36,12 +36,12 @@
public:
/** CSD is computed with a rolling window of 7 days. */
static constexpr int64_t kCsdWindowSeconds = 604800; // 60s * 60m * 24h * 7d
- /** Default RS2 value in dBA as defined in IEC 62368-1 3rd edition. */
- static constexpr float kDefaultRs2Value = 100.f;
+ /** Default RS2 upper bound in dBA as defined in IEC 62368-1 3rd edition. */
+ static constexpr float kDefaultRs2UpperBound = 100.f;
SoundDoseManager()
: mMelAggregator(sp<audio_utils::MelAggregator>::make(kCsdWindowSeconds)),
- mRs2Value(kDefaultRs2Value) {};
+ mRs2UpperBound(kDefaultRs2UpperBound) {};
/**
* \brief Creates or gets the MelProcessor assigned to the streamHandle
@@ -68,12 +68,12 @@
void removeStreamProcessor(audio_io_handle_t streamHandle);
/**
- * Sets the output RS2 value for momentary exposure warnings. Must not be
+ * Sets the output RS2 upper bound for momentary exposure warnings. Must not be
* higher than 100dBA and not lower than 80dBA.
*
* \param rs2Value value to use for momentary exposure
*/
- void setOutputRs2(float rs2Value);
+ void setOutputRs2UpperBound(float rs2Value);
/**
* \brief Registers the interface for passing callbacks to the AudioService and gets
@@ -129,11 +129,11 @@
virtual void binderDied(const wp<IBinder>& who);
/** BnSoundDose override */
- binder::Status setOutputRs2(float value) override;
+ binder::Status setOutputRs2UpperBound(float value) override;
binder::Status resetCsd(float currentCsd,
const std::vector<media::SoundDoseRecord>& records) override;
binder::Status updateAttenuation(float attenuationDB, int device) override;
- binder::Status getOutputRs2(float* value) override;
+ binder::Status getOutputRs2UpperBound(float* value) override;
binder::Status getCsd(float* value) override;
binder::Status forceUseFrameworkMel(bool useFrameworkMel) override;
binder::Status forceComputeCsdOnAllDevices(bool computeCsdOnAllDevices) override;
@@ -183,7 +183,7 @@
std::map<AudioDeviceTypeAddr, audio_port_handle_t> mActiveDevices GUARDED_BY(mLock);
std::unordered_map<audio_port_handle_t, audio_devices_t> mActiveDeviceTypes GUARDED_BY(mLock);
- float mRs2Value GUARDED_BY(mLock);
+ float mRs2UpperBound GUARDED_BY(mLock);
std::unordered_map<audio_devices_t, float> mMelAttenuationDB GUARDED_BY(mLock);
sp<SoundDose> mSoundDose GUARDED_BY(mLock);