diff options
| author | 2015-12-18 10:03:12 -0500 | |
|---|---|---|
| committer | 2015-12-18 10:05:13 -0500 | |
| commit | 0583d3d18812d31d50228a6f29cb15b3219c9e94 (patch) | |
| tree | f3b0d26824ee2721e6cdd777ca1ea75be6c2d766 | |
| parent | 87af9a03f19c5e8eb8d4aec53c320e029c873e0c (diff) | |
Hiding pinned stack tasks from overview
Bug: 25381158
Change-Id: Iad442b7f5dc49109529cb5dab2168b19837af6e3
5 files changed, 42 insertions, 6 deletions
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java index 681ed5b70688..8637dde109d7 100644 --- a/core/java/android/app/ActivityManager.java +++ b/core/java/android/app/ActivityManager.java @@ -1237,6 +1237,18 @@ public class ActivityManager { public static final int RECENT_IGNORE_HOME_STACK_TASKS = 0x0008; /** + * Ignores all tasks that are on the docked stack. + * @hide + */ + public static final int RECENT_INGORE_DOCKED_STACK_TASKS = 0x0010; + + /** + * Ignores all tasks that are on the pinned stack. + * @hide + */ + public static final int RECENT_INGORE_PINNED_STACK_TASKS = 0x0020; + + /** * <p></p>Return a list of the tasks that the user has recently launched, with * the most recent being first and older ones after in order. * diff --git a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java index 6a9268a803d6..35e53f69a151 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +++ b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java @@ -194,6 +194,8 @@ public class SystemServicesProxy { int numTasksToQuery = Math.max(minNumTasksToQuery, numLatestTasks); List<ActivityManager.RecentTaskInfo> tasks = mAm.getRecentTasksForUser(numTasksToQuery, ActivityManager.RECENT_IGNORE_HOME_STACK_TASKS | + ActivityManager.RECENT_INGORE_DOCKED_STACK_TASKS | + ActivityManager.RECENT_INGORE_PINNED_STACK_TASKS | ActivityManager.RECENT_IGNORE_UNAVAILABLE | ActivityManager.RECENT_INCLUDE_PROFILES | ActivityManager.RECENT_WITH_EXCLUDED, userId); diff --git a/packages/SystemUI/src/com/android/systemui/recents/model/TaskStack.java b/packages/SystemUI/src/com/android/systemui/recents/model/TaskStack.java index d06012e90819..6f003ab63282 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/model/TaskStack.java +++ b/packages/SystemUI/src/com/android/systemui/recents/model/TaskStack.java @@ -352,28 +352,28 @@ public class TaskStack { @Override public boolean acceptTask(SparseArray<Task> taskIdMap, Task t, int index) { if (t.isAffiliatedTask()) { - // If this task is affiliated with another parent in the stack, then the historical state of this - // task depends on the state of the parent task + // If this task is affiliated with another parent in the stack, then the + // historical state of this task depends on the state of the parent task Task parentTask = taskIdMap.get(t.affiliationTaskId); if (parentTask != null) { t = parentTask; } } - return !t.isHistorical && !SystemServicesProxy.isDockedStack(t.key.stackId); + return !t.isHistorical; } }); mHistoryTaskList.setFilter(new TaskFilter() { @Override public boolean acceptTask(SparseArray<Task> taskIdMap, Task t, int index) { if (t.isAffiliatedTask()) { - // If this task is affiliated with another parent in the stack, then the historical state of this - // task depends on the state of the parent task + // If this task is affiliated with another parent in the stack, then the + // historical state of this task depends on the state of the parent task Task parentTask = taskIdMap.get(t.affiliationTaskId); if (parentTask != null) { t = parentTask; } } - return t.isHistorical && !SystemServicesProxy.isDockedStack(t.key.stackId); + return t.isHistorical; } }); } diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 1d555c6491ab..e1c82569f6a4 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -8768,6 +8768,20 @@ public final class ActivityManagerService extends ActivityManagerNative continue; } } + if ((flags & ActivityManager.RECENT_INGORE_DOCKED_STACK_TASKS) != 0) { + if (tr.stack != null && tr.stack.isDockedStack()) { + if (DEBUG_RECENTS) Slog.d(TAG_RECENTS, + "Skipping, docked stack task: " + tr); + continue; + } + } + if ((flags & ActivityManager.RECENT_INGORE_PINNED_STACK_TASKS) != 0) { + if (tr.stack != null && tr.stack.isPinnedStack()) { + if (DEBUG_RECENTS) Slog.d(TAG_RECENTS, + "Skipping, pinned stack task: " + tr); + continue; + } + } if (tr.autoRemoveRecents && tr.getTopActivity() == null) { // Don't include auto remove tasks that are finished or finishing. if (DEBUG_RECENTS) Slog.d(TAG_RECENTS, diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index 59acccd33937..582a1fe58aee 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -520,6 +520,14 @@ final class ActivityStack { return mStackId == HOME_STACK_ID; } + final boolean isDockedStack() { + return mStackId == DOCKED_STACK_ID; + } + + final boolean isPinnedStack() { + return mStackId == PINNED_STACK_ID; + } + final boolean isOnHomeDisplay() { return isAttached() && mActivityContainer.mActivityDisplay.mDisplayId == Display.DEFAULT_DISPLAY; |