diff --git a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java index 869c6a4d3a5c2..6b0764791b484 100644 --- a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java +++ b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java @@ -250,6 +250,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": @@ -1205,6 +1207,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;