From f66f8271cfe6bd4e9f2c1de8f907ef1b6291a3fa Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Mon, 13 Sep 2021 12:57:17 -0700 Subject: [PATCH] Use FakeTransformParams instead of real ones for gesture tutorial * SwipeUpAnimationLogic was ignoring the TransformParams arg that was being passed in, because for staged split we are creating/pairing TaskViewSimulators and TransformParams in SwipeUpAnimationLogic itself. * Override the remote handle that gets created during the gesture tutorial (which shouldn't be done in other cases, but because tutorial is a one-off it should be fine) Fixes: 199482330 Test: Launched gesture tutorial from launcher home settings No crash Change-Id: I346211a422e46981a994bd40e34e46b44f9f5d0e --- quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java | 2 +- .../src/com/android/quickstep/SwipeUpAnimationLogic.java | 2 +- .../interaction/SwipeUpGestureTutorialController.java | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 1e841da40b..fff89156cd 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -270,7 +270,7 @@ public abstract class AbsSwipeUpHandler, TaskAnimationManager taskAnimationManager, GestureState gestureState, long touchTimeMs, boolean continuingLastGesture, InputConsumerController inputConsumer) { - super(context, deviceState, gestureState, new TransformParams()); + super(context, deviceState, gestureState); mActivityInterface = gestureState.getActivityInterface(); mActivityInitListener = mActivityInterface.createActivityInitListener(this::onActivityInit); mInputConsumerProxy = diff --git a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java index 51a491ebf6..e68af2e0a1 100644 --- a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java +++ b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java @@ -80,7 +80,7 @@ public abstract class SwipeUpAnimationLogic implements protected boolean mIsSwipeForStagedSplit; public SwipeUpAnimationLogic(Context context, RecentsAnimationDeviceState deviceState, - GestureState gestureState, TransformParams transformParams) { + GestureState gestureState) { mContext = context; mDeviceState = deviceState; mGestureState = gestureState; diff --git a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java index 1f75936dd4..ce8047ec9e 100644 --- a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java @@ -50,6 +50,7 @@ import com.android.quickstep.AnimatedFloat; import com.android.quickstep.GestureState; import com.android.quickstep.OverviewComponentObserver; import com.android.quickstep.RecentsAnimationDeviceState; +import com.android.quickstep.RemoteTargetGluer; import com.android.quickstep.SwipeUpAnimationLogic; import com.android.quickstep.SwipeUpAnimationLogic.RunningWindowAnim; import com.android.quickstep.util.AppCloseConfig; @@ -254,7 +255,9 @@ abstract class SwipeUpGestureTutorialController extends TutorialController { ViewSwipeUpAnimation(Context context, RecentsAnimationDeviceState deviceState, GestureState gestureState) { - super(context, deviceState, gestureState, new FakeTransformParams()); + super(context, deviceState, gestureState); + mRemoteTargetHandles[0] = new RemoteTargetGluer.RemoteTargetHandle( + mRemoteTargetHandles[0].getTaskViewSimulator(), new FakeTransformParams()); } void initDp(DeviceProfile dp) {