From a91c293be26b2deb5434eb827a800fa0c80dc92c Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Fri, 7 Nov 2014 15:02:38 -0800 Subject: Preload only visible thumbnails and task icons. (Bug 17672056, Bug 18291345) This change ensures that only the number of visible thumbnails and task icons are loaded to minimize the delay required when initializing the stack without the cache. In addition, this change reduces the number of times that the task stack is recomposed when launching recents (in addition to the number of calls to getRecentTasks()). There is also a fix to a regression where the exit trigger is not run when the task stack view is empty. Change-Id: I75834ff3c57c0e5dad6252b982f71c6e740071f2 --- core/res/res/values/config.xml | 2 +- .../recents/AlternateRecentsComponent.java | 107 +++++---- .../com/android/systemui/recents/Constants.java | 5 - .../android/systemui/recents/RecentsActivity.java | 52 +++-- .../systemui/recents/misc/SystemServicesProxy.java | 1 + .../recents/model/RecentsTaskLoadPlan.java | 224 +++++++++++++++++++ .../systemui/recents/model/RecentsTaskLoader.java | 248 +++++++-------------- .../systemui/recents/views/RecentsView.java | 8 +- .../systemui/recents/views/TaskStackView.java | 8 + .../views/TaskStackViewLayoutAlgorithm.java | 80 ++++++- 10 files changed, 496 insertions(+), 239 deletions(-) create mode 100644 packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoadPlan.java diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 52ef4f9..20490c9 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -776,7 +776,7 @@ This needs to match the constants in policy/src/com/android/internal/policy/impl/PhoneWindowManager.java --> - 1 + 0