Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be9dabdc authored by Filip Gruszczynski's avatar Filip Gruszczynski
Browse files

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

Bug: 26541093
Change-Id: I4ed39110e9bd72e5f7e11a49acc0a36dc8414df4
parent 82b425f8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) {
+8 −1
Original line number Diff line number Diff line
@@ -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