Fix window disappearing when docking a second app

When moving app1 to docked stack, the app2 is resized while in background
(fullscreen stack). Because of the config change, mWillReplaceWindow is 
marked true. But since the app2 is in GONE state, all updates of mFrame
are skipped. When it's made visible again, because mWillReplaceWindow is
set, update of mFrame in computeFrameLw() is still skipped, resulting in
wrong mFrame being used.

The fix here is to not set mWillReplaceWindow if the app is not visible,
as we don't need to preserve old window.

Also fix position change check.

bug: 25937471
Change-Id: Iea506296ebd5c2a108368fb2d1d77cdc31a36cdc
This commit is contained in:
Chong Zhang
2015-12-03 15:36:21 -08:00
parent ac7579a6e5
commit 48a87a5426
2 changed files with 2 additions and 2 deletions

View File

@@ -252,7 +252,7 @@ class Task implements DimLayer.DimLayerUser {
}
int boundsChange = BOUNDS_CHANGE_NONE;
if (mBounds.left != bounds.left || mBounds.right != bounds.right) {
if (mBounds.left != bounds.left || mBounds.top != bounds.top) {
boundsChange |= BOUNDS_CHANGE_POSITION;
}
if (mBounds.width() != bounds.width() || mBounds.height() != bounds.height()) {

View File

@@ -10185,7 +10185,7 @@ public class WindowManagerService extends IWindowManager.Stub
public void setReplacingWindow(IBinder token, boolean animate) {
synchronized (mWindowMap) {
AppWindowToken appWindowToken = findAppWindowToken(token);
if (appWindowToken == null) {
if (appWindowToken == null || !appWindowToken.isVisible()) {
Slog.w(TAG, "Attempted to set replacing window on non-existing app token " + token);
return;
}