Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 287bb121 authored by Eric Laurent's avatar Eric Laurent Committed by Gerrit Code Review
Browse files

Merge "audio: ble: volume computation improvement on BLE for notifications" into main

parents cbef7606 58f15fd8
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -7862,9 +7862,10 @@ float AudioPolicyManager::computeVolume(IVolumeCurves &curves,
            }
            }
            if (Volume::getDeviceForVolume(deviceTypes) != AUDIO_DEVICE_OUT_SPEAKER
            if (Volume::getDeviceForVolume(deviceTypes) != AUDIO_DEVICE_OUT_SPEAKER
                    &&  !Intersection(deviceTypes, {AUDIO_DEVICE_OUT_BLUETOOTH_A2DP,
                    &&  !Intersection(deviceTypes, {AUDIO_DEVICE_OUT_BLUETOOTH_A2DP,
                        AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES}).empty()) {
                        AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES,
                // on A2DP, also ensure notification volume is not too low compared to media when
                        AUDIO_DEVICE_OUT_BLE_HEADSET}).empty()) {
                // intended to be played
                // on A2DP/BLE, also ensure notification volume is not too low compared to media
                // when intended to be played.
                if ((volumeDb > -96.0f) &&
                if ((volumeDb > -96.0f) &&
                        (musicVolDb - SONIFICATION_A2DP_MAX_MEDIA_DIFF_DB > volumeDb)) {
                        (musicVolDb - SONIFICATION_A2DP_MAX_MEDIA_DIFF_DB > volumeDb)) {
                    ALOGV("%s increasing volume for volume source=%d device=%s from %f to %f",
                    ALOGV("%s increasing volume for volume source=%d device=%s from %f to %f",