[AudioPolicyManager] Fix mute/unmute while use DevicePortGain
In case of using Device Port Gain to control the volume, the logic
of setVolumeIndexForAttributes for device type check has been bypassed.
However, in case of unmuting, the volume will be applied to all streams
with requested device then will be set for AUDIO_DEVICE_OUT_DEFAULT_FOR_VOLUME
which is a convention used in case of no volume for device has been set
previously.
As this logic is bypassed, in case of HwGain, the final gain applied will
be the one for AUDIO_DEVICE_OUT_DEFAULT_FOR_VOLUME, which may be completely
different from the gain of current device.
This CL fixes this by factorizing the device check logic for both SW/HW gains.
Test: build & play music & Vol - until mute then volume +. No gap expected.
Change-Id: I24c57df84496e404c05c92f08f907131ef79cf3a
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
Loading
Please register or sign in to comment