Do not gate updating allDrawn on all child WindowStates.

A recent change prevents allDrawn in AppWindowToken from being
updated until all child WindowStates have been considered. However,
children that are not visible do not affect allDrawn and therefore
need to be excluded.

This changelist adds an additional check to make sure the child can
affect the allDrawn state before considering blocking on it. It also
adds additional logs to the WindowState dump to better understand
this scenario.

Change-Id: I76d0f75496ed3da6a16c4a1d7bf2e7dc5b8bbe1e
Bug: 63380251
Test: go/wm-smoke
This commit is contained in:
Bryce Lee
2017-07-06 14:09:29 -07:00
parent 037503dfa0
commit 6311c4b2e1
2 changed files with 12 additions and 4 deletions

View File

@@ -1357,8 +1357,10 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
* @return {@code true} If all children have been considered, {@code false}.
*/
private boolean allDrawnStatesConsidered() {
for (WindowState child : mChildren) {
if (!child.getDrawnStatedEvaluated()) {
for (int i = mChildren.size() - 1; i >= 0; --i) {
final WindowState child = mChildren.get(i);
if (child.mightAffectAllDrawn(false /*visibleOnly*/ )
&& !child.getDrawnStateEvaluated()) {
return false;
}
}

View File

@@ -685,7 +685,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
/**
* Returns whether this {@link WindowState} has been considered for drawing by its parent.
*/
boolean getDrawnStatedEvaluated() {
boolean getDrawnStateEvaluated() {
return mDrawnStateEvaluated;
}
@@ -3344,7 +3344,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
pw.print(prefix); pw.print("mAppToken="); pw.println(mAppToken);
pw.print(prefix); pw.print(" isAnimatingWithSavedSurface()=");
pw.print(isAnimatingWithSavedSurface());
pw.print(" mAppDied=");pw.println(mAppDied);
pw.print(" mAppDied=");pw.print(mAppDied);
pw.print(prefix); pw.print("drawnStateEvaluated=");
pw.print(getDrawnStateEvaluated());
pw.print(prefix); pw.print("mightAffectAllDrawn=");
pw.println(mightAffectAllDrawn(false /*visibleOnly*/));
}
pw.print(prefix); pw.print("mViewVisibility=0x");
pw.print(Integer.toHexString(mViewVisibility));
@@ -3484,6 +3488,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
if (computeDragResizing()) {
pw.print(prefix); pw.println("computeDragResizing=" + computeDragResizing());
}
pw.print(prefix); pw.println("isOnScreen=" + isOnScreen());
pw.print(prefix); pw.println("isVisible=" + isVisible());
}
@Override