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

Commit 38b5ec9f authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Fix some serious pre draw listener leaks

These were responsible for a huuge memory leak, and probably also
responsible for some significant amount of jank when using the
device for a while.

Bug: 26400906
Change-Id: Ie4140998ad288583c6a4137954fab4fe9a6f2cf7
parent e1b1ce77
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -348,6 +348,12 @@ public class NotificationContentView extends FrameLayout {
        setVisible(isShown());
    }

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        getViewTreeObserver().removeOnPreDrawListener(mEnableAnimationPredrawListener);
    }

    private void setVisible(final boolean isVisible) {
        if (isVisible) {

+1 −0
Original line number Diff line number Diff line
@@ -3799,6 +3799,7 @@ public class NotificationStackScrollLayout extends ViewGroup
            } else {
                getViewTreeObserver().removeOnPreDrawListener(mShadowUpdater);
            }
            mContinuousShadowUpdate = continuousShadowUpdate;
        }
    }