From 01a41a2bef3df4b274461df437541d75439d32a8 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Wed, 22 Mar 2023 22:26:16 +0800 Subject: [PATCH] Remove workaround of delaying remove task The timing doesn't work on the latest code base. The onStop of activity still almost has no chance to be called after swiping the task to kill process. And the friendly activity lifecycle will be controlled by removeTask since Id69a8ba77da16a13f7a3413bb004fc2206f4b4e8. Bug: 184899234 Bug: 213583589 Test: No behavior change after swiping task out from recents Change-Id: If4110069834964571df7128b119fc6c782a03b34 --- .../com/android/quickstep/views/RecentsView.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index fe50d9aeff..9a25e9ca64 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -225,10 +225,6 @@ public abstract class RecentsView CONTENT_ALPHA = new FloatProperty("contentAlpha") { @Override @@ -3893,14 +3889,13 @@ public abstract class RecentsView { ActivityManagerWrapper.getInstance().removeTask(primaryTaskId); if (secondaryTaskId != -1) { ActivityManagerWrapper.getInstance().removeTask(secondaryTaskId); } - }, - REMOVE_TASK_WAIT_FOR_APP_STOP_MS); + }); } protected void onDismissAnimationEnds() { @@ -3923,9 +3918,8 @@ public abstract class RecentsView { - UI_HELPER_EXECUTOR.getHandler().postDelayed( - ActivityManagerWrapper.getInstance()::removeAllRecentTasks, - REMOVE_TASK_WAIT_FOR_APP_STOP_MS); + UI_HELPER_EXECUTOR.getHandler().post( + ActivityManagerWrapper.getInstance()::removeAllRecentTasks); removeTasksViewsAndClearAllButton(); startHome(); });