Fixing issue with double tap sometimes launching the same task.

- When double tapping, the next preload call can come in before activity
  start, which then resets the instance load plan (which is not 
  preloaded since Recents is “on top”), thus having no launch task, 
  which then falls back to launching the front-most task.  The preload
  call should never create a new plan unless it will preload it.

Change-Id: I001bfc901856c4e6b4e4b9b6a2125085b53c808b
This commit is contained in:
Winson
2016-02-16 18:11:35 -08:00
parent 91b225d41f
commit 5b4e0d2b11

View File

@@ -406,9 +406,9 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
SystemServicesProxy ssp = Recents.getSystemServices();
ActivityManager.RunningTaskInfo topTask = ssp.getTopMostTask();
MutableBoolean topTaskHome = new MutableBoolean(true);
RecentsTaskLoader loader = Recents.getTaskLoader();
sInstanceLoadPlan = loader.createLoadPlan(mContext);
if (topTask != null && !ssp.isRecentsTopMost(topTask, topTaskHome)) {
RecentsTaskLoader loader = Recents.getTaskLoader();
sInstanceLoadPlan = loader.createLoadPlan(mContext);
sInstanceLoadPlan.preloadRawTasks(topTaskHome.value);
loader.preloadTasks(sInstanceLoadPlan, topTask.id, topTaskHome.value);
TaskStack stack = sInstanceLoadPlan.getTaskStack();