From 0d3772b65f64d415da722f710aa496efbe51d4e8 Mon Sep 17 00:00:00 2001 From: Ats Jenk Date: Tue, 10 May 2022 15:37:23 -0700 Subject: [PATCH] Skip passing gesture to bubble when notif expanded Notification panel can be expanded on top of expanded bubbles. Bubbles remain expanded in the back. Check for notification panel being expanded before passing home gesture to bubbles. Bug: 191565082 Test: atest PlatformScenarioTests:android.platform.test.scenario.sysui.bubble.NotificationPanelOverBubblesTest Change-Id: I59c429cceca0cef764b9d4e36389f902005e8b09 --- .../com/android/quickstep/RecentsAnimationDeviceState.java | 7 +++++++ .../src/com/android/quickstep/TouchInteractionService.java | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java index 920ed71b80..4fb7e6ba06 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java @@ -418,6 +418,13 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener { return (mSystemUiStateFlags & SYSUI_STATE_BUBBLES_EXPANDED) != 0; } + /** + * @return whether notification panel is expanded + */ + public boolean isNotificationPanelExpanded() { + return (mSystemUiStateFlags & SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED) != 0; + } + /** * @return whether the global actions dialog is showing */ diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index 0078d55398..f2583fb2c0 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -700,7 +700,10 @@ public class TouchInteractionService extends Service // If Bubbles is expanded, use the overlay input consumer, which will close Bubbles // instead of going all the way home when a swipe up is detected. - if (mDeviceState.isBubblesExpanded() || mDeviceState.isSystemUiDialogShowing()) { + // Notification panel can be expanded on top of expanded bubbles. Bubbles remain + // expanded in the back. Make sure swipe up is not passed to bubbles in this case. + if ((mDeviceState.isBubblesExpanded() && !mDeviceState.isNotificationPanelExpanded()) + || mDeviceState.isSystemUiDialogShowing()) { base = new SysUiOverlayInputConsumer( getBaseContext(), mDeviceState, mInputMonitorCompat); }