From aa72d09a5407f1d569628a5e5a0ae14777ab5bb6 Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Sun, 5 Jun 2022 12:41:46 +0000 Subject: Fix yet another clipTopAmount usage Just like I3dec0e99111777ca37eddf79a33487fc0c8dc99c and I01293c0aecbeee559e97f348ff7c4151a64538ab, this imposes a minimum of 0 when using the clipTopAmount to determine touches. I had done this for group children and a11y rectangles, but I missed the NSSL's calculation of which child is touched. This particular method is only called when gestures are being intercepted, such as drag, and because it looks at children in increasing index rather than decreasing (as the platform touch handling does), the bug doesn't present when you drag on a different notification, it only presents if you drag somewhere that has no notificaton. Change-Id: I2d41d996534b62f7b6b55bfe6eeb9f5fc679af7a Fixes: 230080345 Test: reproduce topClipAmount glitch while media is present, drag on media --- .../statusbar/notification/stack/NotificationStackScrollLayout.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index ba57d57d0fd3..270eb13c4224 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -1668,7 +1668,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable continue; } float childTop = slidingChild.getTranslationY(); - float top = childTop + slidingChild.getClipTopAmount(); + float top = childTop + Math.max(0, slidingChild.getClipTopAmount()); float bottom = childTop + slidingChild.getActualHeight() - slidingChild.getClipBottomAmount(); -- cgit v1.2.3-59-g8ed1b