From 085ecc32a40d4cf578d6c4379ff1045430ec72b0 Mon Sep 17 00:00:00 2001 From: Ajay Panicker Date: Fri, 27 Apr 2018 07:13:23 -0700 Subject: [PATCH] Don't set Bluetooth volume when the Bluetooth stream changes Don't restore the remembered volume whenever an Bluetooth A2DP stream comes up or whenever Bluetooth AVRCP reports absolute volume support. All Bluetooth volume memory will now be handled by Bluetooth. Bug: 30602783 Test: See that AudioService doesn't try to change the volume when a Bluetooth device connects. Change-Id: I683062c1a0565591ae33cbbb0381730b86ad17c2 --- .../core/java/com/android/server/audio/AudioService.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java index 5573cd99fbaa9..479201815c329 100644 --- a/services/core/java/com/android/server/audio/AudioService.java +++ b/services/core/java/com/android/server/audio/AudioService.java @@ -5197,8 +5197,6 @@ public class AudioService extends IAudioService.Stub // enable A2DP before notifying A2DP connection to avoid unnecessary processing in // audio policy manager VolumeStreamState streamState = mStreamStates[AudioSystem.STREAM_MUSIC]; - sendMsg(mAudioHandler, MSG_SET_DEVICE_VOLUME, SENDMSG_QUEUE, - AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, 0, streamState, 0); setBluetoothA2dpOnInt(true, eventSource); AudioSystem.setDeviceConnectionState(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, AudioSystem.DEVICE_STATE_AVAILABLE, address, name); @@ -5407,12 +5405,6 @@ public class AudioService extends IAudioService.Stub // address is not used for now, but may be used when multiple a2dp devices are supported synchronized (mA2dpAvrcpLock) { mAvrcpAbsVolSupported = support; - sendMsg(mAudioHandler, MSG_SET_DEVICE_VOLUME, SENDMSG_QUEUE, - AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, 0, - mStreamStates[AudioSystem.STREAM_MUSIC], 0); - sendMsg(mAudioHandler, MSG_SET_DEVICE_VOLUME, SENDMSG_QUEUE, - AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, 0, - mStreamStates[AudioSystem.STREAM_RING], 0); } }