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
This commit is contained in:
Vinit Nayak
2021-09-13 12:57:17 -07:00
parent 2d9741b832
commit f66f8271cf
3 changed files with 6 additions and 3 deletions
@@ -270,7 +270,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
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 =
@@ -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;
@@ -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) {