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

Commit 49853bf1 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Don't delete home stack when last task is removed.

Bug: 19470291
Change-Id: I4a6c24edb6cc83a0f155836ce4e1394807da1563
parent 3c8fde83
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -4162,15 +4162,18 @@ final class ActivityStack {

        if (mTaskHistory.isEmpty()) {
            if (DEBUG_STACK) Slog.i(TAG, "removeTask: moving to back stack=" + this);
            final boolean notHomeStack = !isHomeStack();
            if (isOnHomeDisplay()) {
                mStackSupervisor.moveHomeStack(!isHomeStack(), reason + " leftTaskHistoryEmpty");
                mStackSupervisor.moveHomeStack(notHomeStack, reason + " leftTaskHistoryEmpty");
            }
            if (mStacks != null) {
                mStacks.remove(this);
                mStacks.add(0, this);
            }
            if (notHomeStack) {
                mActivityContainer.onTaskListEmptyLocked();
            }
        }

        task.stack = null;
    }