Fix regression on voice call default volume

This CL fixes regression introduced by aosp/586122.
The fallback of default volume uses a temporary max volume which may
not be valid. (-1).
This CL uses the up to date AudioSystem.DEFAULT_STREAM_VOLUME instead.
This happens only if no "ro.config.vc_call_vol_default" property defined.

Test: Ensure "ro.config.vc_call_vol_default" is not defined &&
    dumpsys audio && ensure VOICE CALL default volume (aka for device 40000000)
    is not zero.

Signed-off-by: François Gaffie <francois.gaffie@renault.com>
Change-Id: I8937e54a61df196da8c2578f0a581b63dea34caa
This commit is contained in:
François Gaffie
2020-03-11 14:09:52 +01:00
committed by Francois Gaffie
parent 81ab487105
commit 664ded78ed

View File

@@ -672,7 +672,7 @@ public class AudioService extends IAudioService.Stub
AudioSystem.DEFAULT_STREAM_VOLUME[AudioSystem.STREAM_VOICE_CALL] = defaultCallVolume;
} else {
AudioSystem.DEFAULT_STREAM_VOLUME[AudioSystem.STREAM_VOICE_CALL] =
(maxCallVolume * 3) / 4;
(MAX_STREAM_VOLUME[AudioSystem.STREAM_VOICE_CALL] * 3) / 4;
}
int maxMusicVolume = SystemProperties.getInt("ro.config.media_vol_steps", -1);