Skip to content

Commit 08cec4e

Browse files
Dianne HackbornAndroid Git Automerger
authored andcommitted
am a585359: am 4716368: Merge "Another attempt at issue #5823276: home repaints after full-screen app is exited" into ics-mr1
* commit 'a5853595165a6395ca41bbc17a3dd88e12259ad1': Another attempt at issue #5823276: home repaints after full-screen app is exited
2 parents 8c190f7 + a585359 commit 08cec4e

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

services/java/com/android/server/wm/WindowManagerService.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2543,8 +2543,12 @@ public int relayoutWindow(Session session, IWindow client, int seq,
25432543
if (win == null) {
25442544
return 0;
25452545
}
2546-
win.mRequestedWidth = requestedWidth;
2547-
win.mRequestedHeight = requestedHeight;
2546+
if (win.mRequestedWidth != requestedWidth
2547+
|| win.mRequestedHeight != requestedHeight) {
2548+
win.mLayoutNeeded = true;
2549+
win.mRequestedWidth = requestedWidth;
2550+
win.mRequestedHeight = requestedHeight;
2551+
}
25482552
if (attrs != null && seq == win.mSeq) {
25492553
win.mSystemUiVisibility = systemUiVisibility;
25502554
}
@@ -2565,6 +2569,9 @@ public int relayoutWindow(Session session, IWindow client, int seq,
25652569
}
25662570
flagChanges = win.mAttrs.flags ^= attrs.flags;
25672571
attrChanges = win.mAttrs.copyFrom(attrs);
2572+
if ((attrChanges&WindowManager.LayoutParams.LAYOUT_CHANGED) != 0) {
2573+
win.mLayoutNeeded = true;
2574+
}
25682575
}
25692576

25702577
if (DEBUG_LAYOUT) Slog.v(TAG, "Relayout " + win + ": " + win.mAttrs);
@@ -7460,12 +7467,13 @@ private final int performLayoutLockedInner(boolean initial, boolean updateInputW
74607467
// if they want. (We do the normal layout for INVISIBLE
74617468
// windows, since that means "perform layout as normal,
74627469
// just don't display").
7463-
if (!gone || !win.mHaveFrame) {
7470+
if (!gone || !win.mHaveFrame || win.mLayoutNeeded) {
74647471
if (!win.mLayoutAttached) {
74657472
if (initial) {
74667473
//Slog.i(TAG, "Window " + this + " clearing mContentChanged - initial");
74677474
win.mContentChanged = false;
74687475
}
7476+
win.mLayoutNeeded = false;
74697477
win.prelayout();
74707478
mPolicy.layoutWindowLw(win, win.mAttrs, null);
74717479
win.mLayoutSeq = seq;
@@ -7497,11 +7505,12 @@ private final int performLayoutLockedInner(boolean initial, boolean updateInputW
74977505
// windows, since that means "perform layout as normal,
74987506
// just don't display").
74997507
if ((win.mViewVisibility != View.GONE && win.mRelayoutCalled)
7500-
|| !win.mHaveFrame) {
7508+
|| !win.mHaveFrame || win.mLayoutNeeded) {
75017509
if (initial) {
75027510
//Slog.i(TAG, "Window " + this + " clearing mContentChanged - initial");
75037511
win.mContentChanged = false;
75047512
}
7513+
win.mLayoutNeeded = false;
75057514
win.prelayout();
75067515
mPolicy.layoutWindowLw(win, win.mAttrs, win.mAttachedWindow);
75077516
win.mLayoutSeq = seq;

services/java/com/android/server/wm/WindowState.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,12 @@ final class WindowState implements WindowManagerPolicy.WindowState {
238238
// we can give the window focus before waiting for the relayout.
239239
boolean mRelayoutCalled;
240240

241+
// If the application has called relayout() with changes that can
242+
// impact its window's size, we need to perform a layout pass on it
243+
// even if it is not currently visible for layout. This is set
244+
// when in that case until the layout is done.
245+
boolean mLayoutNeeded;
246+
241247
// This is set after the Surface has been created but before the
242248
// window has been drawn. During this time the surface is hidden.
243249
boolean mDrawPending;
@@ -1449,7 +1455,7 @@ public boolean isGoneForLayoutLw() {
14491455
return mViewVisibility == View.GONE
14501456
|| !mRelayoutCalled
14511457
|| (atoken == null && mRootToken.hidden)
1452-
|| (atoken != null && atoken.hiddenRequested)
1458+
|| (atoken != null && (atoken.hiddenRequested || atoken.hidden))
14531459
|| mAttachedHidden
14541460
|| mExiting || mDestroying;
14551461
}
@@ -1728,8 +1734,9 @@ void dump(PrintWriter pw, String prefix, boolean dumpAll) {
17281734
pw.print(mPolicyVisibilityAfterAnim);
17291735
pw.print(" mAttachedHidden="); pw.println(mAttachedHidden);
17301736
}
1731-
if (!mRelayoutCalled) {
1732-
pw.print(prefix); pw.print("mRelayoutCalled="); pw.println(mRelayoutCalled);
1737+
if (!mRelayoutCalled || mLayoutNeeded) {
1738+
pw.print(prefix); pw.print("mRelayoutCalled="); pw.print(mRelayoutCalled);
1739+
pw.print(" mLayoutNeeded="); pw.println(mLayoutNeeded);
17331740
}
17341741
if (mSurfaceResized || mSurfaceDestroyDeferred) {
17351742
pw.print(prefix); pw.print("mSurfaceResized="); pw.print(mSurfaceResized);

0 commit comments

Comments
 (0)