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

Commit 0394b212 authored by Yorke Lee's avatar Yorke Lee
Browse files

Fix for drag start event being incorrectly cached

Since DRAG_END is now being delivered only to views that
returned true from DRAG_STARTED, make sure to clear
mCurrentDragStartEvent when returning false from DRAG_STARTED,
to avoid incorrectly sending DRAG_STARTED events to children
views on visibility changes.

Bug: 27595763

Change-Id: Ic18628b48b474351e2433e871bf545657a6ebf52
parent 95171050
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1382,6 +1382,13 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
            if (mIsInterestedInDrag) {
                retval = true;
            }

            if (!retval) {
                // Neither us nor any of our children are interested in this drag, so stop tracking
                // the current drag event.
                mCurrentDragStartEvent.recycle();
                mCurrentDragStartEvent = null;
            }
        } break;

        case DragEvent.ACTION_DRAG_ENDED: {