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

Commit c9241ba8 authored by Winson Chung's avatar Winson Chung
Browse files

Add shell command to reset the frozen task state

- This can be used by tests to prevent leakage between test runs
  immediately after quickswitching (starting a quickswitch will
  freeze the recents task list for 5s)

Bug: 298544839
Test: QuickSwitchBetweenTwoAppsForwardTest
Change-Id: Ib4a5d64486ce699533c9f57c0c6faf30181a8bed
parent dd593baa
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -9643,4 +9643,15 @@ public class WindowManagerService extends IWindowManager.Stub
            Binder.restoreCallingIdentity(origId);
        }
    }

    /**
     * Resets the spatial ordering of recents for testing purposes.
     */
    void resetFreezeRecentTaskListReordering() {
        if (!checkCallingPermission(MANAGE_ACTIVITY_TASKS,
                "resetFreezeRecentTaskListReordering()")) {
            throw new SecurityException("Requires MANAGE_ACTIVITY_TASKS permission");
        }
        mAtmService.getRecentTasks().resetFreezeTaskListReorderingOnTimeout();
    }
}
+9 −0
Original line number Diff line number Diff line
@@ -142,6 +142,8 @@ public class WindowManagerShellCommand extends ShellCommand {
                    return runReset(pw);
                case "disable-blur":
                    return runSetBlurDisabled(pw);
                case "reset-freeze-recent-tasks":
                    return runResetFreezeRecentTaskListReordering(pw);
                case "shell":
                    return runWmShellCommand(pw);
                default:
@@ -252,6 +254,11 @@ public class WindowManagerShellCommand extends ShellCommand {
        return 0;
    }

    private int runResetFreezeRecentTaskListReordering(PrintWriter pw) throws RemoteException {
        mInternal.resetFreezeRecentTaskListReordering();
        return 0;
    }

    private void printInitialDisplayDensity(PrintWriter pw , int displayId) {
        try {
            final int initialDensity = mInterface.getInitialDisplayDensity(displayId);
@@ -1489,6 +1496,8 @@ public class WindowManagerShellCommand extends ShellCommand {
        printLetterboxHelp(pw);
        printMultiWindowConfigHelp(pw);

        pw.println("  reset-freeze-recent-tasks");
        pw.println("    Resets the spatial ordering of the recent tasks list");
        pw.println("  reset [-d DISPLAY_ID]");
        pw.println("    Reset all override settings.");
        if (!IS_USER) {