Merge "Disabling affiliated tasks." into nyc-dev

This commit is contained in:
Winson Chung
2016-03-24 19:10:47 +00:00
committed by Android (Google) Code Review
3 changed files with 18 additions and 10 deletions

View File

@@ -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

View File

@@ -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) {

View File

@@ -429,12 +429,14 @@ public class TaskStack {
mStackTaskList.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
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;