From fd344dcd9d6b241107ba07773d68dd0fe25aff5a Mon Sep 17 00:00:00 2001 From: Christopher Tate Date: Thu, 17 Dec 2020 11:43:14 -0800 Subject: [PATCH] Handle process death viz deferred FGS notification If the app has disappeared during the FGS notification deferral interval, of course we should not attempt to post it. Bug: 175887142 Test: manual (kill app during deferral period) Change-Id: I54231af16b39ac5194e83d3f35ed3758f2d445d7 --- services/core/java/com/android/server/am/ActiveServices.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java index a2b6304f5f0a1..661f6d71466f8 100644 --- a/services/core/java/com/android/server/am/ActiveServices.java +++ b/services/core/java/com/android/server/am/ActiveServices.java @@ -1761,7 +1761,7 @@ public final class ActiveServices { // The service might have been stopped or exited foreground state // in the interval, so we lazy check whether we still need to show // the notification. - if (r.isForeground) { + if (r.isForeground && r.app != null) { r.postNotification(); } else if (DEBUG_FOREGROUND_SERVICE) { Slog.d(TAG_SERVICE, " - service no longer running/fg, ignoring");