diff options
author | Siddhesh Sahane <quic_ssahane@quicinc.com> | 2022-04-14 11:39:57 -0700 |
---|---|---|
committer | Siddhesh Sahane <ssahane@quicinc.com> | 2022-04-20 21:15:23 +0000 |
commit | 72a7879444e2b192fe39ff2867a1cedb541e8149 (patch) | |
tree | 4ea0da905a061271ac429dc9d7e5358aad4553f0 /services | |
parent | 8558bec2cb372175ecd389e24c40ed0ef5be5cd4 (diff) |
AudioDeviceBroker: handle back to back device change requests
When back to back calls for handleBluetoothA2dpActiveDeviceChangeExt
are received from BT_HAL for BT profile A2DP and A2DP_SINK in game+vbc UC,
as per the current policy message queue removes older msg and
address the latest one.
With this change, if earlier MSG_L_A2DP_DEVICE_CHANGE_CONFIG is present
queue it won't be removed during a2dp_sink connection operation.
CRs-Fixed: 3153798
Change-Id: I491367148293907f503caa480de89eede5b21ed5
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/audio/AudioDeviceBroker.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/audio/AudioDeviceBroker.java b/services/core/java/com/android/server/audio/AudioDeviceBroker.java index 3817ceaa1d15..5d2076fd570b 100644 --- a/services/core/java/com/android/server/audio/AudioDeviceBroker.java +++ b/services/core/java/com/android/server/audio/AudioDeviceBroker.java @@ -585,7 +585,9 @@ import java.util.concurrent.atomic.AtomicBoolean; /** remove all previously scheduled connection and state change events for the given device */ @GuardedBy("mDeviceStateLock") private void removeScheduledA2dpEvents(@NonNull BluetoothDevice device, int profile) { - mBrokerHandler.removeEqualMessages(MSG_L_A2DP_DEVICE_CONFIG_CHANGE, device); + if (profile == BluetoothProfile.A2DP) { + mBrokerHandler.removeEqualMessages(MSG_L_A2DP_DEVICE_CONFIG_CHANGE, device); + } final BtDeviceConnectionInfo connectionInfoToRemove = new BtDeviceConnectionInfo(device, // the next parameters of the constructor will be ignored when finding the message |