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

Commit 2016b1dc authored by Jeff Chang's avatar Jeff Chang Committed by Android (Google) Code Review
Browse files

Merge "Check lock-task mode if task_on_home is applied" into tm-qpr-dev

parents e87c348f 9eef8ebc
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -1125,11 +1125,12 @@ class Task extends TaskFragment {
        if (inMultiWindowMode() || !hasChild()) return false;
        if (intent != null) {
            final int returnHomeFlags = FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_TASK_ON_HOME;
            if ((intent.getFlags() & returnHomeFlags) != returnHomeFlags) {
                return false;
            }
            final Task task = getDisplayArea() != null ? getDisplayArea().getRootHomeTask() : null;
            final boolean isLockTaskModeViolation = task != null
                    && mAtmService.getLockTaskController().isLockTaskModeViolation(task);
            return (intent.getFlags() & returnHomeFlags) == returnHomeFlags
                    && !isLockTaskModeViolation;
            return !(task != null
                    && mAtmService.getLockTaskController().isLockTaskModeViolation(task));
        }
        final Task bottomTask = getBottomMostTask();
        return bottomTask != this && bottomTask.returnsToHomeRootTask();