diff options
| author | 2022-11-23 11:55:14 +0000 | |
|---|---|---|
| committer | 2022-11-23 11:55:14 +0000 | |
| commit | e2ff09ff6e2d049ea1448e452b47ed3ebf16a19e (patch) | |
| tree | 3d051abdb2e02965e1a97b27518a29a32d4e725e | |
| parent | d7d2d977a614e45a5ba6f3d0a405d4d0187bc385 (diff) | |
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
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerShellCommand.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java index 2ec744fd4bb8..c868f533bb7c 100644 --- a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java +++ b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java @@ -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; |