summaryrefslogtreecommitdiffstats
path: root/services/java/com
diff options
context:
space:
mode:
authorkeunyoung <keunyoung@google.com>2013-08-09 14:32:36 -0700
committerkeunyoung <keunyoung@google.com>2013-08-12 16:21:14 -0700
commit1eb0637f2a17362476a8876b4437f8a0c0783b86 (patch)
tree78830474db77ffd6e87e5e6c21a01d644d6c5325 /services/java/com
parent1232c51eed998bec13787d75204303502f9e195f (diff)
downloadframeworks_base-1eb0637f2a17362476a8876b4437f8a0c0783b86.zip
frameworks_base-1eb0637f2a17362476a8876b4437f8a0c0783b86.tar.gz
frameworks_base-1eb0637f2a17362476a8876b4437f8a0c0783b86.tar.bz2
fix race condition when a new display is added
- When a new display is added, display add event triggers handleDisplayAddedLocked in WindowManagerService asynchronously. - After creating virtual display, application can move on and call addWindow before handleDisplayAddedLock is called. - Application's addWindow leads into creating a new DisplayContent, and a window will be added there. - But when handleDisplayAddedLocked is called later, it will create a new DisplayContent for the display, and the window added by the application will be lost. - This CL tries to fix the issue by checking the presence of DisplayContent before creating a new one. bug: 9975297 Change-Id: I9fac7ffb57c3e1effa8f0e950539cfae73e7e1c6
Diffstat (limited to 'services/java/com')
-rw-r--r--services/java/com/android/server/wm/WindowManagerService.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 07e1e12..8de2fb0 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -10746,7 +10746,7 @@ public class WindowManagerService extends IWindowManager.Stub
if (display == null) {
throw new IllegalArgumentException("getDisplayContent: display must not be null");
}
- newDisplayContentLocked(display);
+ getDisplayContentLocked(display.getDisplayId());
}
/**