Merge "Consider the lock-task mode while using FLAG_ACTIVITY_TASK_ON_HOME" into sc-v2-dev am: e171c540da

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

Change-Id: Id507a32c6035cfce5b03e5a531586e28d8edc106
This commit is contained in:
TreeHugger Robot
2021-11-12 06:29:16 +00:00
committed by Automerger Merge Worker

View File

@@ -1126,7 +1126,11 @@ class Task extends TaskFragment {
if (inMultiWindowMode() || !hasChild()) return false;
if (intent != null) {
final int returnHomeFlags = FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_TASK_ON_HOME;
return intent != null && (intent.getFlags() & returnHomeFlags) == returnHomeFlags;
final Task task = getDisplayArea() != null ? getDisplayArea().getRootHomeTask() : null;
final boolean isLockTaskModeViolation = task != null
&& mAtmService.getLockTaskController().isLockTaskModeViolation(task);
return (intent.getFlags() & returnHomeFlags) == returnHomeFlags
&& !isLockTaskModeViolation;
}
final Task bottomTask = getBottomMostTask();
return bottomTask != this && bottomTask.returnsToHomeRootTask();