Tweak test for layout.

Return to old way of only laying out Keyguard on configuration change
and add a new qualifier that does a layout if a window is part of an
opening app. This qualifier allows apps that handle their own
configuration changes to be notified of screen changes after the
configuration has changed. Apps that do not handle their own
configuration changes find their way into this code because their
surfaces are recreated by default and mHaveFrame is false.

This fixes bug 11544694 and passes the test of all bugs listed in CL
ag/383579.

Change-Id: I3a679b27eb4a2c5210957bcd4ae2f10b46f6e076
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index a645c01..e1e9f5c 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -8269,7 +8269,8 @@
             // windows, since that means "perform layout as normal,
             // just don't display").
             if (!gone || !win.mHaveFrame || win.mLayoutNeeded
-                    || win.isConfigChanged()
+                    || win.mAttrs.type == TYPE_KEYGUARD && win.isConfigChanged()
+                    || mOpeningApps.contains(win.mAppToken)
                     || win.mAttrs.type == TYPE_UNIVERSE_BACKGROUND) {
                 if (!win.mLayoutAttached) {
                     if (initial) {