From a052c0ca0b72ffb4a0b3b56b8aa00177004fa7d9 Mon Sep 17 00:00:00 2001 From: Kevin Han Date: Fri, 21 Feb 2020 18:23:04 -0800 Subject: Fix inflating content views after removal Fix a crash with NotifBindPipeline where we try to inflate a group child after it's removed. This is due to some edge case logic where we delay view hierarchy updates til later (i.e. after the notification is removed) and inflation logic and group change logic being precedented on view hierarchy changes. This fixes that by checking if the row is already removed in order to stop inflation. We add a similar check for redaction since that is similarly triggered at the view hierarchy stage. Bug: 149989491 Test: Repro from bug Change-Id: I42114bcdaf0d135bcbb68f0b634b77252ea7b8b0 --- .../notification/row/ExpandableNotificationRow.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index 97755fcb8ea9..004b56b19418 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -807,7 +807,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView // TODO: Move inflation logic out of this call if (mIsChildInGroup != isChildInGroup) { mIsChildInGroup = isChildInGroup; - if (mIsLowPriority) { + if (!isRemoved() && mIsLowPriority) { RowContentBindParams params = mRowContentBindStage.getStageParams(mEntry); params.setUseLowPriority(mIsLowPriority); mRowContentBindStage.requestRebind(mEntry, null /* callback */); @@ -1576,13 +1576,15 @@ public class ExpandableNotificationRow extends ActivatableNotificationView // TODO: Move inflation logic out of this call and remove this method if (mNeedsRedaction != needsRedaction) { mNeedsRedaction = needsRedaction; - RowContentBindParams params = mRowContentBindStage.getStageParams(mEntry); - if (needsRedaction) { - params.requireContentViews(FLAG_CONTENT_VIEW_PUBLIC); - } else { - params.freeContentViews(FLAG_CONTENT_VIEW_PUBLIC); + if (!isRemoved()) { + RowContentBindParams params = mRowContentBindStage.getStageParams(mEntry); + if (needsRedaction) { + params.requireContentViews(FLAG_CONTENT_VIEW_PUBLIC); + } else { + params.freeContentViews(FLAG_CONTENT_VIEW_PUBLIC); + } + mRowContentBindStage.requestRebind(mEntry, null /* callback */); } - mRowContentBindStage.requestRebind(mEntry, null /* callback */); } } -- cgit v1.2.3-59-g8ed1b