Remove TaskViews and Clear All button from RecentsView.
This means that when Overview is being opened it doesn't have to do this work. Also many cancelled pieces of work are received on main because tasks and images are loaded before the TaskViews are removed. Removing TaskViews in onReset avoids this as CoroutineScopes for Views are already cancelled.
Bug: 387511656
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Test: Checking perfetto traces shows that this reduces the number of continuations on main significantly
Test: Manual - opening Overview (from home, app)
Test: Manual - splitting an app
Test: Manual - overlay presence
Test: Manual - splash icon
Test: Presubmit (TAPL/image tests etc)
Change-Id: I871f3c3931bba733d579583d69bc197ccbcad132
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 7c745a2..3983fe9 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -2664,6 +2664,7 @@
private void onReset() {
if (enableRefactorTaskThumbnail()) {
mRecentsViewModel.onReset();
+ removeAllViews();
}
unloadVisibleTaskData(TaskView.FLAG_UPDATE_ALL);
setCurrentPage(0);