Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76735ec3 authored by Kevin Han's avatar Kevin Han
Browse files

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
parent 06ba19ff
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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;