From 5f3302622178ddd26848df39125a02405c764c41 Mon Sep 17 00:00:00 2001 From: Raju Yadav Date: Mon, 24 Mar 2014 10:44:00 +0100 Subject: [PATCH] Avoid SystemUI crash due to NPE BaseStatusBar.createNotificationViews() returns null when it reports handleNotificationError(), leading to a forced crash of the misbehaving app. However, it should not add a null object of Notification.Entry since it will also crash SystemUI (crashing at compare). Change-Id: I86678c8024e931420b0fbab1f36b330e7e75d581 --- .../src/com/android/systemui/statusbar/BaseStatusBar.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index ed00398b65318..604f4c37ba964 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -841,6 +841,9 @@ public abstract class BaseStatusBar extends SystemUI implements } protected void addNotificationViews(NotificationData.Entry entry) { + if (entry == null) { + return; + } // Add the expanded view and icon. int pos = mNotificationData.add(entry); if (DEBUG) {