Merge "CSD: enable sound dose in AudioService" into udc-dev

This commit is contained in:
Vlad Popa
2023-03-17 23:04:23 +00:00
committed by Android (Google) Code Review
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;
}