Merge "Fix NPE"

This commit is contained in:
TreeHugger Robot
2019-11-22 02:52:59 +00:00
committed by Android (Google) Code Review

View File

@@ -2083,10 +2083,10 @@ public class NotificationManagerService extends SystemService {
@Override
public void updateAutogroupSummary(String key, boolean needsOngoingFlag) {
String pkg = null;
String pkg;
synchronized (mNotificationLock) {
NotificationRecord r = mNotificationsByKey.get(key);
pkg = r.sbn.getPackageName();
pkg = r != null && r.sbn != null ? r.sbn.getPackageName() : null;
}
boolean isAppForeground = pkg != null
&& mActivityManager.getPackageImportance(pkg) == IMPORTANCE_FOREGROUND;