CSD: enable sound dose with internal MEL
Test: logs and dumpsys
Bug: 268035692
Change-Id: I0dd8ca5f8c925d984a782293bba1a7be121fca7c
diff --git a/services/audioflinger/sounddose/SoundDoseManager.h b/services/audioflinger/sounddose/SoundDoseManager.h
index 9e07d38..d7a686a 100644
--- a/services/audioflinger/sounddose/SoundDoseManager.h
+++ b/services/audioflinger/sounddose/SoundDoseManager.h
@@ -101,6 +101,9 @@
/** Clear all map entries with passed audio_port_handle_t. */
void clearMapDeviceIdEntries(audio_port_handle_t deviceId);
+ /** Returns true if CSD is disabled. */
+ bool isCsdDisabled();
+
std::string dump() const;
// used for testing only
@@ -134,6 +137,8 @@
const std::vector<media::SoundDoseRecord>& records) override;
binder::Status updateAttenuation(float attenuationDB, int device) override;
binder::Status getOutputRs2UpperBound(float* value) override;
+ binder::Status disableCsd() override;
+
binder::Status getCsd(float* value) override;
binder::Status forceUseFrameworkMel(bool useFrameworkMel) override;
binder::Status forceComputeCsdOnAllDevices(bool computeCsdOnAllDevices) override;
@@ -164,6 +169,7 @@
sp<media::ISoundDoseCallback> getSoundDoseCallback() const;
void updateAttenuation(float attenuationDB, audio_devices_t deviceType);
+ void disableCsd();
void setUseFrameworkMel(bool useFrameworkMel);
void setComputeCsdOnAllDevices(bool computeCsdOnAllDevices);
/** Returns the HAL sound dose interface or null if internal MEL computation is used. */
@@ -191,8 +197,10 @@
std::shared_ptr<ISoundDose> mHalSoundDose GUARDED_BY(mLock);
std::shared_ptr<HalSoundDoseCallback> mHalSoundDoseCallback GUARDED_BY(mLock);
- bool mUseFrameworkMel GUARDED_BY(mLock) = false;
+ bool mUseFrameworkMel GUARDED_BY(mLock) = true;
bool mComputeCsdOnAllDevices GUARDED_BY(mLock) = false;
+
+ bool mDisableCsd GUARDED_BY(mLock) = false;
};
} // namespace android