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

Commit bb4f085b authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "[WM] Don't moveTaskToBackInner if it's already detached" into main am:...

Merge "[WM] Don't moveTaskToBackInner if it's already detached" into main am: d17e9435 am: 6fa6c162

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3304112



Change-Id: I85cf1b736766e8ce9ace4d53958af389dab79aa5
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents fca8ee70 6fa6c162
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -5734,6 +5734,12 @@ class Task extends TaskFragment {
    }

    private boolean canMoveTaskToBack(Task task) {
        // Checks whether a task is a child of this task because it can be reparetned when
        // transition is deferred.
        if (task != this && task.getParent() != this) {
            return false;
        }

        // In LockTask mode, moving a locked task to the back of the root task may expose unlocked
        // ones. Therefore we need to check if this operation is allowed.
        if (!mAtmService.getLockTaskController().canMoveTaskToBack(task)) {
@@ -5803,7 +5809,7 @@ class Task extends TaskFragment {
                    (deferred) -> {
                        // Need to check again if deferred since the system might
                        // be in a different state.
                        if (!isAttached() || (deferred && !canMoveTaskToBack(tr))) {
                        if (!tr.isAttached() || (deferred && !canMoveTaskToBack(tr))) {
                            Slog.e(TAG, "Failed to move task to back after saying we could: "
                                    + tr.mTaskId);
                            transition.abort();