Don't set replacing flag in starting windows.

When ever an app is changing stacks we set replacing flag on all it's
windows. Starting windows can be part of an apps window list, but is
added by window manager not the app. So, when we set replacing flag
on the starting window it can cause the starting window never to be
cleaned up since we are expecting the client to replace it which will
never happen since it was added by window manager.
We shouldn't be setting replacing flag on starting windows since they
can never be replaced.

Bug: 26294740
Change-Id: I0a4f1e44188e96e73614130cbea02a3860850f58
This commit is contained in:
Wale Ogunwale
2016-01-05 10:43:25 -08:00
parent 812a806c4d
commit 6d8e06bad4

View File

@@ -2352,10 +2352,15 @@ final class WindowState implements WindowManagerPolicy.WindowState {
}
void setReplacing(boolean animate) {
if ((mAttrs.privateFlags & PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH) == 0) {
mWillReplaceWindow = true;
mReplacingWindow = null;
mAnimateReplacingWindow = animate;
if ((mAttrs.privateFlags & PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH) != 0
|| mAttrs.type == TYPE_APPLICATION_STARTING) {
// We don't set replacing on starting windows since they are added by window manager and
// not the client so won't be replaced by the client.
return;
}
mWillReplaceWindow = true;
mReplacingWindow = null;
mAnimateReplacingWindow = animate;
}
}