diff --git a/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java b/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java index d76484c135..a62e9d131d 100644 --- a/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java +++ b/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java @@ -186,6 +186,7 @@ public class FallbackSwipeHandler extends } else { recentsCallback = callback; } + mRecentsView.cleanupRemoteTargets(); mRecentsAnimationController.finish( mAppCanEnterPip /* toRecents */, recentsCallback, true /* sendUserLeaveHint */); } diff --git a/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java b/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java index e9571e0ca1..50d1244c81 100644 --- a/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java +++ b/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java @@ -239,6 +239,7 @@ public class LauncherSwipeHandlerV2 extends @Override protected void finishRecentsControllerToHome(Runnable callback) { + mRecentsView.cleanupRemoteTargets(); mRecentsAnimationController.finish( true /* toRecents */, callback, true /* sendUserLeaveHint */); } diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 395bfb1b24..d04158907a 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -4283,7 +4283,7 @@ public abstract class RecentsView { if (isSuccess) { - if (tv.getTaskIds()[1] != -1) { + if (tv.getTaskIds()[1] != -1 && mRemoteTargetHandles != null) { // TODO(b/194414938): make this part of the animations instead. TaskViewUtils.createSplitAuxiliarySurfacesAnimator( mRemoteTargetHandles[0].getTransformParams().getTargetSet().nonApps,