From 2624fbcaaa74b3a6d8d60d22d9e16ef26a98a6b2 Mon Sep 17 00:00:00 2001 From: Christopher Tate Date: Fri, 11 Dec 2009 12:11:31 -0800 Subject: Fix #2320798: Device hang then runtime restart The system_server process is deadlocking between event dispatch and window manager code. This change fixes the lock scoping to eliminate the deadlock. Change-Id: I00f029e4d51d7432119ad3aeec260df215b52546 --- .../java/com/android/server/WindowManagerService.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java index f05cdc488733..aab37b9e9fbb 100644 --- a/services/java/com/android/server/WindowManagerService.java +++ b/services/java/com/android/server/WindowManagerService.java @@ -6011,18 +6011,18 @@ public class WindowManagerService extends IWindowManager.Stub res.offsetLocation(-win.mFrame.left, -win.mFrame.top); } } - - if (res != null && returnWhat == RETURN_PENDING_POINTER) { - synchronized (mWindowMap) { - if ((mWallpaperTarget == win && - win.mAttrs.type != WindowManager.LayoutParams.TYPE_KEYGUARD) - || mSendingPointersToWallpaper) { - sendPointerToWallpaperLocked(win, res, res.getEventTime()); - } + } + + if (res != null && returnWhat == RETURN_PENDING_POINTER) { + synchronized (mWindowMap) { + if ((mWallpaperTarget == win && + win.mAttrs.type != WindowManager.LayoutParams.TYPE_KEYGUARD) + || mSendingPointersToWallpaper) { + sendPointerToWallpaperLocked(win, res, res.getEventTime()); } } } - + return res; } -- cgit v1.2.3-59-g8ed1b