From 053aa627910322d9ffb88e4bddf612290e289171 Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Mon, 28 Jun 2021 20:46:29 -0400 Subject: [PATCH] Fix the premature hiding of notifications while expanding QS. This MAY be a fix for an issue where all notifications in the shade disappear, which appears to be caused by getInnerHeight returning the wrong value. However, I can't repro (or therefore demonstrate the fix works in that case). Fixes: 188330819 Bug: 191459880 Test: Expand the QS and notice that now the notifications do not disappear. Change-Id: I21f03dbb162290df540ec23955abe90ee686b696 --- .../statusbar/notification/stack/StackScrollAlgorithm.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java index 8f4a71cf25639..9ce9aa80604e5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java @@ -420,8 +420,9 @@ public class StackScrollAlgorithm { // When pulsing (incoming notification on AOD), innerHeight is 0; clamp all // to shelf start, thereby hiding all notifications (except the first one, which we // later unhide in updatePulsingState) - final int shelfStart = ambientState.getInnerHeight() - - ambientState.getShelf().getIntrinsicHeight(); + final int stackBottom = !ambientState.isShadeExpanded() || ambientState.isDozing() + ? ambientState.getInnerHeight() : (int) ambientState.getStackHeight(); + final int shelfStart = stackBottom - ambientState.getShelf().getIntrinsicHeight(); viewState.yTranslation = Math.min(viewState.yTranslation, shelfStart); if (viewState.yTranslation >= shelfStart) { viewState.hidden = !view.isExpandAnimationRunning()