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

Commit b21819e1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Annotating Quick Switch CUJ for non-3-button modes" into ub-launcher3-master

parents 931bce36 a762b024
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -715,6 +715,8 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<?>, Q extends

    @UiThread
    public void onGestureStarted(boolean isLikelyToStartNewTask) {
        InteractionJankMonitorWrapper.begin(
                InteractionJankMonitorWrapper.CUJ_QUICK_SWITCH, 2000 /* ms timeout */);
        notifyGestureStartedAsync();
        setIsLikelyToStartNewTask(isLikelyToStartNewTask, false /* animate */);
        mStateCallback.setStateOnUiThread(STATE_GESTURE_STARTED);
@@ -790,7 +792,8 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<?>, Q extends
    }

    private void onSettledOnEndTarget() {
        switch (mGestureState.getEndTarget()) {
        final GestureEndTarget endTarget = mGestureState.getEndTarget();
        switch (endTarget) {
            case HOME:
                mStateCallback.setState(STATE_SCALED_CONTROLLER_HOME | STATE_CAPTURE_SCREENSHOT);
                // Notify swipe-to-home (recents animation) is finished
@@ -807,7 +810,10 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<?>, Q extends
                mStateCallback.setState(STATE_RESUME_LAST_TASK);
                break;
        }
        ActiveGestureLog.INSTANCE.addLog("onSettledOnEndTarget " + mGestureState.getEndTarget());
        ActiveGestureLog.INSTANCE.addLog("onSettledOnEndTarget " + endTarget);
        if (endTarget != NEW_TASK) {
            InteractionJankMonitorWrapper.cancel(InteractionJankMonitorWrapper.CUJ_QUICK_SWITCH);
        }
    }

    /** @return Whether this was the task we were waiting to appear, and thus handled it. */
+2 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import androidx.annotation.UiThread;

import com.android.launcher3.util.Preconditions;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
import com.android.systemui.shared.system.RecentsAnimationControllerCompat;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;

@@ -149,6 +150,7 @@ public class RecentsAnimationController {
        mOnFinishedListener.accept(this);
        UI_HELPER_EXECUTOR.execute(() -> {
            mController.finish(toRecents, sendUserLeaveHint);
            InteractionJankMonitorWrapper.end(InteractionJankMonitorWrapper.CUJ_QUICK_SWITCH);
            if (callback != null) {
                MAIN_EXECUTOR.execute(callback);
            }