From 9ef6889cec0bc314ebdc02786de345ad59e653ba Mon Sep 17 00:00:00 2001 From: Vlad Popa Date: Fri, 14 Apr 2023 18:18:44 +0200 Subject: [PATCH] CSD: Remove a2dp for safe volume index devices Currently there is no good way to identify whether an a2dp device is a bluetooth headphone for which the sound dose calculation can be applied or just a bluetooth speaker (e.g.: car kit). Disabling the CSD calculation for a2dp for now until we have a good solution for this use case. Test: dumpsys audio, audio_flinger Bug: 276660720 Change-Id: Iaced9137481ff82eaa51ef60e351371195d04a38 --- .../core/java/com/android/server/audio/SoundDoseHelper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/audio/SoundDoseHelper.java b/services/core/java/com/android/server/audio/SoundDoseHelper.java index 31f0c0514a8b5..a57dd403c662e 100644 --- a/services/core/java/com/android/server/audio/SoundDoseHelper.java +++ b/services/core/java/com/android/server/audio/SoundDoseHelper.java @@ -303,8 +303,9 @@ public class SoundDoseHelper { SAFE_MEDIA_VOLUME_UNINITIALIZED); mSafeMediaVolumeDevices.append(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES, SAFE_MEDIA_VOLUME_UNINITIALIZED); - mSafeMediaVolumeDevices.append(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, - SAFE_MEDIA_VOLUME_UNINITIALIZED); + // TODO(b/278265907): enable A2DP when we can distinguish A2DP headsets + // mSafeMediaVolumeDevices.append(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, + // SAFE_MEDIA_VOLUME_UNINITIALIZED); } float getOutputRs2UpperBound() {