From 1351c2214d54d01ee457ee338d0559ef3796c083 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Wed, 23 Jun 2021 10:40:03 -0700 Subject: [PATCH] Fix some touch issues during gesture nav transition - Don't recreate the laucher transition controller if we've already ended it, as it could clobber a touch interaction that started in the meantime - Test: swipe up from an app to overivew, swipe to dismiss it during the transition. - Previously, we were ending the controller twice (once on touch down as we started proxying, and again in setupLauncherUiAfterSwipeUpToRecentsAnimation()), and the second one could happen after starting the dismiss interaction. - Don't recreateControllers() if orientation didn't change - Test: swipe up to go from an app to home, swipe up to all apps during the transition. - Previously, we were getting the following sequence: 1. Touch down on home to start swiping to all apps - all current controllers get this down event to start determining whether to intercept 2. Before reaching touch slop, we recreateControllers(), so all new controllers won't get the down event and thus won't intercept - Now, we avoid unnecessarily recreateControllers(), so the original controllers can still intercept. Test: see above Fixes: 189700453 Change-Id: Icfa5b6cdb32122adaf6ac8e8cb197b0c477dac60 --- .../src/com/android/quickstep/AbsSwipeUpHandler.java | 7 +++++-- .../src/com/android/quickstep/views/RecentsView.java | 9 ++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 4d47ef15c1..d511e6da9f 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -230,6 +230,7 @@ public abstract class AbsSwipeUpHandler, // Used to control launcher components throughout the swipe gesture. private AnimatorControllerWithResistance mLauncherTransitionController; + private boolean mHasEndedLauncherTransition; private AnimationFactory mAnimationFactory = (t) -> { }; @@ -603,11 +604,11 @@ public abstract class AbsSwipeUpHandler, /** * We don't want to change mLauncherTransitionController if mGestureState.getEndTarget() == HOME - * (it has its own animation). + * (it has its own animation) or if we explicitly ended the controller already. * @return Whether we can create the launcher controller or update its progress. */ private boolean canCreateNewOrUpdateExistingLauncherTransitionController() { - return mGestureState.getEndTarget() != HOME; + return mGestureState.getEndTarget() != HOME && !mHasEndedLauncherTransition; } @Override @@ -1421,6 +1422,8 @@ public abstract class AbsSwipeUpHandler, } private void endLauncherTransitionController() { + mHasEndedLauncherTransition = true; + if (mLauncherTransitionController != null) { // End the animation, but stay at the same visual progress. mLauncherTransitionController.getNormalController().dispatchSetInterpolator( diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 2b256a43c6..8a665251ff 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -1248,7 +1248,9 @@ public abstract class RecentsView