diff options
| author | 2018-12-11 10:49:48 +0800 | |
|---|---|---|
| committer | 2018-12-11 15:56:25 +0800 | |
| commit | 24f7a03daf5a18c7f6e06817afe70a07e5f3d29f (patch) | |
| tree | 0a64449a6186aac1cfa6076e042ad7dfc6905a8d | |
| parent | c9c6a91e461044c8feb6e276beb770dd8f0c9d60 (diff) | |
Prevents NPE after stack got removed from display
Application crashed and the top activity was immediately
finished after paused timeout. If there was no activities
left in stack, it would be removed from display and updated
the display id to invalid. Therefore, the system crashed
in accessing a null ActivityDisplay object.
Bug: 120667451
Test: existing test pass
Change-Id: Ica978faf4233d8e6a709fa92f87d850f6ab8e061
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityStack.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityStack.java b/services/core/java/com/android/server/wm/ActivityStack.java index 7683172815e9..aca9702a45c8 100644 --- a/services/core/java/com/android/server/wm/ActivityStack.java +++ b/services/core/java/com/android/server/wm/ActivityStack.java @@ -1797,7 +1797,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai // focus). Also if there is an active pinned stack - we always want to notify it about // task stack changes, because its positioning may depend on it. if (mStackSupervisor.mAppVisibilitiesChangedSinceLastPause - || getDisplay().hasPinnedStack()) { + || (getDisplay() != null && getDisplay().hasPinnedStack())) { mService.getTaskChangeNotificationController().notifyTaskStackChanged(); mStackSupervisor.mAppVisibilitiesChangedSinceLastPause = false; } |