Fix overview and quickswitch gesture logging

- Log Home -> Overview gesture
- Log Home -> quickswitch as LAUNCHER_QUICKSWITCH_RIGHT

Bug: 219686410
Test: Local log in StatsLogCompatManager
Change-Id: Ic88fefd5af58dc03779f77b12611843c40706b1c
This commit is contained in:
Alex Chau
2022-05-05 13:59:27 +01:00
parent 21ea6828d8
commit a70e23384f
3 changed files with 17 additions and 8 deletions

View File

@@ -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)