diff options
| author | 2023-01-20 19:16:40 +0000 | |
|---|---|---|
| committer | 2023-01-20 19:16:40 +0000 | |
| commit | 2850dd6bb50932ebe26b16aa58ea32dfcffce040 (patch) | |
| tree | c2feaac2499e73773945397950f625546b11a427 | |
| parent | 075c80a0d09cab6f79bf8d444022af774f129ed0 (diff) | |
| parent | 898d6d91c32f77c040716c3ff002eb90a96ed832 (diff) | |
Merge "Ensuring QS can't collapse (hide) in split shade" into tm-qpr-dev am: 898d6d91c3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21009607
Change-Id: Ie025afc7479ea9d77a3c3d6ffceea2005942b10c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
4 files changed, 16 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index 7c6c721d0012..392a851290de 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -2097,7 +2097,17 @@ public final class NotificationPanelViewController implements Dumpable { } } - public void expandWithoutQs() { + /** + * Expand shade so that notifications are visible. + * Non-split shade: just expanding shade or collapsing QS when they're expanded. + * Split shade: only expanding shade, notifications are always visible + * + * Called when `adb shell cmd statusbar expand-notifications` is executed. + */ + public void expandShadeToNotifications() { + if (mSplitShadeEnabled && (isShadeFullyOpen() || isExpanding())) { + return; + } if (isQsExpanded()) { flingSettings(0 /* velocity */, FLING_COLLAPSE); } else { @@ -5536,7 +5546,7 @@ public final class NotificationPanelViewController implements Dumpable { @Override public void flingTopOverscroll(float velocity, boolean open) { - // in split shade mode we want to expand/collapse QS only when touch happens within QS + // in split shade touches affect QS only when touch happens within QS if (isSplitShadeAndTouchXOutsideQs(mInitialTouchX)) { return; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacks.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacks.java index 2de6470f0e18..ccde3c21798e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacks.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacks.java @@ -218,7 +218,7 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba return; } - mNotificationPanelViewController.expandWithoutQs(); + mNotificationPanelViewController.expandShadeToNotifications(); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java index be06b05fc136..8e22bf4a8df4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -1147,7 +1147,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb if (hideImmediately) { mStatusBarStateController.setLeaveOpenOnKeyguardHide(false); } else { - mNotificationPanelViewController.expandWithoutQs(); + mNotificationPanelViewController.expandShadeToNotifications(); } } return; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java index b053f5ab3788..b879cf24fcf1 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java @@ -147,7 +147,7 @@ public class CentralSurfacesCommandQueueCallbacksTest extends SysuiTestCase { // Trying to open it does nothing. mSbcqCallbacks.animateExpandNotificationsPanel(); - verify(mNotificationPanelViewController, never()).expandWithoutQs(); + verify(mNotificationPanelViewController, never()).expandShadeToNotifications(); mSbcqCallbacks.animateExpandSettingsPanel(null); verify(mNotificationPanelViewController, never()).expand(anyBoolean()); } @@ -165,7 +165,7 @@ public class CentralSurfacesCommandQueueCallbacksTest extends SysuiTestCase { // Can now be opened. mSbcqCallbacks.animateExpandNotificationsPanel(); - verify(mNotificationPanelViewController).expandWithoutQs(); + verify(mNotificationPanelViewController).expandShadeToNotifications(); mSbcqCallbacks.animateExpandSettingsPanel(null); verify(mNotificationPanelViewController).expandWithQs(); } |