From 72a7879444e2b192fe39ff2867a1cedb541e8149 Mon Sep 17 00:00:00 2001 From: Siddhesh Sahane Date: Thu, 14 Apr 2022 11:39:57 -0700 Subject: 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 --- services/core/java/com/android/server/audio/AudioDeviceBroker.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3 From 4ec9564fc91b8fcf083537096907249d58dafd8f Mon Sep 17 00:00:00 2001 From: Jordan Demeulenaere Date: Wed, 9 Mar 2022 14:55:07 +0000 Subject: Fix dialog exit animation This CL fixes a bug that could happen when animating a dialog out at the same time as hiding the SystemUI shade, and that would make the phone unusable until the shade is swiped down again. See b/223387276 for more info. Bug: 223387276 Test: Manual, see b/223387276#comment1 Change-Id: If251b00558a5ca9a927d1be2bb015f1c0acb2d57 (cherry picked from commit 631a7ef1a60a8d61077e1762e5a18cc53e8211f4) --- core/java/android/view/ViewRootImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 6aa85a6cc1d4..6584c66950d5 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -3393,6 +3393,12 @@ public final class ViewRootImpl implements ViewParent, mReportNextDraw = false; pendingDrawFinished(); } + + // Make sure the consumer is not waiting if the view root was just made invisible. + if (mBLASTDrawConsumer != null) { + mBLASTDrawConsumer.accept(null); + mBLASTDrawConsumer = null; + } } } -- cgit v1.2.3