From 64cfa05d59ff149bfd4716965442522ead07eac2 Mon Sep 17 00:00:00 2001 From: wilsonshih Date: Tue, 29 Mar 2022 19:53:26 +0800 Subject: [PATCH] Update orientation state while gesture animation start. While quickswitch in landscape mode, the orientation handler would be update to LandscapePagedViewHandler when receive onLauncherStart, however, it might be too late because the VelocityTracker can already tracking with PortraitPagedViewHandler at AbsSwipeUpHandler#setupRecentsViewUi, which leads the wrong judgement while PagedView#onTouchEvent handling the ACTION_UP that the velocity can nearly 0 from mOrientationHandler.getPrimaryVelocity. By update the orientation handler earlier at onGestureAnimationStart, the velocity tracking result should stay consistent from ACTION_DOWN till ACTION_UP. Bug: 213867585 Bug: 209936664 Bug: 221805258 Test: run below tests w/o shell transition. atest FlickerTests:QuickSwitchBetweenTwoAppsForwardTest atest FlickerTests:QuickSwitchBetweenTwoAppsBackTest Change-Id: If73fa8d88cc372b6f783fb6cdda4148d11a2ee19 --- quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java | 2 +- .../src/com/android/quickstep/FallbackSwipeHandler.java | 3 ++- .../android/quickstep/fallback/FallbackRecentsView.java | 6 ++++-- quickstep/src/com/android/quickstep/views/RecentsView.java | 7 +++++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 43be051dd3..254f7b084b 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -583,7 +583,7 @@ public abstract class AbsSwipeUpHandler, } else { runningTasks = new ActivityManager.RunningTaskInfo[]{mGestureState.getRunningTask()}; } - mRecentsView.onGestureAnimationStart(runningTasks); + mRecentsView.onGestureAnimationStart(runningTasks, mDeviceState.getRotationTouchHelper()); } private void launcherFrameDrawn() { diff --git a/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java b/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java index a62e9d131d..1ed61ee126 100644 --- a/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java +++ b/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java @@ -206,7 +206,8 @@ public class FallbackSwipeHandler extends if (mRunningOverHome) { if (DisplayController.getNavigationMode(mContext).hasGestures) { mRecentsView.onGestureAnimationStartOnHome( - new ActivityManager.RunningTaskInfo[]{mGestureState.getRunningTask()}); + new ActivityManager.RunningTaskInfo[]{mGestureState.getRunningTask()}, + mDeviceState.getRotationTouchHelper()); } } else { super.notifyGestureAnimationStartToRecents(); diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java index e6f73dcd3d..eda2c5adfe 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java @@ -42,6 +42,7 @@ import com.android.launcher3.util.SplitConfigurationOptions; import com.android.quickstep.FallbackActivityInterface; import com.android.quickstep.GestureState; import com.android.quickstep.RecentsActivity; +import com.android.quickstep.RotationTouchHelper; import com.android.quickstep.util.GroupTask; import com.android.quickstep.util.SplitSelectStateController; import com.android.quickstep.util.TaskViewSimulator; @@ -86,11 +87,12 @@ public class FallbackRecentsView extends RecentsView