Move preloading to boot complete.

am: 16ef39a7f6

Change-Id: Ib10db04397d2a962c50530ce537f9ac1b2863a0a
This commit is contained in:
Winson
2016-06-29 02:20:47 +00:00
committed by android-build-merger
2 changed files with 8 additions and 6 deletions

View File

@@ -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();

View File

@@ -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) {