From d0baf3c9a6464bab6499c864c6e8aa603d84d879 Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Thu, 26 Jan 2017 11:58:56 -0800 Subject: [PATCH] Fix crash on density / font change in NotificationGuts.gutsContent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There were two issues: 1) The mGutsMenuItem wasn’t getting nulled out correctly 2) There was no check for guts != null when seeing if there were exposed guts, this meant the bind would happen when there were no guts exposed, because mGutsMenuItem wasn’t nulled out correctly, it would be out of date / still attached to a parent. Test: Manually tried: 1) Have notifications that *haven’t* had guts revealed 2) Change screen density 1) Have notifications, reveal some of their guts 2) Change screen density Bug: 34737513 Change-Id: Iff0a782c9377aec973eb07645e852bc320dbb101 --- .../src/com/android/systemui/statusbar/BaseStatusBar.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index 9a5e783118244..b92daf743f6eb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -970,7 +970,8 @@ public abstract class BaseStatusBar extends SystemUI implements ArrayList activeNotifications = mNotificationData.getActiveNotifications(); for (int i = 0; i < activeNotifications.size(); i++) { Entry entry = activeNotifications.get(i); - boolean exposedGuts = entry.row.getGuts() == mNotificationGutsExposed; + boolean exposedGuts = mNotificationGutsExposed != null + && entry.row.getGuts() == mNotificationGutsExposed; entry.row.reInflateViews(); if (exposedGuts) { mNotificationGutsExposed = entry.row.getGuts(); @@ -1072,6 +1073,7 @@ public abstract class BaseStatusBar extends SystemUI implements mStackScroller.onHeightChanged(row, !isPanelFullyCollapsed() /* needsAnimation */); } mNotificationGutsExposed = null; + mGutsMenuItem = null; }); if (item.gutsContent instanceof SnoozeGutsContent) {