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

Commit 369be64b authored by Andrii Kulian's avatar Andrii Kulian
Browse files

Revert "Don't update task to return to type for last task over home"

This reverts commit 21893824.

Original commit revealed issue b/29342752 when launch logic was applied
to incorrect stack while moving to PiP mode.

Bug: 29342752
Bug: 29237751
Change-Id: I88d75399eb4b9daf4de87a9a560eb0df0b515173
parent 21893824
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -2581,14 +2581,11 @@ final class ActivityStack {
    }

    private void insertTaskAtTop(TaskRecord task, ActivityRecord newActivity) {
        boolean isLastTaskOverHome = false;
        // If the moving task is over home stack, transfer its return type to next task
        if (task.isOverHomeStack()) {
            final TaskRecord nextTask = getNextTask(task);
            if (nextTask != null) {
                nextTask.setTaskToReturnTo(task.getTaskToReturnTo());
            } else {
                isLastTaskOverHome = true;
            }
        }

@@ -2598,10 +2595,7 @@ final class ActivityStack {
            ActivityStack lastStack = mStackSupervisor.getLastStack();
            final boolean fromHome = lastStack.isHomeStack();
            if (!isHomeStack() && (fromHome || topTask() != task)) {
                // If it's a last task over home - we default to keep its return to type not to
                // make underlying task focused when this one will be finished.
                int returnToType = isLastTaskOverHome
                        ? task.getTaskToReturnTo() : APPLICATION_ACTIVITY_TYPE;
                int returnToType = APPLICATION_ACTIVITY_TYPE;
                if (fromHome && StackId.allowTopTaskToReturnHome(mStackId)) {
                    returnToType = lastStack.topTask() == null
                            ? HOME_ACTIVITY_TYPE : lastStack.topTask().taskType;