Add extra layout pass after draw finished.

Once content has been drawn another pass through layout is required
to set mHasContent in the LogicalDisplay. Previously this pass was
occuring because of a delayed animation step. When timing of that
step changed that pass occurred before the draw completed. This is
why Presentations were immediately displayed in jb-mr1 and not
jb-mr2.

Fixes bug 10154780.

Change-Id: I0075c5a73d5cdf972e73fdd59c1fde46df64e245
diff --git a/services/java/com/android/server/wm/WindowStateAnimator.java b/services/java/com/android/server/wm/WindowStateAnimator.java
index 6fa9cd0..73325cb 100644
--- a/services/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/java/com/android/server/wm/WindowStateAnimator.java
@@ -1272,6 +1272,11 @@
                             if (mIsWallpaper) {
                                 mService.dispatchWallpaperVisibility(w, true);
                             }
+                            // This draw means the difference between unique content and mirroring.
+                            // Run another pass through performLayout to set mHasContent in the
+                            // LogicalDisplay.
+                            mAnimator.setPendingLayoutChanges(w.getDisplayId(),
+                                    WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM);
                         } else {
                             w.mOrientationChanging = false;
                         }