OSDN Git Service

Fix potential deadlock between LockScreen and WindowManagerService
authorSangkyu Lee <sk82.lee@lge.com>
Wed, 16 Jan 2013 05:53:17 +0000 (14:53 +0900)
committerSangkyu Lee <sk82.lee@lge.com>
Tue, 2 Apr 2013 05:31:19 +0000 (14:31 +0900)
commit88f3677be1532fdd62a597897e3ab57efe491643
tree983b89b0316beaab73acd3575543ba390675244c
parentb7aca350e4c46bbc431f2ecaa4d8cee87915fe8b
Fix potential deadlock between LockScreen and WindowManagerService

If LockScreen is enhanced using SurfaceView/GLSurfaceView,
deadlock problem between LockScreen and WindowManagerService
can occur because of IWindow.resized() callback.
And it must lead to watchdog and reset.

IWindow.resized() callback is one-way function so calling resized()
callback of a remote IWindow object is never blocked.
However, calling resized() callback of a local IWindow object
(LockScreen is running on the same system_server process)
is always blocked until resized() callback returns.
Because resized() callback of SurfaceView/GLSurfaceView can lead to
WindowManagerService.relayoutWindow() call, deadlock can occur
between relayoutWindow() and performLayoutAndPlaceSurfacesLockedInner().
(Both functions need locking mWindowMap)

So this patch simulate one-way call when calling resized() callback
of a local IWindow object.

Change-Id: I2a6a5c74ed22d8e6b7a3bea3424ff2879d227105
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
services/java/com/android/server/wm/WindowManagerService.java