AI 143896: Fix issue #1748954 and #1737952:

#1748954 (New status bar fades into all white background): FrameLayout wasn't updating its foreground drawable when its padding changed, which would happen as the status bar is shown and hidden.  To fix this I also ended up fixing a problem in the view debug stuff where we couldn't get a bitmap for a view that is the full screen size because it is too big...  actually I just went ahead and added another function to snapshot the view hierarchy which works a lot better for us anyway.
  #1737952 (Home screen icons overlap with the notification bar after exiting any camera app): Originally I punted this because it only happened in rare situations, but now that home is always portrait it happens a lot more so it is more important to fix.  This involved a few things to clean up hiding/showing the status bar:
  - We now determine when to hide and show it during layout, which allows us to do this at the time it is actually needed rather than during animation after we can actually catch it for the initial display of a window.  This required tweaking the layout API so the policy can request a second layout pass if needed.
  - When doing layout, we are now much more aggressive about skipping the layout of windows.  Basically anything that we know will be hidden in the near future is ignored for layout, so that it doesn't glitch as it is transfered out of the screen.  The theory being that it is better to leave it as it was originally placed while we are transitioning it out, than to switch it to something slightly more correct.
  BUG=1748954,1737952

Automated import of CL 143896
This commit is contained in:
Dianne Hackborn
2009-03-31 17:58:46 -07:00
committed by The Android Open Source Project
parent a1d701ef2f
commit b378530714
5 changed files with 131 additions and 46 deletions

View File

@@ -7485,11 +7485,12 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo
final int dh = mDisplay.getHeight();
final int N = mWindows.size();
int repeats = 0;
int i;
// FIRST LOOP: Perform a layout, if needed.
if (mLayoutNeeded) {
while (mLayoutNeeded) {
mPolicy.beginLayoutLw(dw, dh);
// First perform layout of any root windows (not attached
@@ -7497,10 +7498,18 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo
int topAttached = -1;
for (i = N-1; i >= 0; i--) {
WindowState win = (WindowState) mWindows.get(i);
boolean gone = win.mViewVisibility == View.GONE
// Don't do layout of a window if it is not visible, or
// soon won't be visible, to avoid wasting time and funky
// changes while a window is animating away.
final AppWindowToken atoken = win.mAppToken;
final boolean gone = win.mViewVisibility == View.GONE
|| !win.mRelayoutCalled
|| win.mRootToken.hidden;
|| win.mRootToken.hidden
|| (atoken != null && atoken.hiddenRequested)
|| !win.mPolicyVisibility
|| win.mAttachedHidden
|| win.mExiting || win.mDestroying;
// If this view is GONE, then skip it -- keep the current
// frame, and let the caller know so they can ignore it
@@ -7536,8 +7545,14 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo
}
}
mPolicy.finishLayoutLw();
mLayoutNeeded = false;
if (!mPolicy.finishLayoutLw()) {
mLayoutNeeded = false;
} else if (repeats > 2) {
Log.w(TAG, "Layout repeat aborted after too many iterations");
mLayoutNeeded = false;
} else {
repeats++;
}
}
}