Keep stack from mReuseTask
When we launch an activity with CLEAR_TOP and NEW_TASK, we clear all the activities in that task but then we don't reuse the stack, which can lead to weirdness. To fix this, we need to keep the target stack in that case. Bug: 28000613 Change-Id: If85ade73b1036e8a7c0eda418d9f39e8596b8b16
This commit is contained in:
@@ -1853,6 +1853,12 @@ class ActivityStarter {
|
||||
|
||||
private ActivityStack getLaunchStack(ActivityRecord r, int launchFlags, TaskRecord task,
|
||||
ActivityOptions aOptions) {
|
||||
|
||||
// We are reusing a task, keep the stack!
|
||||
if (mReuseTask != null) {
|
||||
return mReuseTask.stack;
|
||||
}
|
||||
|
||||
final int launchStackId =
|
||||
(aOptions != null) ? aOptions.getLaunchStackId() : INVALID_STACK_ID;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user