diff options
author | Wale Ogunwale <ogunwale@google.com> | 2015-04-02 16:13:57 -0700 |
---|---|---|
committer | The Android Automerger <android-build@google.com> | 2015-04-06 18:51:16 -0700 |
commit | 51c23674ab6340d7a2f2be6b3ff515e7033e118a (patch) | |
tree | f46cb14c8476bb83200680cb6580f7188ace6c1d | |
parent | f2e5ef35d651a04ae9e189a1eb29ceb23b5c1505 (diff) | |
download | base-android-cts-5.1_r1.tar.gz |
[DO NOT MERGE] Fixed NPE when trying to animate a window without displayandroid-cts-5.1_r1android-5.1.1_r4android-5.1.1_r3android-5.1.1_r2android-5.1.1_r1
In some cases it is possible for the AppToken.allAppWindows list to
get out of sync with the list of windows known to WMS if the client
doesn't call Session.remove(Window). This can lead to an NPE when
the animation threads runs and the display for the window has been
removed.
Bug: 19972099
Change-Id: Ifdf9ff2364b96757bba0539394c4a682f64577c9
-rw-r--r-- | services/core/java/com/android/server/wm/WindowAnimator.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/wm/WindowAnimator.java b/services/core/java/com/android/server/wm/WindowAnimator.java index 64713d988777..e8335112a175 100644 --- a/services/core/java/com/android/server/wm/WindowAnimator.java +++ b/services/core/java/com/android/server/wm/WindowAnimator.java @@ -824,12 +824,16 @@ public class WindowAnimator { if (displayId < 0) { return 0; } - return mService.getDisplayContentLocked(displayId).pendingLayoutChanges; + DisplayContent displayContent = mService.getDisplayContentLocked(displayId); + return (displayContent != null) ? displayContent.pendingLayoutChanges : 0; } void setPendingLayoutChanges(final int displayId, final int changes) { if (displayId >= 0) { - mService.getDisplayContentLocked(displayId).pendingLayoutChanges |= changes; + DisplayContent displayContent = mService.getDisplayContentLocked(displayId); + if (displayContent != null) { + displayContent.pendingLayoutChanges |= changes; + } } } |