Merge "Block root task from being shown in recents" into pi-dev am: 8a5e85c9ef

am: 5d65eeea4c

Change-Id: I33de46bad18ad5366edb479c0ff446090f43d8ac
This commit is contained in:
Benjamin Franz
2018-03-29 23:40:01 +00:00
committed by android-build-merger
2 changed files with 15 additions and 0 deletions

View File

@@ -285,6 +285,16 @@ public class LockTaskController {
return false;
}
/**
* @return the root task of the lock task.
*/
TaskRecord getRootTask() {
if (mLockTaskModeTasks.isEmpty()) {
return null;
}
return mLockTaskModeTasks.get(0);
}
private boolean isLockTaskModeViolationInternal(TaskRecord task, boolean isNewClearTask) {
// TODO: Double check what's going on here. If the task is already in lock task mode, it's
// likely whitelisted, so will return false below.

View File

@@ -1155,6 +1155,11 @@ class RecentTasks {
}
}
// If we're in lock task mode, ignore the root task
if (task == mService.mLockTaskController.getRootTask()) {
return false;
}
return true;
}