summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Kevin Han <kevhan@google.com> 2020-06-24 18:10:42 -0700
committer Kevin Han <kevhan@google.com> 2020-06-24 18:18:01 -0700
commit76735ec30aad1a7413e9e65e085643e15d691da3 (patch)
treee7e2f121d778c45409984ee64a841f648ad1e5ad
parent06ba19ff4eac9cd4d178884bcb202015780dcdbc (diff)
Fix NPE from freeing expanded view while expanding.
There was a potential NPE from a notification's expanded view being freed while the notification was expanding. We fix this by by forcing the view change when the transformation would involve a removed view. Bug: 159510709 Test: Reproduce steps in bug, no crash Change-Id: Ib0e6f7c57f29d2bb0157601d190dd0bb5ed6add1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java
index b0861bfbd643..1f5b063b0aa2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java
@@ -660,6 +660,14 @@ public class NotificationContentView extends FrameLayout {
private void updateContentTransformation() {
int visibleType = calculateVisibleType();
+ if (getTransformableViewForVisibleType(mVisibleType) == null) {
+ // Case where visible view was removed in middle of transformation. In this case, we
+ // just update immediately to the appropriate view.
+ mVisibleType = visibleType;
+ updateViewVisibilities(visibleType);
+ updateBackgroundColor(false);
+ return;
+ }
if (visibleType != mVisibleType) {
// A new transformation starts
mTransformationStartVisibleType = mVisibleType;