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

Commit e34b94f5 authored by Jagrut Desai's avatar Jagrut Desai Committed by Android (Google) Code Review
Browse files

Merge "Gesture Error Detection - Improvements Part 3" into main

parents e05ada79 f39c5099
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ import static com.android.quickstep.GestureState.STATE_RECENTS_SCROLLING_FINISHE
import static com.android.quickstep.MultiStateCallback.DEBUG_STATES;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.CANCEL_RECENTS_ANIMATION;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.EXPECTING_TASK_APPEARED;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.INVALID_VELOCITY_ON_SWIPE_UP;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.LAUNCHER_DESTROYED;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.ON_SETTLED_ON_END_TARGET;
import static com.android.quickstep.views.RecentsView.UPDATE_SYSUI_FLAGS_THRESHOLD;
@@ -1214,6 +1215,11 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,

    private GestureEndTarget calculateEndTarget(
            PointF velocityPxPerMs, float endVelocityPxPerMs, boolean isFlingY, boolean isCancel) {

        ActiveGestureErrorDetector.GestureEvent gestureEvent =
                velocityPxPerMs.x == 0 && velocityPxPerMs.y == 0
                        ? INVALID_VELOCITY_ON_SWIPE_UP
                        : null;
        ActiveGestureLog.INSTANCE.addLog(
                new ActiveGestureLog.CompoundString("calculateEndTarget: velocities=(x=")
                        .append(Float.toString(dpiFromPx(velocityPxPerMs.x)))
@@ -1221,7 +1227,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
                        .append(Float.toString(dpiFromPx(velocityPxPerMs.y)))
                        .append("dp/ms), angle=")
                        .append(Double.toString(Math.toDegrees(Math.atan2(
                                -velocityPxPerMs.y, velocityPxPerMs.x)))));
                                -velocityPxPerMs.y, velocityPxPerMs.x)))), gestureEvent);

        if (mGestureState.isHandlingAtomicEvent()) {
            // Button mode, this is only used to go to recents.
+8 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ public class ActiveGestureErrorDetector {
        SET_ON_PAGE_TRANSITION_END_CALLBACK, CANCEL_CURRENT_ANIMATION, CLEANUP_SCREENSHOT,
        SCROLLER_ANIMATION_ABORTED, TASK_APPEARED, EXPECTING_TASK_APPEARED,
        FLAG_USING_OTHER_ACTIVITY_INPUT_CONSUMER, LAUNCHER_DESTROYED, RECENT_TASKS_MISSING,
        INVALID_VELOCITY_ON_SWIPE_UP,

        /**
         * These GestureEvents are specifically associated to state flags that get set in
@@ -266,6 +267,13 @@ public class ActiveGestureErrorDetector {
                                    + "callback",
                            writer);
                    break;
                case INVALID_VELOCITY_ON_SWIPE_UP:
                    errorDetected |= printErrorIfTrue(
                            true,
                            prefix,
                            /* errorMessage= */ "invalid velocity on swipe up gesture.",
                            writer);
                    break;
                case START_RECENTS_ANIMATION:
                    lastStartRecentAnimationEventEntryTime = eventEntry.getTime();
                    break;