am 1bae8066: Merge "Fix issue #5823276 again: home repaints after full-screen app is exited" into ics-mr1

* commit '1bae80668cc1d12bb4a4b93bce1960b2601de131':
  Fix issue #5823276 again: home repaints after full-screen app is exited
This commit is contained in:
Dianne Hackborn
2012-01-20 12:03:47 -08:00
committed by Android Git Automerger
4 changed files with 36 additions and 17 deletions

View File

@ -297,6 +297,11 @@ public interface WindowManagerPolicy {
*/ */
boolean isDisplayedLw(); boolean isDisplayedLw();
/**
* Is this window considered to be gone for purposes of layout?
*/
boolean isGoneForLayoutLw();
/** /**
* Returns true if this window has been shown on screen at some time in * Returns true if this window has been shown on screen at some time in
* the past. Must be called with the window manager lock held. * the past. Must be called with the window manager lock held.

View File

@ -2336,7 +2336,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
if (DEBUG_LAYOUT) Slog.i(TAG, "Win " + win + ": isVisibleOrBehindKeyguardLw=" if (DEBUG_LAYOUT) Slog.i(TAG, "Win " + win + ": isVisibleOrBehindKeyguardLw="
+ win.isVisibleOrBehindKeyguardLw()); + win.isVisibleOrBehindKeyguardLw());
if (mTopFullscreenOpaqueWindowState == null && if (mTopFullscreenOpaqueWindowState == null &&
win.isVisibleOrBehindKeyguardLw()) { win.isVisibleOrBehindKeyguardLw() && !win.isGoneForLayoutLw()) {
if ((attrs.flags & FLAG_FORCE_NOT_FULLSCREEN) != 0) { if ((attrs.flags & FLAG_FORCE_NOT_FULLSCREEN) != 0) {
mForceStatusBar = true; mForceStatusBar = true;
} }
@ -2391,7 +2391,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// case though. // case though.
if (topIsFullscreen) { if (topIsFullscreen) {
if (mStatusBarCanHide) { if (mStatusBarCanHide) {
if (DEBUG_LAYOUT) Log.v(TAG, "Hiding status bar"); if (DEBUG_LAYOUT) Log.v(TAG, "** HIDING status bar");
if (mStatusBar.hideLw(true)) { if (mStatusBar.hideLw(true)) {
changes |= FINISH_LAYOUT_REDO_LAYOUT; changes |= FINISH_LAYOUT_REDO_LAYOUT;
@ -2407,7 +2407,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
Log.v(TAG, "Preventing status bar from hiding by policy"); Log.v(TAG, "Preventing status bar from hiding by policy");
} }
} else { } else {
if (DEBUG_LAYOUT) Log.v(TAG, "Showing status bar: top is not fullscreen"); if (DEBUG_LAYOUT) Log.v(TAG, "** SHOWING status bar: top is not fullscreen");
if (mStatusBar.showLw(true)) changes |= FINISH_LAYOUT_REDO_LAYOUT; if (mStatusBar.showLw(true)) changes |= FINISH_LAYOUT_REDO_LAYOUT;
} }
} }

View File

@ -7391,8 +7391,11 @@ public class WindowManagerService extends IWindowManager.Stub
final int N = mWindows.size(); final int N = mWindows.size();
int i; int i;
if (DEBUG_LAYOUT) Slog.v(TAG, "performLayout: needed=" if (DEBUG_LAYOUT) {
+ mLayoutNeeded + " dw=" + dw + " dh=" + dh); Slog.v(TAG, "-------------------------------------");
Slog.v(TAG, "performLayout: needed="
+ mLayoutNeeded + " dw=" + dw + " dh=" + dh);
}
mPolicy.beginLayoutLw(dw, dh, mRotation); mPolicy.beginLayoutLw(dw, dh, mRotation);
@ -7409,19 +7412,20 @@ public class WindowManagerService extends IWindowManager.Stub
// Don't do layout of a window if it is not visible, or // Don't do layout of a window if it is not visible, or
// soon won't be visible, to avoid wasting time and funky // soon won't be visible, to avoid wasting time and funky
// changes while a window is animating away. // changes while a window is animating away.
final AppWindowToken atoken = win.mAppToken; final boolean gone = win.isGoneForLayoutLw();
final boolean gone = win.mViewVisibility == View.GONE
|| !win.mRelayoutCalled
|| (atoken == null && win.mRootToken.hidden)
|| (atoken != null && atoken.hiddenRequested)
|| win.mAttachedHidden
|| win.mExiting || win.mDestroying;
if (DEBUG_LAYOUT && !win.mLayoutAttached) { if (DEBUG_LAYOUT && !win.mLayoutAttached) {
Slog.v(TAG, "First pass " + win Slog.v(TAG, "1ST PASS " + win
+ ": gone=" + gone + " mHaveFrame=" + win.mHaveFrame + ": gone=" + gone + " mHaveFrame=" + win.mHaveFrame
+ " mLayoutAttached=" + win.mLayoutAttached); + " mLayoutAttached=" + win.mLayoutAttached);
if (gone) Slog.v(TAG, " (mViewVisibility=" final AppWindowToken atoken = win.mAppToken;
if (gone) Slog.v(TAG, " GONE: mViewVisibility="
+ win.mViewVisibility + " mRelayoutCalled="
+ win.mRelayoutCalled + " hidden="
+ win.mRootToken.hidden + " hiddenRequested="
+ (atoken != null && atoken.hiddenRequested)
+ " mAttachedHidden=" + win.mAttachedHidden);
else Slog.v(TAG, " VIS: mViewVisibility="
+ win.mViewVisibility + " mRelayoutCalled=" + win.mViewVisibility + " mRelayoutCalled="
+ win.mRelayoutCalled + " hidden=" + win.mRelayoutCalled + " hidden="
+ win.mRootToken.hidden + " hiddenRequested=" + win.mRootToken.hidden + " hiddenRequested="
@ -7443,7 +7447,7 @@ public class WindowManagerService extends IWindowManager.Stub
win.prelayout(); win.prelayout();
mPolicy.layoutWindowLw(win, win.mAttrs, null); mPolicy.layoutWindowLw(win, win.mAttrs, null);
win.mLayoutSeq = seq; win.mLayoutSeq = seq;
if (DEBUG_LAYOUT) Slog.v(TAG, "-> mFrame=" if (DEBUG_LAYOUT) Slog.v(TAG, " LAYOUT: mFrame="
+ win.mFrame + " mContainingFrame=" + win.mFrame + " mContainingFrame="
+ win.mContainingFrame + " mDisplayFrame=" + win.mContainingFrame + " mDisplayFrame="
+ win.mDisplayFrame); + win.mDisplayFrame);
@ -7461,7 +7465,7 @@ public class WindowManagerService extends IWindowManager.Stub
WindowState win = mWindows.get(i); WindowState win = mWindows.get(i);
if (win.mLayoutAttached) { if (win.mLayoutAttached) {
if (DEBUG_LAYOUT) Slog.v(TAG, "Second pass " + win if (DEBUG_LAYOUT) Slog.v(TAG, "2ND PASS " + win
+ " mHaveFrame=" + win.mHaveFrame + " mHaveFrame=" + win.mHaveFrame
+ " mViewVisibility=" + win.mViewVisibility + " mViewVisibility=" + win.mViewVisibility
+ " mRelayoutCalled=" + win.mRelayoutCalled); + " mRelayoutCalled=" + win.mRelayoutCalled);
@ -7479,7 +7483,7 @@ public class WindowManagerService extends IWindowManager.Stub
win.prelayout(); win.prelayout();
mPolicy.layoutWindowLw(win, win.mAttrs, win.mAttachedWindow); mPolicy.layoutWindowLw(win, win.mAttrs, win.mAttachedWindow);
win.mLayoutSeq = seq; win.mLayoutSeq = seq;
if (DEBUG_LAYOUT) Slog.v(TAG, "-> mFrame=" if (DEBUG_LAYOUT) Slog.v(TAG, " LAYOUT: mFrame="
+ win.mFrame + " mContainingFrame=" + win.mFrame + " mContainingFrame="
+ win.mContainingFrame + " mDisplayFrame=" + win.mContainingFrame + " mDisplayFrame="
+ win.mDisplayFrame); + win.mDisplayFrame);

View File

@ -1444,6 +1444,16 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|| mAnimating); || mAnimating);
} }
public boolean isGoneForLayoutLw() {
final AppWindowToken atoken = mAppToken;
return mViewVisibility == View.GONE
|| !mRelayoutCalled
|| (atoken == null && mRootToken.hidden)
|| (atoken != null && atoken.hiddenRequested)
|| mAttachedHidden
|| mExiting || mDestroying;
}
/** /**
* Returns true if the window has a surface that it has drawn a * Returns true if the window has a surface that it has drawn a
* complete UI in to. * complete UI in to.