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

Commit 7dcbfb02 authored by Benjamin Franz's avatar Benjamin Franz
Browse files

Block root task from being shown in recents

Do not show the root task of lock task mode in recents and thereby block
it from being swiped away.

Bug: 70332786
Test: manual
Change-Id: I529c2896faae6b6d94ba3b758d15f40d83fb8573
parent a501257e
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -284,6 +284,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.
+5 −0
Original line number Diff line number Diff line
@@ -1150,6 +1150,11 @@ class RecentTasks {
                }
        }

        // If we're in lock task mode, ignore the root task
        if (task == mService.mLockTaskController.getRootTask()) {
            return false;
        }

        return true;
    }