Clear associated task when starting activity in a new task.

In the case that an activity is brought to the foreground with clear
top, we will start it at the top of the source record's task. The
current code sets the task to match the found activity, which will no
longer be the case.

This changelist cleans up this reference so that we do not try to
reparent and instead just add the activity to the task.

Change-Id: Ic7428548fa4972aa19bc9ba890c9edaf2ff31220
Fixes: 35318848
Test: manual by bug repo steps (consistently reproducible).
This commit is contained in:
Bryce Lee
2017-02-23 09:46:45 -08:00
parent 035ecae4bb
commit 353112c604

View File

@@ -1544,6 +1544,9 @@ class ActivityStarter {
// running, and the caller has asked to clear the current task to have this
// activity at the top.
mAddingToTask = true;
// We are no longer placing the activity in the task we previously thought we were.
mStartActivity.task = null;
// Now pretend like this activity is being started by the top of its task, so it
// is put in the right place.
mSourceRecord = intentActivity;