Merge "Finish recents animation on task dismissal only if the task is a live tile task" into sc-dev
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 97e09dd..000a95d 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -2372,13 +2372,12 @@
if (success) {
if (shouldRemoveTask) {
if (taskView.getTask() != null) {
- finishRecentsAnimation(true /* toRecents */, false /* shouldPip */,
- () -> {
- UI_HELPER_EXECUTOR.getHandler().postDelayed(() ->
- ActivityManagerWrapper.getInstance().removeTask(
- taskView.getTask().key.id),
- REMOVE_TASK_WAIT_FOR_APP_STOP_MS);
- });
+ if (LIVE_TILE.get() && taskView.isRunningTask()) {
+ finishRecentsAnimation(true /* toRecents */, false /* shouldPip */,
+ () -> removeTaskInternal(taskView));
+ } else {
+ removeTaskInternal(taskView);
+ }
mActivity.getStatsLogManager().logger()
.withItemInfo(taskView.getItemInfo())
.log(LAUNCHER_TASK_DISMISS_SWIPE_UP);
@@ -2424,6 +2423,13 @@
return anim;
}
+ private void removeTaskInternal(TaskView taskView) {
+ UI_HELPER_EXECUTOR.getHandler().postDelayed(() ->
+ ActivityManagerWrapper.getInstance().removeTask(
+ taskView.getTask().key.id),
+ REMOVE_TASK_WAIT_FOR_APP_STOP_MS);
+ }
+
/**
* @return {@code true} if one of the task thumbnails would intersect/overlap with the
* {@link #mSplitPlaceholderView}