diff --git a/services/core/java/com/android/server/am/ServiceRecord.java b/services/core/java/com/android/server/am/ServiceRecord.java index 3e59eeac1d4e2..91ee4eb4297f6 100644 --- a/services/core/java/com/android/server/am/ServiceRecord.java +++ b/services/core/java/com/android/server/am/ServiceRecord.java @@ -947,7 +947,7 @@ final class ServiceRecord extends Binder implements ComponentName.WithComponentN } public void postNotification() { - if (isForeground && foregroundNoti != null) { + if (isForeground && foregroundNoti != null && app != null) { final int appUid = appInfo.uid; final int appPid = app.getPid(); // Do asynchronous communication with notification manager to