Merge "Don't remove task needed for reuse when clearing during activity start."

This commit is contained in:
Filip Gruszczynski
2016-01-19 21:26:55 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 2 deletions

View File

@@ -876,7 +876,7 @@ class ActivityStarter {
// In this situation we want to remove all activities from the task up to the one
// being started. In most cases this means we are resetting the task to its initial
// state.
final ActivityRecord top = intentActivity.task.performClearTaskLocked(
final ActivityRecord top = intentActivity.task.performClearTaskForReuseLocked(
mStartActivity, mLaunchFlags);
if (top != null) {
if (top.frontOfTask) {

View File

@@ -206,7 +206,7 @@ final class TaskRecord {
// Used in the unique case where we are clearing the task in order to reuse it. In that case we
// do not want to delete the stack when the task goes empty.
boolean mReuseTask = false;
private boolean mReuseTask = false;
private Bitmap mLastThumbnail; // Last thumbnail captured for this item.
private final File mLastThumbnailFile; // File containing last thumbnail.
@@ -777,6 +777,13 @@ final class TaskRecord {
mReuseTask = false;
}
ActivityRecord performClearTaskForReuseLocked(ActivityRecord newR, int launchFlags) {
mReuseTask = true;
final ActivityRecord result = performClearTaskLocked(newR, launchFlags);
mReuseTask = false;
return result;
}
/**
* Perform clear operation as requested by
* {@link Intent#FLAG_ACTIVITY_CLEAR_TOP}: search from the top of the