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

Commit e2ff09ff authored by Nikolai Gladkov's avatar Nikolai Gladkov
Browse files

Add a command to clear recent apps

This CL adds a command imitating a click to `Clear all` button in Overview, clearing the list of recently used apps.

Test: Run `adb shell am clear-recent-apps`
Bug: 260204765
Change-Id: I442223610acda34349b00956d77c649153a3b815
parent d7d2d977
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -248,6 +248,8 @@ final class ActivityManagerShellCommand extends ShellCommand {
                    return runForceStop(pw);
                case "stop-app":
                    return runStopApp(pw);
                case "clear-recent-apps":
                    return runClearRecentApps(pw);
                case "fgs-notification-rate-limit":
                    return runFgsNotificationRateLimit(pw);
                case "crash":
@@ -1192,6 +1194,11 @@ final class ActivityManagerShellCommand extends ShellCommand {
        return 0;
    }

    int runClearRecentApps(PrintWriter pw) throws RemoteException {
        mTaskInterface.removeAllVisibleRecentTasks();
        return 0;
    }

    int runFgsNotificationRateLimit(PrintWriter pw) throws RemoteException {
        final String toggleValue = getNextArgRequired();
        final boolean enable;