Fix NPE
Treehugger didn't hit this with the original CL (ag/9721403) but I'm hitting it locally & believe it is the root cause of attached bug. Test: atest NotificationManagerTest (doesn't crash) Bug: 144947853 Bug: 144958550 Change-Id: I3a03097b1e81b81a1847ef46422a052df726eb7d
This commit is contained in:
@@ -2055,10 +2055,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;
|
||||
|
||||
Reference in New Issue
Block a user