summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Eric Laurent <elaurent@google.com> 2020-06-12 15:12:40 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-06-12 15:12:40 +0000
commitff373b4676e16107a0886d1971d54f569ef0e33f (patch)
tree8dab9715216d24051c6d3ae205e999c479a54669
parent8140ae8d22d4165bc9a4c22e1b6e57d359c6fde8 (diff)
parentb94b9c60f1c3c8c2ae5760c0124dbc1fba41787b (diff)
Merge "AudioService: fix volume group mute" into rvc-dev
-rwxr-xr-xservices/core/java/com/android/server/audio/AudioService.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index 6d45abaf0234..36272278e0e4 100755
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -5322,6 +5322,15 @@ public class AudioService extends IAudioService.Stub
}
private void setVolumeIndexInt(int index, int device, int flags) {
+ // Reflect mute state of corresponding stream by forcing index to 0 if muted
+ // Only set audio policy BT SCO stream volume to 0 when the stream is actually muted.
+ // This allows RX path muting by the audio HAL only when explicitly muted but not when
+ // index is just set to 0 to repect BT requirements
+ if (mStreamStates[mPublicStreamType].isFullyMuted()) {
+ index = 0;
+ } else if (mPublicStreamType == AudioSystem.STREAM_BLUETOOTH_SCO && index == 0) {
+ index = 1;
+ }
// Set the volume index
AudioSystem.setVolumeIndexForAttributes(mAudioAttributes, index, device);
}