summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hyundo Moon <hdmoon@google.com> 2022-02-11 02:45:47 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-02-11 02:45:47 +0000
commitb317fc17b7e255f06e9d9927db75f978ed34587a (patch)
treede39b998588724a555247623c3c66880f685e1aa
parent7dceeeda41198c674c46197314601511f013c625 (diff)
parent7be02970fae5265704ca8fd3a93cf6440ecf424d (diff)
Merge "Show volume bar when BLE device's volume is changed" am: b5996b0b46 am: 964c01620b am: 7be02970fa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1962926 Change-Id: I424a72541bd64a3a7d635f663f745cc9f4034128
-rw-r--r--services/core/java/com/android/server/audio/AudioService.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index b637a1d71cdd..dadf2a4dbc0a 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -2857,8 +2857,9 @@ public class AudioService extends IAudioService.Stub
int step;
// skip a2dp absolute volume control request when the device
- // is not an a2dp device
- if (!AudioSystem.DEVICE_OUT_ALL_A2DP_SET.contains(device)
+ // is neither an a2dp device nor BLE device
+ if ((!AudioSystem.DEVICE_OUT_ALL_A2DP_SET.contains(device)
+ && !AudioSystem.DEVICE_OUT_ALL_BLE_SET.contains(device))
&& (flags & AudioManager.FLAG_BLUETOOTH_ABS_VOLUME) != 0) {
return;
}
@@ -2998,7 +2999,8 @@ public class AudioService extends IAudioService.Stub
}
if (device == AudioSystem.DEVICE_OUT_BLE_HEADSET
- && streamType == getBluetoothContextualVolumeStream()) {
+ && streamType == getBluetoothContextualVolumeStream()
+ && (flags & AudioManager.FLAG_BLUETOOTH_ABS_VOLUME) == 0) {
if (DEBUG_VOL) {
Log.d(TAG, "adjustSreamVolume postSetLeAudioVolumeIndex index="
+ newIndex + " stream=" + streamType);
@@ -3599,8 +3601,9 @@ public class AudioService extends IAudioService.Stub
int oldIndex;
// skip a2dp absolute volume control request when the device
- // is not an a2dp device
- if (!AudioSystem.DEVICE_OUT_ALL_A2DP_SET.contains(device)
+ // is neither an a2dp device nor BLE device
+ if ((!AudioSystem.DEVICE_OUT_ALL_A2DP_SET.contains(device)
+ && !AudioSystem.DEVICE_OUT_ALL_BLE_SET.contains(device))
&& (flags & AudioManager.FLAG_BLUETOOTH_ABS_VOLUME) != 0) {
return;
}
@@ -3642,7 +3645,8 @@ public class AudioService extends IAudioService.Stub
}
if (device == AudioSystem.DEVICE_OUT_BLE_HEADSET
- && streamType == getBluetoothContextualVolumeStream()) {
+ && streamType == getBluetoothContextualVolumeStream()
+ && (flags & AudioManager.FLAG_BLUETOOTH_ABS_VOLUME) == 0) {
if (DEBUG_VOL) {
Log.d(TAG, "adjustSreamVolume postSetLeAudioVolumeIndex index="
+ index + " stream=" + streamType);