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

Commit 5276e23c authored by Tomoki Yonezawa's avatar Tomoki Yonezawa Committed by Vlad Popa
Browse files

audio: Fix unexpected mute on full volume device



Issue:
Full volume devices should not be mutable as their define. However,
when AudioManager#setStreamVolume is called with index zero while
using a full volume device, audio is muted unexpectedly. This creates
inconsistency with AudioManager#adjustStreamVolume behavior, which
correctly prevents muting on full volume devices.

Root Cause:
AudioService incorrectly applies mute state in onSetStreamVolume
even for full volume devices.

Solution:
Prevent mute state changes when setStreamVolume is called for
full volume devices.

Bug: 426346130
Test: manual - adb shell cmd media_session volume --set 0
      while using full volume device.
Flag: EXEMPT bugfix

Change-Id: I9fd99fd92b96bad49551ff9bf780fdcd7f28a72b
Signed-off-by: default avatarTomoki Yonezawa <Tomoki.Yonezawa@sony.com>
parent cd0b2fde
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -5681,8 +5681,11 @@ public class AudioService extends IAudioService.Stub
            onSetStreamVolume(streamType, index, flags, deviceType, caller, hasModifyAudioSettings,
                    // ada is non-null when called from setDeviceVolume,
                    // which shouldn't update the mute state
                    canChangeMuteAndUpdateController /*canChangeMute*/);
                    // full volume device shouldn't update the mute state
                    /* canChangeMute= */ canChangeMuteAndUpdateController
                            && !isFullVolumeDevice(deviceType));
            index = streamState.getIndex(deviceType);
        }
        handleAbsoluteVolume(streamType, streamTypeAlias, deviceAttr, index, streamState.mIsMuted,