audio policy: fix ringtone volume on headphones
When limiting ringtone volume because headphones are connected and music is playing, the volume was not limited against the right music volume. The is because the device used for music (headphone) is not the same as the one used for ringtone (headphone + speaker). Bug 6816207. Change-Id: I3342be1789a1b7c58705812335b788f030bc6d76
This commit is contained in:
parent
c8101f5b14
commit
17a73c3394
1 changed files with 3 additions and 2 deletions
|
@ -2653,10 +2653,11 @@ float AudioPolicyManagerBase::computeVolume(int stream,
|
|||
// just stopped
|
||||
if (isStreamActive(AudioSystem::MUSIC, SONIFICATION_HEADSET_MUSIC_DELAY) ||
|
||||
mLimitRingtoneVolume) {
|
||||
audio_devices_t musicDevice = getDeviceForStrategy(STRATEGY_MEDIA, true /*fromCache*/);
|
||||
float musicVol = computeVolume(AudioSystem::MUSIC,
|
||||
mStreams[AudioSystem::MUSIC].getVolumeIndex(device),
|
||||
mStreams[AudioSystem::MUSIC].getVolumeIndex(musicDevice),
|
||||
output,
|
||||
device);
|
||||
musicDevice);
|
||||
float minVol = (musicVol > SONIFICATION_HEADSET_VOLUME_MIN) ?
|
||||
musicVol : SONIFICATION_HEADSET_VOLUME_MIN;
|
||||
if (volume > minVol) {
|
||||
|
|
Loading…
Reference in a new issue