CSD: enable sound dose in AudioService

Test: atest SoundDoseHelperTest
Bug: 268035692
Change-Id: I5945484aba553b8f6e910d738fa227b5e945101e
This commit is contained in:
Vlad Popa
2023-02-06 16:46:25 +01:00
parent f9307cb5cd
commit 71e0efd932
2 changed files with 11 additions and 1 deletions

View File

@@ -2078,7 +2078,7 @@
<integer name="config_audio_ring_vol_default">5</integer>
<!-- Enable sound dose computation and warnings -->
<bool name="config_audio_csd_enabled_default">false</bool>
<bool name="config_audio_csd_enabled_default">true</bool>
<!-- The default value for whether head tracking for
spatial audio is enabled for a newly connected audio device -->

View File

@@ -732,6 +732,16 @@ public class SoundDoseHelper {
private void initCsd() {
if (!mEnableCsd) {
final ISoundDose soundDose = AudioSystem.getSoundDoseInterface(mSoundDoseCallback);
if (soundDose == null) {
Log.w(TAG, "ISoundDose instance is null.");
return;
}
try {
soundDose.disableCsd();
} catch (RemoteException e) {
Log.e(TAG, "Cannot disable CSD", e);
}
return;
}