Loading core/java/android/app/ActivityTaskManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -203,6 +203,19 @@ public class ActivityTaskManager { } } /** * Removes all visible recent tasks from the system. * @hide */ @RequiresPermission(android.Manifest.permission.REMOVE_TASKS) public void removeAllVisibleRecentTasks() { try { getService().removeAllVisibleRecentTasks(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Return the maximum number of recents entries that we will maintain and show. * @hide Loading core/java/android/app/IActivityTaskManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -139,6 +139,7 @@ interface IActivityTaskManager { ComponentName getCallingActivity(in IBinder token); void setFocusedTask(int taskId); boolean removeTask(int taskId); void removeAllVisibleRecentTasks(); List<ActivityManager.RunningTaskInfo> getTasks(int maxNum); List<ActivityManager.RunningTaskInfo> getFilteredTasks(int maxNum, int ignoreActivityType, int ignoreWindowingMode); Loading packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java +16 −0 Original line number Diff line number Diff line Loading @@ -393,6 +393,22 @@ public class ActivityManagerWrapper { }); } /** * Removes all the recent tasks. */ public void removeAllRecentTasks() { mBackgroundExecutor.submit(new Runnable() { @Override public void run() { try { ActivityTaskManager.getService().removeAllVisibleRecentTasks(); } catch (RemoteException e) { Log.w(TAG, "Failed to remove all tasks", e); } } }); } /** * Cancels the current window transtion to/from Recents for the given task id. */ Loading services/core/java/com/android/server/am/ActivityStackSupervisor.java +3 −3 Original line number Diff line number Diff line Loading @@ -3230,12 +3230,12 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D } @Override public void onRecentTaskRemoved(TaskRecord task, boolean wasTrimmed) { public void onRecentTaskRemoved(TaskRecord task, boolean wasTrimmed, boolean killProcess) { if (wasTrimmed) { // Task was trimmed from the recent tasks list -- remove the active task record as well // since the user won't really be able to go back to it removeTaskByIdLocked(task.taskId, false /* killProcess */, false /* removeFromRecents */, !PAUSE_IMMEDIATELY, "recent-task-trimmed"); removeTaskByIdLocked(task.taskId, killProcess, false /* removeFromRecents */, !PAUSE_IMMEDIATELY, "recent-task-trimmed"); } task.removedFromRecents(); } Loading services/core/java/com/android/server/am/ActivityTaskManagerService.java +13 −0 Original line number Diff line number Diff line Loading @@ -1667,6 +1667,19 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } } @Override public void removeAllVisibleRecentTasks() { enforceCallerIsRecentsOrHasPermission(REMOVE_TASKS, "removeAllVisibleRecentTasks()"); synchronized (mGlobalLock) { final long ident = Binder.clearCallingIdentity(); try { getRecentTasks().removeAllVisibleTasks(); } finally { Binder.restoreCallingIdentity(ident); } } } @Override public boolean shouldUpRecreateTask(IBinder token, String destAffinity) { synchronized (mGlobalLock) { Loading Loading
core/java/android/app/ActivityTaskManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -203,6 +203,19 @@ public class ActivityTaskManager { } } /** * Removes all visible recent tasks from the system. * @hide */ @RequiresPermission(android.Manifest.permission.REMOVE_TASKS) public void removeAllVisibleRecentTasks() { try { getService().removeAllVisibleRecentTasks(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Return the maximum number of recents entries that we will maintain and show. * @hide Loading
core/java/android/app/IActivityTaskManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -139,6 +139,7 @@ interface IActivityTaskManager { ComponentName getCallingActivity(in IBinder token); void setFocusedTask(int taskId); boolean removeTask(int taskId); void removeAllVisibleRecentTasks(); List<ActivityManager.RunningTaskInfo> getTasks(int maxNum); List<ActivityManager.RunningTaskInfo> getFilteredTasks(int maxNum, int ignoreActivityType, int ignoreWindowingMode); Loading
packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java +16 −0 Original line number Diff line number Diff line Loading @@ -393,6 +393,22 @@ public class ActivityManagerWrapper { }); } /** * Removes all the recent tasks. */ public void removeAllRecentTasks() { mBackgroundExecutor.submit(new Runnable() { @Override public void run() { try { ActivityTaskManager.getService().removeAllVisibleRecentTasks(); } catch (RemoteException e) { Log.w(TAG, "Failed to remove all tasks", e); } } }); } /** * Cancels the current window transtion to/from Recents for the given task id. */ Loading
services/core/java/com/android/server/am/ActivityStackSupervisor.java +3 −3 Original line number Diff line number Diff line Loading @@ -3230,12 +3230,12 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D } @Override public void onRecentTaskRemoved(TaskRecord task, boolean wasTrimmed) { public void onRecentTaskRemoved(TaskRecord task, boolean wasTrimmed, boolean killProcess) { if (wasTrimmed) { // Task was trimmed from the recent tasks list -- remove the active task record as well // since the user won't really be able to go back to it removeTaskByIdLocked(task.taskId, false /* killProcess */, false /* removeFromRecents */, !PAUSE_IMMEDIATELY, "recent-task-trimmed"); removeTaskByIdLocked(task.taskId, killProcess, false /* removeFromRecents */, !PAUSE_IMMEDIATELY, "recent-task-trimmed"); } task.removedFromRecents(); } Loading
services/core/java/com/android/server/am/ActivityTaskManagerService.java +13 −0 Original line number Diff line number Diff line Loading @@ -1667,6 +1667,19 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } } @Override public void removeAllVisibleRecentTasks() { enforceCallerIsRecentsOrHasPermission(REMOVE_TASKS, "removeAllVisibleRecentTasks()"); synchronized (mGlobalLock) { final long ident = Binder.clearCallingIdentity(); try { getRecentTasks().removeAllVisibleTasks(); } finally { Binder.restoreCallingIdentity(ident); } } } @Override public boolean shouldUpRecreateTask(IBinder token, String destAffinity) { synchronized (mGlobalLock) { Loading