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

Commit 068f5929 authored by Christoph Studer's avatar Christoph Studer
Browse files

Fix memory leak in NotificationStackScrollLayout

Bug: 13899792
Change-Id: I87d6c5e1f0f5052d45203df51284d828823dfd88
parent 821129f2
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -31,7 +31,6 @@ import android.view.VelocityTracker;
import android.view.View;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.widget.OverScroller;
import android.widget.OverScroller;


import com.android.systemui.ExpandHelper;
import com.android.systemui.ExpandHelper;
@@ -710,6 +709,12 @@ public class NotificationStackScrollLayout extends ViewGroup
                super.onInterceptTouchEvent(ev);
                super.onInterceptTouchEvent(ev);
    }
    }


    @Override
    protected void onViewRemoved(View child) {
        super.onViewRemoved(child);
        mCurrentStackScrollState.removeViewStateForView(child);
    }

    private boolean onInterceptTouchEventScroll(MotionEvent ev) {
    private boolean onInterceptTouchEventScroll(MotionEvent ev) {
        /*
        /*
         * This method JUST determines whether we want to intercept the motion.
         * This method JUST determines whether we want to intercept the motion.
+4 −0
Original line number Original line Diff line number Diff line
@@ -72,6 +72,10 @@ public class StackScrollState {
        return mStateMap.get(requestedView);
        return mStateMap.get(requestedView);
    }
    }


    public void removeViewStateForView(View child) {
        mStateMap.remove(child);
    }

    /**
    /**
     * Apply the properties saved in {@link #mStateMap} to the children of the {@link #mHostView}.
     * Apply the properties saved in {@link #mStateMap} to the children of the {@link #mHostView}.
     * The properties are only applied if they effectively changed.
     * The properties are only applied if they effectively changed.