Do not go through a layout if visibility is GONE

An unnecessary layout based on dimensions changing catches up
with us later when the next layout doesn't occur.

In this case
we layed out the Settings panel because visibility changed from
visible to GONE and the requested width/height didn't match the
current window width height. When the visibility changed back
to visible the dimensions matched and another layout was not
performed.

This fix delays the layout until the window becomes visible again.

Fixes bug 17681754.

Change-Id: I0a3ff9479dca93e78c5d3a3df40faceffc10ecbd
This commit is contained in:
Craig Mautner
2014-10-23 13:16:53 -07:00
parent a9a550dd8e
commit fa3515bd0d

View File

@@ -2980,8 +2980,8 @@ public class WindowManagerService extends IWindowManager.Stub
return 0;
}
WindowStateAnimator winAnimator = win.mWinAnimator;
if (win.mRequestedWidth != requestedWidth
|| win.mRequestedHeight != requestedHeight) {
if (viewVisibility != View.GONE && (win.mRequestedWidth != requestedWidth
|| win.mRequestedHeight != requestedHeight)) {
win.mLayoutNeeded = true;
win.mRequestedWidth = requestedWidth;
win.mRequestedHeight = requestedHeight;