Loading packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -138,14 +138,15 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta } } } } // When we start, preload the metadata and icons associated with the recent tasks. // 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. // We can use a new plan since the caches will be the same. RecentsTaskLoader loader = RecentsTaskLoader.getInstance(); RecentsTaskLoader loader = RecentsTaskLoader.getInstance(); RecentsTaskLoadPlan plan = loader.createLoadPlan(mContext); RecentsTaskLoadPlan plan = loader.createLoadPlan(mContext); loader.preloadTasks(plan, true /* isTopTaskHome */); loader.preloadTasks(plan, true /* isTopTaskHome */); RecentsTaskLoadPlan.Options launchOpts = new RecentsTaskLoadPlan.Options(); RecentsTaskLoadPlan.Options launchOpts = new RecentsTaskLoadPlan.Options(); launchOpts.numVisibleTasks = loader.getApplicationIconCacheSize(); launchOpts.numVisibleTasks = loader.getApplicationIconCacheSize(); launchOpts.loadThumbnails = false; launchOpts.numVisibleTaskThumbnails = loader.getThumbnailCacheSize(); launchOpts.onlyLoadForCache = true; loader.loadTasks(mContext, plan, launchOpts); loader.loadTasks(mContext, plan, launchOpts); } } Loading Loading @@ -510,6 +511,7 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta RecentsTaskLoadPlan.Options launchOpts = new RecentsTaskLoadPlan.Options(); RecentsTaskLoadPlan.Options launchOpts = new RecentsTaskLoadPlan.Options(); launchOpts.runningTaskId = topTask.id; launchOpts.runningTaskId = topTask.id; launchOpts.loadThumbnails = false; launchOpts.loadThumbnails = false; launchOpts.onlyLoadForCache = true; loader.loadTasks(mContext, sInstanceLoadPlan, launchOpts); loader.loadTasks(mContext, sInstanceLoadPlan, launchOpts); // Try starting with a thumbnail transition // Try starting with a thumbnail transition Loading packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +3 −1 Original line number Original line Diff line number Diff line Loading @@ -213,10 +213,12 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView RecentsTaskLoadPlan plan = AlternateRecentsComponent.consumeInstanceLoadPlan(); RecentsTaskLoadPlan plan = AlternateRecentsComponent.consumeInstanceLoadPlan(); if (plan == null) { if (plan == null) { plan = loader.createLoadPlan(this); plan = loader.createLoadPlan(this); loader.preloadTasks(plan, mConfig.launchedFromHome); } } // Start loading tasks according to the load plan // Start loading tasks according to the load plan if (plan.getTaskStack() == null) { loader.preloadTasks(plan, mConfig.launchedFromHome); } RecentsTaskLoadPlan.Options loadOpts = new RecentsTaskLoadPlan.Options(); RecentsTaskLoadPlan.Options loadOpts = new RecentsTaskLoadPlan.Options(); loadOpts.runningTaskId = mConfig.launchedToTaskId; loadOpts.runningTaskId = mConfig.launchedToTaskId; loadOpts.numVisibleTasks = numVisibleTasks; loadOpts.numVisibleTasks = numVisibleTasks; Loading packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoadPlan.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -49,6 +49,7 @@ public class RecentsTaskLoadPlan { public int runningTaskId = -1; public int runningTaskId = -1; public boolean loadIcons = true; public boolean loadIcons = true; public boolean loadThumbnails = true; public boolean loadThumbnails = true; public boolean onlyLoadForCache = false; public int numVisibleTasks = 0; public int numVisibleTasks = 0; public int numVisibleTaskThumbnails = 0; public int numVisibleTaskThumbnails = 0; } } Loading packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java +12 −4 Original line number Original line Diff line number Diff line Loading @@ -418,29 +418,37 @@ public class RecentsTaskLoader { return mMaxIconCacheSize; return mMaxIconCacheSize; } } /** Returns the size of the thumbnail cache. */ public int getThumbnailCacheSize() { return mMaxThumbnailCacheSize; } /** Creates a new plan for loading the recent tasks. */ public RecentsTaskLoadPlan createLoadPlan(Context context) { public RecentsTaskLoadPlan createLoadPlan(Context context) { RecentsConfiguration config = RecentsConfiguration.getInstance(); RecentsConfiguration config = RecentsConfiguration.getInstance(); RecentsTaskLoadPlan plan = new RecentsTaskLoadPlan(context, config, mSystemServicesProxy); RecentsTaskLoadPlan plan = new RecentsTaskLoadPlan(context, config, mSystemServicesProxy); return plan; return plan; } } /** Preloads recents tasks using the specified plan to store the output. */ public void preloadTasks(RecentsTaskLoadPlan plan, boolean isTopTaskHome) { public void preloadTasks(RecentsTaskLoadPlan plan, boolean isTopTaskHome) { plan.preloadPlan(this, isTopTaskHome); plan.preloadPlan(this, isTopTaskHome); } } /** Begins loading the heavy task data according to the specified options. */ public void loadTasks(Context context, RecentsTaskLoadPlan plan, public void loadTasks(Context context, RecentsTaskLoadPlan plan, RecentsTaskLoadPlan.Options opts) { RecentsTaskLoadPlan.Options opts) { if (opts == null) { if (opts == null) { throw new RuntimeException("Requires load options"); throw new RuntimeException("Requires load options"); } } plan.executePlan(opts, this); plan.executePlan(opts, this); if (opts.numVisibleTasks > 0) { if (!opts.onlyLoadForCache) { mNumVisibleTasksLoaded = opts.numVisibleTasks; mNumVisibleTasksLoaded = opts.numVisibleTasks; } // Start the loader // Start the loader mLoader.start(context); mLoader.start(context); } } } /** Acquires the task resource data directly from the pool. */ /** Acquires the task resource data directly from the pool. */ public void loadTaskData(Task t) { public void loadTaskData(Task t) { Loading Loading
packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -138,14 +138,15 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta } } } } // When we start, preload the metadata and icons associated with the recent tasks. // 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. // We can use a new plan since the caches will be the same. RecentsTaskLoader loader = RecentsTaskLoader.getInstance(); RecentsTaskLoader loader = RecentsTaskLoader.getInstance(); RecentsTaskLoadPlan plan = loader.createLoadPlan(mContext); RecentsTaskLoadPlan plan = loader.createLoadPlan(mContext); loader.preloadTasks(plan, true /* isTopTaskHome */); loader.preloadTasks(plan, true /* isTopTaskHome */); RecentsTaskLoadPlan.Options launchOpts = new RecentsTaskLoadPlan.Options(); RecentsTaskLoadPlan.Options launchOpts = new RecentsTaskLoadPlan.Options(); launchOpts.numVisibleTasks = loader.getApplicationIconCacheSize(); launchOpts.numVisibleTasks = loader.getApplicationIconCacheSize(); launchOpts.loadThumbnails = false; launchOpts.numVisibleTaskThumbnails = loader.getThumbnailCacheSize(); launchOpts.onlyLoadForCache = true; loader.loadTasks(mContext, plan, launchOpts); loader.loadTasks(mContext, plan, launchOpts); } } Loading Loading @@ -510,6 +511,7 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta RecentsTaskLoadPlan.Options launchOpts = new RecentsTaskLoadPlan.Options(); RecentsTaskLoadPlan.Options launchOpts = new RecentsTaskLoadPlan.Options(); launchOpts.runningTaskId = topTask.id; launchOpts.runningTaskId = topTask.id; launchOpts.loadThumbnails = false; launchOpts.loadThumbnails = false; launchOpts.onlyLoadForCache = true; loader.loadTasks(mContext, sInstanceLoadPlan, launchOpts); loader.loadTasks(mContext, sInstanceLoadPlan, launchOpts); // Try starting with a thumbnail transition // Try starting with a thumbnail transition Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +3 −1 Original line number Original line Diff line number Diff line Loading @@ -213,10 +213,12 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView RecentsTaskLoadPlan plan = AlternateRecentsComponent.consumeInstanceLoadPlan(); RecentsTaskLoadPlan plan = AlternateRecentsComponent.consumeInstanceLoadPlan(); if (plan == null) { if (plan == null) { plan = loader.createLoadPlan(this); plan = loader.createLoadPlan(this); loader.preloadTasks(plan, mConfig.launchedFromHome); } } // Start loading tasks according to the load plan // Start loading tasks according to the load plan if (plan.getTaskStack() == null) { loader.preloadTasks(plan, mConfig.launchedFromHome); } RecentsTaskLoadPlan.Options loadOpts = new RecentsTaskLoadPlan.Options(); RecentsTaskLoadPlan.Options loadOpts = new RecentsTaskLoadPlan.Options(); loadOpts.runningTaskId = mConfig.launchedToTaskId; loadOpts.runningTaskId = mConfig.launchedToTaskId; loadOpts.numVisibleTasks = numVisibleTasks; loadOpts.numVisibleTasks = numVisibleTasks; Loading
packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoadPlan.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -49,6 +49,7 @@ public class RecentsTaskLoadPlan { public int runningTaskId = -1; public int runningTaskId = -1; public boolean loadIcons = true; public boolean loadIcons = true; public boolean loadThumbnails = true; public boolean loadThumbnails = true; public boolean onlyLoadForCache = false; public int numVisibleTasks = 0; public int numVisibleTasks = 0; public int numVisibleTaskThumbnails = 0; public int numVisibleTaskThumbnails = 0; } } Loading
packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java +12 −4 Original line number Original line Diff line number Diff line Loading @@ -418,29 +418,37 @@ public class RecentsTaskLoader { return mMaxIconCacheSize; return mMaxIconCacheSize; } } /** Returns the size of the thumbnail cache. */ public int getThumbnailCacheSize() { return mMaxThumbnailCacheSize; } /** Creates a new plan for loading the recent tasks. */ public RecentsTaskLoadPlan createLoadPlan(Context context) { public RecentsTaskLoadPlan createLoadPlan(Context context) { RecentsConfiguration config = RecentsConfiguration.getInstance(); RecentsConfiguration config = RecentsConfiguration.getInstance(); RecentsTaskLoadPlan plan = new RecentsTaskLoadPlan(context, config, mSystemServicesProxy); RecentsTaskLoadPlan plan = new RecentsTaskLoadPlan(context, config, mSystemServicesProxy); return plan; return plan; } } /** Preloads recents tasks using the specified plan to store the output. */ public void preloadTasks(RecentsTaskLoadPlan plan, boolean isTopTaskHome) { public void preloadTasks(RecentsTaskLoadPlan plan, boolean isTopTaskHome) { plan.preloadPlan(this, isTopTaskHome); plan.preloadPlan(this, isTopTaskHome); } } /** Begins loading the heavy task data according to the specified options. */ public void loadTasks(Context context, RecentsTaskLoadPlan plan, public void loadTasks(Context context, RecentsTaskLoadPlan plan, RecentsTaskLoadPlan.Options opts) { RecentsTaskLoadPlan.Options opts) { if (opts == null) { if (opts == null) { throw new RuntimeException("Requires load options"); throw new RuntimeException("Requires load options"); } } plan.executePlan(opts, this); plan.executePlan(opts, this); if (opts.numVisibleTasks > 0) { if (!opts.onlyLoadForCache) { mNumVisibleTasksLoaded = opts.numVisibleTasks; mNumVisibleTasksLoaded = opts.numVisibleTasks; } // Start the loader // Start the loader mLoader.start(context); mLoader.start(context); } } } /** Acquires the task resource data directly from the pool. */ /** Acquires the task resource data directly from the pool. */ public void loadTaskData(Task t) { public void loadTaskData(Task t) { Loading