From e852400e1b5016a803c19c4398e3d7cb6239c0f1 Mon Sep 17 00:00:00 2001 From: Wale Ogunwale Date: Tue, 13 Sep 2016 16:34:57 -0700 Subject: Fixed NPE when pause is complete on a dead app. Cause by trying to stop freezing the screen on an activity record whose refrence we already set to null because the app is dead. WM will no longer freeze the screen for a dead app. Bug: 31441504 Change-Id: I6617a5536bce5748b2f4559428ee856f54f0ab81 --- services/core/java/com/android/server/am/ActivityStack.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index edc333458c59..60d3d1ec349b 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -1308,7 +1308,9 @@ final class ActivityStack { // It is possible the activity was freezing the screen before it was paused. // In that case go ahead and remove the freeze this activity has on the screen // since it is no longer visible. - prev.stopFreezingScreenLocked(true /*force*/); + if (prev != null) { + prev.stopFreezingScreenLocked(true /*force*/); + } mPausingActivity = null; } -- cgit v1.2.3-59-g8ed1b