Merge "Check lock-task mode if task_on_home is applied" into tm-qpr-dev am: 2016b1dcd1 am: eedcc99716

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

Change-Id: I350129fc898537a3e0a0aeec3a49a673ca2e9b14
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jeff Chang
2022-12-12 15:08:08 +00:00
committed by Automerger Merge Worker

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