Fix some issues found in AM display tests
- Updated launch task compute code to avoid unsupported
displays.
- Throw exception when activity landed on unexpected
display.
- Compute display config in WM immediately after creation.
- Fix incorrect target stack value when activity was moved.
Bug: 70562864
Bug: 70563248
Bug: 70564344
Bug: 68952184
Bug: 69916363
Bug: 69916120
Test: ActivityManagerDisplayTests
Change-Id: Id860f77ea49e016f028b44f5512dff37f0758590
diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java
index dabcbcd..0ffc6b8 100644
--- a/services/core/java/com/android/server/am/TaskRecord.java
+++ b/services/core/java/com/android/server/am/TaskRecord.java
@@ -623,6 +623,9 @@
if (toStack == sourceStack) {
return false;
}
+ if (!canBeLaunchedOnDisplay(toStack.mDisplayId)) {
+ return false;
+ }
final int toStackWindowingMode = toStack.getWindowingMode();
final ActivityRecord topActivity = getTopActivity();