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

Commit 950437ce authored by Alex Chau's avatar Alex Chau Committed by Android (Google) Code Review
Browse files

Merge "Fix overview and quickswitch gesture logging" into tm-dev

parents a78e070a a70e2338
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import static com.android.launcher3.anim.Interpolators.DEACCEL_3;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_QUICKSWITCH_RIGHT;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_UNKNOWN_SWIPEDOWN;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_UNKNOWN_SWIPEUP;
import static com.android.launcher3.logging.StatsLogManager.getLauncherAtomEvent;
@@ -451,7 +452,9 @@ public class NoButtonQuickSwitchTouchController implements TouchController,
                .withSrcState(LAUNCHER_STATE_HOME)
                .withDstState(targetState.statsLogOrdinal)
                .log(getLauncherAtomEvent(mStartState.statsLogOrdinal, targetState.statsLogOrdinal,
                        targetState.ordinal > mStartState.ordinal
                        targetState == QUICK_SWITCH
                                ? LAUNCHER_QUICKSWITCH_RIGHT
                                : targetState.ordinal > mStartState.ordinal
                                        ? LAUNCHER_UNKNOWN_SWIPEUP
                                        : LAUNCHER_UNKNOWN_SWIPEDOWN));
        mLauncher.getStateManager().goToState(targetState, false, forEndCallback(this::clearState));
+1 −1
Original line number Diff line number Diff line
@@ -261,7 +261,7 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr

    @Override
    protected void onReachedFinalState(LauncherState toState) {
        super.onReinitToState(toState);
        super.onReachedFinalState(toState);
        if (toState == ALL_APPS) {
            InteractionJankMonitorWrapper.end(InteractionJankMonitorWrapper.CUJ_OPEN_ALL_APPS);
        }
+10 −4
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static com.android.launcher3.LauncherAnimUtils.newCancelListener;
import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.anim.AnimatorListeners.forEndCallback;
import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_ALLAPPS;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME;
@@ -330,9 +331,6 @@ public abstract class AbstractStateChangeTouchController
                        Math.min(progress, 1) - endProgress) * durationMultiplier;
            }
        }
        if (targetState != mStartState) {
            logReachedState(targetState);
        }
        mCurrentAnimation.setEndAction(() -> onSwipeInteractionCompleted(targetState));
        ValueAnimator anim = mCurrentAnimation.getAnimationPlayer();
        anim.setFloatValues(startProgress, endProgress);
@@ -361,6 +359,8 @@ public abstract class AbstractStateChangeTouchController
        boolean shouldGoToTargetState = mGoingBetweenStates || (mToState != targetState);
        if (shouldGoToTargetState) {
            goToTargetState(targetState);
        } else {
            logReachedState(mToState);
        }
    }

@@ -368,13 +368,19 @@ public abstract class AbstractStateChangeTouchController
        if (!mLauncher.isInState(targetState)) {
            // If we're already in the target state, don't jump to it at the end of the animation in
            // case the user started interacting with it before the animation finished.
            mLauncher.getStateManager().goToState(targetState, false /* animated */);
            mLauncher.getStateManager().goToState(targetState, false /* animated */,
                    forEndCallback(() -> logReachedState(targetState)));
        } else {
            logReachedState(targetState);
        }
        mLauncher.getRootView().getSysUiScrim().createSysuiMultiplierAnim(
                1f).setDuration(0).start();
    }

    private void logReachedState(LauncherState targetState) {
        if (mStartState == targetState) {
            return;
        }
        // Transition complete. log the action
        mLauncher.getStatsLogManager().logger()
                .withSrcState(mStartState.statsLogOrdinal)