From 445357aad93e1cc9130fd30457892d267995e0c7 Mon Sep 17 00:00:00 2001 From: Kevin Han Date: Thu, 16 Apr 2020 16:02:04 -0700 Subject: [PATCH] Fix HUN unbind crash when notif is removed. There appear to be some edge cases where we expect HUN entries to live longer than the NotificationEntryManager entries so it's possible to trigger an "unbind" operation after the entry is removed and trigger an illegal state exception. This can be solved with a check to see if the notification has been removed. Bug: 153902989 Test: builds Change-Id: I6a034e07d0983681fbbe01a8f25dce2881668a3f --- .../statusbar/notification/interruption/HeadsUpController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/HeadsUpController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/HeadsUpController.java index 6d14ccf857165..9b6ae9a7f99dd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/HeadsUpController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/HeadsUpController.java @@ -175,7 +175,7 @@ public class HeadsUpController { private OnHeadsUpChangedListener mOnHeadsUpChangedListener = new OnHeadsUpChangedListener() { @Override public void onHeadsUpStateChanged(@NonNull NotificationEntry entry, boolean isHeadsUp) { - if (!isHeadsUp) { + if (!isHeadsUp && !entry.getRow().isRemoved()) { mHeadsUpViewBinder.unbindHeadsUpView(entry); } }