From 8af0dd3e0cce1bcc4bb69631ca5111d0e548793b Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Mon, 24 May 2021 00:31:10 -0700 Subject: [PATCH] Null check on target set before rendering task open animation Fixes: 190854921 Test: N/A Change-Id: Iae7ef7cf3f4d2309223bfabe6d40f24b7e34439c --- .../com/android/quickstep/views/TaskView.java | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index b2a7b1b85d..ae429d91d8 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -554,7 +554,13 @@ public class TaskView extends FrameLayout implements Reusable { mIsClickableAsLiveTile = false; RecentsView recentsView = getRecentsView(); - RemoteAnimationTargets targets = recentsView.getLiveTileParams().getTargetSet(); + final RemoteAnimationTargets targets = recentsView.getLiveTileParams().getTargetSet(); + if (targets == null) { + // If the recents animation is cancelled somehow between the parent if block and + // here, try to launch the task as a non live tile task. + launcherNonLiveTileTask(); + return; + } AnimatorSet anim = new AnimatorSet(); TaskViewUtils.composeRecentsLaunchAnimator( @@ -576,17 +582,21 @@ public class TaskView extends FrameLayout implements Reusable { }); anim.start(); } else { - if (mActivity.isInState(OVERVIEW_SPLIT_SELECT)) { - // User tapped to select second split screen app - getRecentsView().confirmSplitSelect(this); - } else { - launchTaskAnimated(); - } + launcherNonLiveTileTask(); } mActivity.getStatsLogManager().logger().withItemInfo(getItemInfo()) .log(LAUNCHER_TASK_LAUNCH_TAP); } + private void launcherNonLiveTileTask() { + if (mActivity.isInState(OVERVIEW_SPLIT_SELECT)) { + // User tapped to select second split screen app + getRecentsView().confirmSplitSelect(this); + } else { + launchTaskAnimated(); + } + } + /** * Starts the task associated with this view and animates the startup. * @return CompletionStage to indicate the animation completion or null if the launch failed.