Skip to content

Commit 111df67

Browse files
author
Eric Laurent
committed
Fix issue 2988031.
Limit SYSTEM stream volume when a headset is connected and music is playing. Change-Id: Ieb44ae5bb53ffa9cd5fe8e317798eed279b78df8
1 parent ba3dd32 commit 111df67

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

services/audioflinger/AudioPolicyManagerBase.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1806,7 +1806,8 @@ float AudioPolicyManagerBase::computeVolume(int stream, int index, audio_io_hand
18061806
AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES |
18071807
AudioSystem::DEVICE_OUT_WIRED_HEADSET |
18081808
AudioSystem::DEVICE_OUT_WIRED_HEADPHONE)) &&
1809-
(getStrategy((AudioSystem::stream_type)stream) == STRATEGY_SONIFICATION) &&
1809+
((getStrategy((AudioSystem::stream_type)stream) == STRATEGY_SONIFICATION) ||
1810+
(stream == AudioSystem::SYSTEM)) &&
18101811
streamDesc.mCanBeMuted) {
18111812
volume *= SONIFICATION_HEADSET_VOLUME_FACTOR;
18121813
// when the phone is ringing we must consider that music could have been paused just before

0 commit comments

Comments
 (0)