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
This commit is contained in:
Kevin Han
2020-04-16 16:02:04 -07:00
parent d53e8618cc
commit 445357aad9

View File

@@ -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);
}
}