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

Commit 70205fc1 authored by Chris Wren's avatar Chris Wren Committed by Android (Google) Code Review
Browse files

Merge "add null guards around notification listener handlers"

parents 9b98afca 56919558
Loading
Loading
Loading
Loading
+40 −34
Original line number Diff line number Diff line
@@ -419,6 +419,7 @@ public abstract class BaseStatusBar extends SystemUI implements
        public void onNotificationPosted(final StatusBarNotification sbn,
                final RankingMap rankingMap) {
            if (DEBUG) Log.d(TAG, "onNotificationPosted: " + sbn);
            if (sbn != null) {
                mHandler.post(new Runnable() {
                    @Override
                    public void run() {
@@ -451,29 +452,34 @@ public abstract class BaseStatusBar extends SystemUI implements
                    }
                });
            }
        }

        @Override
        public void onNotificationRemoved(final StatusBarNotification sbn,
        public void onNotificationRemoved(StatusBarNotification sbn,
                final RankingMap rankingMap) {
            if (DEBUG) Log.d(TAG, "onNotificationRemoved: " + sbn);
            if (sbn != null) {
                final String key = sbn.getKey();
                mHandler.post(new Runnable() {
                    @Override
                    public void run() {
                    removeNotification(sbn.getKey(), rankingMap);
                        removeNotification(key, rankingMap);
                    }
                });
            }
        }

        @Override
        public void onNotificationRankingUpdate(final RankingMap rankingMap) {
            if (DEBUG) Log.d(TAG, "onRankingUpdate");
            if (rankingMap != null) {
            mHandler.post(new Runnable() {
                @Override
                public void run() {
                    updateNotificationRanking(rankingMap);
                }
            });
        }
        }                            }

    };