Prevent premature window replacement.

maybeRemoveReplacedWindows is called when any window
has reported drawing, we have to verify that we have
actually ourselves drawn, before commencing the replacement.

Bug: 26668339
Change-Id: Iabfc2e813989381f9f20f3bb111100911405686b
This commit is contained in:
Robert Carr
2016-04-07 22:59:24 -07:00
parent b439a63fdf
commit dcdca58cd5

View File

@@ -1573,7 +1573,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
}
for (int i = mAppToken.allAppWindows.size() - 1; i >= 0; i--) {
final WindowState win = mAppToken.allAppWindows.get(i);
if (win.mWillReplaceWindow && win.mReplacingWindow == this) {
if (win.mWillReplaceWindow && win.mReplacingWindow == this && hasDrawnLw()) {
if (DEBUG_ADD_REMOVE) Slog.d(TAG, "Removing replaced window: " + win);
win.mWillReplaceWindow = false;
win.mAnimateReplacingWindow = false;