From 950ee77fc729526f91646f44616e1e62d9eef076 Mon Sep 17 00:00:00 2001 From: tiger_huang Date: Fri, 11 Jul 2014 18:41:48 +0800 Subject: [PATCH] Remove the window whose client process has died or become zombie Window Manager Service would fail to report window-resized to the process which has become zombie. This would cause the window to freeze screen continuously. In this case, we assume the process has died and remove its window to recycle resources and to prevent it from freezing the screen. Change-Id: Ic7384731bf9a1fa8b9602d4f1dbee7492db126c5 --- services/core/java/com/android/server/wm/WindowState.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index b4a7f04272d9a..d884efa38191b 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -1407,6 +1407,11 @@ final class WindowState implements WindowManagerPolicy.WindowState { mOrientationChanging = false; mLastFreezeDuration = (int)(SystemClock.elapsedRealtime() - mService.mDisplayFreezeTime); + // We are assuming the hosting process is dead or in a zombie state. + Slog.w(TAG, "Failed to report 'resized' to the client of " + this + + ", removing this window."); + mService.mPendingRemove.add(this); + mService.requestTraversalLocked(); } }