From 39f7068ed903f747d6885117dc1bac69f626ae91 Mon Sep 17 00:00:00 2001 From: Koji Fukui Date: Fri, 14 Mar 2014 21:20:21 +0900 Subject: Don't wait for finishing animation when second display is disconnected Basically WindowManagerService wait for finishing animation when a window is removed. But when second display is disconnected, windows on second display can't be shown even if animation is waited for. On the contrary, it keeps on waiting for finishing the animation in special case. With this fix windows are immediately removed without waiting for animation when second display is disconnected. Change-Id: I1354c193c04db394a21a11c174e10c8e7da17a0e --- services/java/com/android/server/wm/WindowManagerService.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'services/java') diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 2ab7e36..b6c6770 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -2373,6 +2373,11 @@ public class WindowManagerService extends IWindowManager.Stub } public void removeWindowLocked(Session session, WindowState win) { + removeWindowLocked(session, win, false); + } + + private void removeWindowLocked(Session session, WindowState win, + boolean forceRemove) { if (win.mAttrs.type == TYPE_APPLICATION_STARTING) { if (DEBUG_STARTING_WINDOW) Slog.d(TAG, "Starting window removed " + win); removeStartingWindowTimeout(win.mAppToken); @@ -2423,7 +2428,7 @@ public class WindowManagerService extends IWindowManager.Stub mDisplayMagnifier.onWindowTransitionLocked(win, transit); } } - if (win.mExiting || win.mWinAnimator.isAnimating()) { + if (!forceRemove && (win.mExiting || win.mWinAnimator.isAnimating())) { // The exit animation is running... wait for it! //Slog.i(TAG, "*** Running exit animation..."); win.mExiting = true; @@ -10852,7 +10857,7 @@ public class WindowManagerService extends IWindowManager.Stub WindowList windows = displayContent.getWindowList(); while (!windows.isEmpty()) { final WindowState win = windows.get(windows.size() - 1); - removeWindowLocked(win.mSession, win); + removeWindowLocked(win.mSession, win, true); } } mAnimator.removeDisplayLocked(displayId); -- cgit v1.1