From 1ed67603749c7e4d0ba94ff2cf33f488f4539e97 Mon Sep 17 00:00:00 2001 From: AndrĂ¡s Kurucz Date: Fri, 21 Mar 2025 10:09:18 +0000 Subject: [Flexiglass] Turn off SCOLL_FLING CUJ tracking from the NSSL Disable tracking CUJ_NOTIFICATION_SHADE_SCROLL_FLING events from the NSSL and NSSLC, because moving the stack updown by scrolling, overscrolling or flinging is now controlled through the Placeholders. This CL also flags off some bigger junks of the remaining scroll logic. Bug: 360100111 Test: verify that the new assertions are not hit with flexi on Flag: com.android.systemui.scene_container Change-Id: I88a7aab43980c5c42138ea0b7e4523fb15648bdc --- .../notification/stack/NotificationStackScrollLayout.java | 11 ++++++++--- .../stack/NotificationStackScrollLayoutController.java | 6 ++++-- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'packages/SystemUI/src') 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 503256accff0..7642c8259b87 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 @@ -64,7 +64,6 @@ import android.util.AttributeSet; import android.util.IndentingPrintWriter; import android.util.Log; import android.util.MathUtils; -import android.util.Pair; import android.view.DisplayCutout; import android.view.InputDevice; import android.view.LayoutInflater; @@ -141,7 +140,6 @@ import com.android.systemui.statusbar.notification.stack.ui.view.NotificationScr import com.android.systemui.statusbar.phone.HeadsUpAppearanceController; import com.android.systemui.statusbar.policy.ScrollAdapter; import com.android.systemui.statusbar.policy.SplitShadeStateController; -import com.android.systemui.statusbar.ui.SystemBarUtilsProxy; import com.android.systemui.util.Assert; import com.android.systemui.util.ColorUtilKt; import com.android.systemui.util.DumpUtilsKt; @@ -2253,6 +2251,7 @@ public class NotificationStackScrollLayout } public void setFinishScrollingCallback(Runnable runnable) { + SceneContainerFlag.assertInLegacyMode(); mFinishScrollingCallback = runnable; } @@ -2763,6 +2762,8 @@ public class NotificationStackScrollLayout * which means we want to scroll towards the top. */ protected void fling(int velocityY) { + // Scrolls and flings are handled by the Composables with SceneContainer enabled + SceneContainerFlag.assertInLegacyMode(); if (getChildCount() > 0) { float topAmount = getCurrentOverScrollAmount(true); float bottomAmount = getCurrentOverScrollAmount(false); @@ -3857,7 +3858,10 @@ public class NotificationStackScrollLayout } break; case ACTION_UP: - if (mIsBeingDragged) { + if (SceneContainerFlag.isEnabled() && mIsBeingDragged) { + mActivePointerId = INVALID_POINTER; + endDrag(); + } else if (mIsBeingDragged) { final VelocityTracker velocityTracker = mVelocityTracker; velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity); int initialVelocity = (int) velocityTracker.getYVelocity(mActivePointerId); @@ -3920,6 +3924,7 @@ public class NotificationStackScrollLayout } boolean isFlingAfterUpEvent() { + SceneContainerFlag.assertInLegacyMode(); return mFlingAfterUpEvent; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java index 612c19fc6696..b3a539beb78b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java @@ -2059,7 +2059,7 @@ public class NotificationStackScrollLayoutController implements Dumpable { // We log any touches other than down, which will be captured by onTouchEvent. // In the intercept we only start tracing when it's not a down (otherwise that down // would be duplicated when intercepted). - if (mJankMonitor != null && scrollWantsIt + if (!SceneContainerFlag.isEnabled() && mJankMonitor != null && scrollWantsIt && ev.getActionMasked() != MotionEvent.ACTION_DOWN) { mJankMonitor.begin(mView, CUJ_NOTIFICATION_SHADE_SCROLL_FLING); } @@ -2140,7 +2140,9 @@ public class NotificationStackScrollLayoutController implements Dumpable { } mView.setCheckForLeaveBehind(true); } - traceJankOnTouchEvent(ev.getActionMasked(), scrollerWantsIt); + if (!SceneContainerFlag.isEnabled()) { + traceJankOnTouchEvent(ev.getActionMasked(), scrollerWantsIt); + } return horizontalSwipeWantsIt || scrollerWantsIt || expandWantsIt || longPressWantsIt || hunWantsIt; } -- cgit v1.2.3-59-g8ed1b