OSDN Git Service

Fix #2320798: Device hang then runtime restart
authorChristopher Tate <ctate@android.com>
Fri, 11 Dec 2009 20:11:31 +0000 (12:11 -0800)
committerChristopher Tate <ctate@android.com>
Fri, 11 Dec 2009 20:49:33 +0000 (12:49 -0800)
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

services/java/com/android/server/WindowManagerService.java

index f05cdc4..aab37b9 100644 (file)
@@ -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;
         }