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

Commit 5e66e79e authored by Robert Lee's avatar Robert Lee
Browse files

audiopolicy: fix ring stream volume cannot apply when previewing ringtone



Using AUDIO_DEVICE_OUT_SPEAKER to replace AUDIO_DEVICE_OUT_SPEAKER_SAFE
for device match.

Bug: 129456342
Test: volume can adjust while previewing ringtone
Change-Id: I3015f811ac6d2e3f3cdd606f453348c4bc526935
Signed-off-by: default avatarRobert Lee <lerobert@google.com>
parent de83aa7d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2463,6 +2463,11 @@ status_t AudioPolicyManager::setVolumeIndexForAttributes(const audio_attributes_
        sp<SwAudioOutputDescriptor> desc = mOutputs.valueAt(i);
        audio_devices_t curDevice = desc->devices().types();

        if (curDevice & AUDIO_DEVICE_OUT_SPEAKER_SAFE) {
            curDevice |= AUDIO_DEVICE_OUT_SPEAKER;
            curDevice &= ~AUDIO_DEVICE_OUT_SPEAKER_SAFE;
        }

        // Inter / intra volume group priority management: Loop on strategies arranged by priority
        // If a higher priority strategy is active, and the output is routed to a device with a
        // HW Gain management, do not change the volume