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

Commit 56919558 authored by Chris Wren's avatar Chris Wren
Browse files

add null guards around notification listener handlers

Bug: 17909556
Change-Id: I990489a3839c49f87e3b69b3cb7bdd055fe5aec1
parent cdd35e67
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);
                }
            });
        }
        }                            }

    };