diff options
-rw-r--r-- | core/java/android/view/ViewRootImpl.java | 6 | ||||
-rw-r--r-- | services/core/java/com/android/server/audio/AudioDeviceBroker.java | 4 |
2 files changed, 9 insertions, 1 deletions
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; + } } } 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 |