Migrate AppWindowToken lists into DisplayContent.
In preparation for converting ActivityManager control to a task-based
interface the AppWindowTokens are being stored per-display.
Change-Id: Ie5e355219554523f5e56eaef138d382975cf1682
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index de9dda4..2c8a698 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -22,6 +22,7 @@
import com.android.internal.app.HeavyWeightSwitcherActivity;
import com.android.internal.os.BatteryStatsImpl;
import com.android.server.am.ActivityManagerService.PendingActivityLaunch;
+import com.android.server.am.ActivityRecord.Token;
import com.android.server.wm.AppTransition;
import android.app.Activity;
@@ -157,7 +158,7 @@
/**
* Used for validating app tokens with window manager.
*/
- final ArrayList<IBinder> mValidateAppTokens = new ArrayList<IBinder>();
+ final ArrayList<TaskGroup> mValidateAppTokens = new ArrayList<TaskGroup>();
/**
* List of running activities, sorted by recent usage.
@@ -1959,8 +1960,17 @@
final void validateAppTokensLocked() {
mValidateAppTokens.clear();
mValidateAppTokens.ensureCapacity(mHistory.size());
+ int taskId = Integer.MIN_VALUE;
+ TaskGroup task = null;
for (int i=0; i<mHistory.size(); i++) {
- mValidateAppTokens.add(mHistory.get(i).appToken);
+ final ActivityRecord r = mHistory.get(i);
+ if (taskId != r.task.taskId) {
+ taskId = r.task.taskId;
+ task = new TaskGroup();
+ task.taskId = taskId;
+ mValidateAppTokens.add(task);
+ }
+ task.tokens.add(r.appToken);
}
mService.mWindowManager.validateAppTokens(mValidateAppTokens);
}