summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Winson <winsonc@google.com> 2016-06-28 18:25:15 -0700
committer Winson Chung <winsonc@google.com> 2016-06-29 02:13:37 +0000
commit16ef39a7f6f000af761cf2c2a3e2823a0fbd0c4c (patch)
treee68ef7db0bf055d3d59a590a281d24db58bfae20
parent60c04126c959349234e3cdcccb606f986e9d4a06 (diff)
Move preloading to boot complete.
Bug: 29320695 Change-Id: I14b5127b218597f3c32e647e0443a88b5a708ce1
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java8
2 files changed, 8 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
index b20f46f6b1f5..7e1deec3429a 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
@@ -184,7 +184,9 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
mHeaderBar = (TaskViewHeader) inflater.inflate(R.layout.recents_task_view_header,
null, false);
reloadResources();
+ }
+ public void onBootCompleted() {
// When we start, preload the data associated with the previous recent tasks.
// We can use a new plan since the caches will be the same.
RecentsTaskLoader loader = Recents.getTaskLoader();
@@ -197,10 +199,6 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
loader.loadTasks(mContext, plan, launchOpts);
}
- public void onBootCompleted() {
- // Do nothing
- }
-
public void onConfigurationChanged() {
reloadResources();
mDummyStackView.reloadOnConfigurationChange();
diff --git a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
index 94231c6403b0..d5aa69ab3105 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
@@ -314,8 +314,12 @@ public class SystemServicesProxy {
if (includeFrontMostExcludedTask) {
flags |= ActivityManager.RECENT_WITH_EXCLUDED;
}
- List<ActivityManager.RecentTaskInfo> tasks = mAm.getRecentTasksForUser(numTasksToQuery,
- flags, userId);
+ List<ActivityManager.RecentTaskInfo> tasks = null;
+ try {
+ tasks = mAm.getRecentTasksForUser(numTasksToQuery, flags, userId);
+ } catch (Exception e) {
+ Log.e(TAG, "Failed to get recent tasks", e);
+ }
// Break early if we can't get a valid set of tasks
if (tasks == null) {