From 1d6058c2cd8513619a556da41222d51553f52550 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Thu, 17 Mar 2022 18:19:42 -0700 Subject: [PATCH] Null out mRemoteTargetHandles when swiping to home * Also all null check when trying to show divider after swipe down animation from overview Fixes: 223946009 Test: Steps in bug no longer cause crash Change-Id: I2c8484c37b863c4cb6aba7e274c1eb76bce92b4a --- quickstep/src/com/android/quickstep/FallbackSwipeHandler.java | 1 + quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java | 1 + quickstep/src/com/android/quickstep/views/RecentsView.java | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) 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,