diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsDebugFlags.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsDebugFlags.java index f67f099c23a5e..043510ed72ca3 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsDebugFlags.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsDebugFlags.java @@ -34,7 +34,7 @@ public class RecentsDebugFlags implements TunerService.Tunable { // This disables the bitmap and icon caches public static final boolean DisableBackgroundCache = false; // Enables the task affiliations - public static final boolean EnableAffiliatedTaskGroups = true; + public static final boolean EnableAffiliatedTaskGroups = false; // TODO: To be repurposed public static final boolean EnableStackActionButton = false; // Overrides the Tuner flags and enables the timeout diff --git a/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoadPlan.java b/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoadPlan.java index c863471445236..ff42893cde817 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoadPlan.java +++ b/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoadPlan.java @@ -160,8 +160,15 @@ public class RecentsTaskLoadPlan { long parentTaskLastActiveTime = parentTask != null ? parentTask.lastActiveTime : prevLastActiveTime; - t.lastActiveTime = parentTaskLastActiveTime + - affiliatedTaskCounts.get(t.affiliatedTaskId, 0) + 1; + if (RecentsDebugFlags.Static.EnableAffiliatedTaskGroups) { + t.lastActiveTime = parentTaskLastActiveTime + + affiliatedTaskCounts.get(t.affiliatedTaskId, 0) + 1; + } else { + if (t.lastActiveTime == 0) { + t.lastActiveTime = parentTaskLastActiveTime - + affiliatedTaskCounts.get(t.affiliatedTaskId, 0) - 1; + } + } } // Compose the task key @@ -201,7 +208,6 @@ public class RecentsTaskLoadPlan { allTasks.add(task); affiliatedTaskCounts.put(taskKey.id, affiliatedTaskCounts.get(taskKey.id, 0) + 1); affiliatedTasks.put(taskKey.id, taskKey); - prevLastActiveTime = t.lastActiveTime; } if (newLastStackActiveTime != -1) { 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 930e2d02b1c50..a9307913fb511 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/model/TaskStack.java +++ b/packages/SystemUI/src/com/android/systemui/recents/model/TaskStack.java @@ -429,12 +429,14 @@ public class TaskStack { mStackTaskList.setFilter(new TaskFilter() { @Override public boolean acceptTask(SparseArray 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 - Task parentTask = taskIdMap.get(t.affiliationTaskId); - if (parentTask != null) { - t = parentTask; + if (RecentsDebugFlags.Static.EnableAffiliatedTaskGroups) { + 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 + Task parentTask = taskIdMap.get(t.affiliationTaskId); + if (parentTask != null) { + t = parentTask; + } } } return t.isStackTask;