diff options
| author | 2013-02-21 08:26:06 -0800 | |
|---|---|---|
| committer | 2013-02-21 08:26:06 -0800 | |
| commit | 32b44d08e2870692451eef9c61c8e2fb6753e06b (patch) | |
| tree | a48b75d29ae289442b5dc635f7586917207f14dc | |
| parent | 5161f20925ec071e72c2b0eb084f7abaa9dffabf (diff) | |
Add null check to setAppGroupId.
Fix bug 8217929.
Change-Id: I3bd54c32abcf6683c2fa75a85bf5025f47e09398
| -rw-r--r-- | services/java/com/android/server/wm/WindowManagerService.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 015987773e73..c2213b3136cc 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -3336,12 +3336,17 @@ public class WindowManagerService extends IWindowManager.Stub } synchronized(mWindowMap) { - AppWindowToken atoken = findAppWindowToken(token); + final AppWindowToken atoken = findAppWindowToken(token); if (atoken == null) { Slog.w(TAG, "Attempted to set group id of non-existing app token: " + token); return; } - mTaskIdToDisplayContents.get(atoken.groupId).setAppTaskId(atoken, groupId); + DisplayContent displayContent = mTaskIdToDisplayContents.get(atoken.groupId); + if (displayContent == null) { + Slog.w(TAG, "setAppGroupId: No DisplayContent for taskId=" + atoken.groupId); + displayContent = getDefaultDisplayContentLocked(); + } + displayContent.setAppTaskId(atoken, groupId); } } |