Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c674f133 authored by András Kurucz's avatar András Kurucz Committed by Android (Google) Code Review
Browse files

Merge "[Flexiglass] Turn off SCOLL_FLING CUJ tracking from the NSSL" into main

parents cadaad60 1ed67603
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -64,7 +64,6 @@ import android.util.AttributeSet;
import android.util.IndentingPrintWriter;
import android.util.IndentingPrintWriter;
import android.util.Log;
import android.util.Log;
import android.util.MathUtils;
import android.util.MathUtils;
import android.util.Pair;
import android.view.DisplayCutout;
import android.view.DisplayCutout;
import android.view.InputDevice;
import android.view.InputDevice;
import android.view.LayoutInflater;
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.phone.HeadsUpAppearanceController;
import com.android.systemui.statusbar.policy.ScrollAdapter;
import com.android.systemui.statusbar.policy.ScrollAdapter;
import com.android.systemui.statusbar.policy.SplitShadeStateController;
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.Assert;
import com.android.systemui.util.ColorUtilKt;
import com.android.systemui.util.ColorUtilKt;
import com.android.systemui.util.DumpUtilsKt;
import com.android.systemui.util.DumpUtilsKt;
@@ -2253,6 +2251,7 @@ public class NotificationStackScrollLayout
    }
    }


    public void setFinishScrollingCallback(Runnable runnable) {
    public void setFinishScrollingCallback(Runnable runnable) {
        SceneContainerFlag.assertInLegacyMode();
        mFinishScrollingCallback = runnable;
        mFinishScrollingCallback = runnable;
    }
    }


@@ -2763,6 +2762,8 @@ public class NotificationStackScrollLayout
     *                  which means we want to scroll towards the top.
     *                  which means we want to scroll towards the top.
     */
     */
    protected void fling(int velocityY) {
    protected void fling(int velocityY) {
        // Scrolls and flings are handled by the Composables with SceneContainer enabled
        SceneContainerFlag.assertInLegacyMode();
        if (getChildCount() > 0) {
        if (getChildCount() > 0) {
            float topAmount = getCurrentOverScrollAmount(true);
            float topAmount = getCurrentOverScrollAmount(true);
            float bottomAmount = getCurrentOverScrollAmount(false);
            float bottomAmount = getCurrentOverScrollAmount(false);
@@ -3857,7 +3858,10 @@ public class NotificationStackScrollLayout
                }
                }
                break;
                break;
            case ACTION_UP:
            case ACTION_UP:
                if (mIsBeingDragged) {
                if (SceneContainerFlag.isEnabled() && mIsBeingDragged) {
                    mActivePointerId = INVALID_POINTER;
                    endDrag();
                } else if (mIsBeingDragged) {
                    final VelocityTracker velocityTracker = mVelocityTracker;
                    final VelocityTracker velocityTracker = mVelocityTracker;
                    velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);
                    velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);
                    int initialVelocity = (int) velocityTracker.getYVelocity(mActivePointerId);
                    int initialVelocity = (int) velocityTracker.getYVelocity(mActivePointerId);
@@ -3920,6 +3924,7 @@ public class NotificationStackScrollLayout
    }
    }


    boolean isFlingAfterUpEvent() {
    boolean isFlingAfterUpEvent() {
        SceneContainerFlag.assertInLegacyMode();
        return mFlingAfterUpEvent;
        return mFlingAfterUpEvent;
    }
    }


+4 −2
Original line number Original line Diff line number Diff line
@@ -2091,7 +2091,7 @@ public class NotificationStackScrollLayoutController implements Dumpable {
            // We log any touches other than down, which will be captured by onTouchEvent.
            // 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
            // In the intercept we only start tracing when it's not a down (otherwise that down
            // would be duplicated when intercepted).
            // would be duplicated when intercepted).
            if (mJankMonitor != null && scrollWantsIt
            if (!SceneContainerFlag.isEnabled() && mJankMonitor != null && scrollWantsIt
                    && ev.getActionMasked() != MotionEvent.ACTION_DOWN) {
                    && ev.getActionMasked() != MotionEvent.ACTION_DOWN) {
                mJankMonitor.begin(mView, CUJ_NOTIFICATION_SHADE_SCROLL_FLING);
                mJankMonitor.begin(mView, CUJ_NOTIFICATION_SHADE_SCROLL_FLING);
            }
            }
@@ -2172,7 +2172,9 @@ public class NotificationStackScrollLayoutController implements Dumpable {
                }
                }
                mView.setCheckForLeaveBehind(true);
                mView.setCheckForLeaveBehind(true);
            }
            }
            if (!SceneContainerFlag.isEnabled()) {
                traceJankOnTouchEvent(ev.getActionMasked(), scrollerWantsIt);
                traceJankOnTouchEvent(ev.getActionMasked(), scrollerWantsIt);
            }
            return horizontalSwipeWantsIt || scrollerWantsIt || expandWantsIt || longPressWantsIt
            return horizontalSwipeWantsIt || scrollerWantsIt || expandWantsIt || longPressWantsIt
                    || hunWantsIt;
                    || hunWantsIt;
        }
        }