Only consider gone for layout if parent is gone for layout

If we check getParentWindowHidden, that determines mostly actual
visibility. However, we don't want that because we still would
like to follow the parent's window layout lifecycle, as otherwise
we may be stuck in a transition in case the parent window is
hidden but the child is waiting for a layout to happen.

Test: Click "Customize" on wallpaper picker, go back, ensure no
transition timeout
Fixes: 135976008

Change-Id: I66aeab29a81cd82b170aaf337249616b1f559848
This commit is contained in:
Jorim Jaggi
2019-07-16 17:43:15 +02:00
parent 2264e1ce5e
commit b52b0457e1

View File

@@ -1633,7 +1633,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|| !mRelayoutCalled
|| (atoken == null && mToken.isHidden())
|| (atoken != null && atoken.hiddenRequested)
|| isParentWindowHidden()
|| isParentWindowGoneForLayout()
|| (mAnimatingExit && !isAnimatingLw())
|| mDestroying;
}
@@ -3840,6 +3840,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
return parent != null && parent.mHidden;
}
private boolean isParentWindowGoneForLayout() {
final WindowState parent = getParentWindow();
return parent != null && parent.isGoneForLayoutLw();
}
void setWillReplaceWindow(boolean animate) {
for (int i = mChildren.size() - 1; i >= 0; i--) {
final WindowState c = mChildren.get(i);