AudioService: fix BT SCO volume mute

BT SCO stream should not be automatically muted when its index reaches 0.
It can only be muted via the adjustStreamVolume API with mute direction.

Bug: 267184792
Test: repro steps in bug
Test: atest AudioManagerTest
Test: atest AccessibilityVolumeTest
Test: atest AudioServiceHostTest#testAudioVolumeGroups

Change-Id: I55441ca4947a24cf1488538ecfb3222d79bc5f49
This commit is contained in:
Eric Laurent
2023-03-03 20:21:34 +01:00
parent 270620a63c
commit b6d1843f93

View File

@@ -8396,7 +8396,9 @@ public class AudioService extends IAudioService.Stub
if (isMutable()) {
// For call stream, align mute only when muted, not when index is set to 0
mVolumeGroupState.mute(
forceMuteState ? mIsMuted : groupIndex == 0 || mIsMuted);
forceMuteState ? mIsMuted :
(groupIndex == 0 && !isCallStream(mStreamType))
|| mIsMuted);
}
}
}