Fix restoring surface for child windows
Use allAppWindows instead of windows, as windows doesn't contain
any child windows, it causes the child windows to be not restored
until the child window does relayout.
bug: 28296945
Change-Id: I7d272e660752002c08349128c3958aa041979c34
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index 3b1f34a..b4ead44 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -390,8 +390,8 @@
}
boolean hasSavedSurface() {
- for (int i = windows.size() -1; i >= 0; i--) {
- final WindowState ws = windows.get(i);
+ for (int i = allAppWindows.size() -1; i >= 0; i--) {
+ final WindowState ws = allAppWindows.get(i);
if (ws.hasSavedSurface()) {
return true;
}
@@ -408,8 +408,8 @@
// Check if we have enough drawn windows to mark allDrawn= true.
int numInteresting = 0;
int numDrawn = 0;
- for (int i = windows.size() - 1; i >= 0; i--) {
- WindowState w = windows.get(i);
+ for (int i = allAppWindows.size() - 1; i >= 0; i--) {
+ WindowState w = allAppWindows.get(i);
if (w.hasSavedSurface()) {
w.restoreSavedSurface();
}
@@ -429,8 +429,8 @@
}
void destroySavedSurfaces() {
- for (int i = windows.size() - 1; i >= 0; i--) {
- WindowState win = windows.get(i);
+ for (int i = allAppWindows.size() - 1; i >= 0; i--) {
+ WindowState win = allAppWindows.get(i);
win.destroySavedSurface();
}
mAnimatingWithSavedSurface = false;