Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c168ee38 authored by Mady Mellor's avatar Mady Mellor
Browse files

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
parent 18325cf2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;