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

This commit is contained in:
Jeff Chang
2022-12-12 06:00:52 +00:00
committed by Android (Google) Code Review

View File

@@ -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();