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

Commit cc010b2a authored by Vladislav Kaznacheev's avatar Vladislav Kaznacheev
Browse files

Zero out DragEvent position when it should not be available

Bug: 26729675
Change-Id: I46507198deea89c100cb1b99a1ab7ec0719efb12
parent 1f0945e9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1461,6 +1461,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                root.setDragFocus(target);

                final int action = event.mAction;
                // Position should not be available for ACTION_DRAG_ENTERED and ACTION_DRAG_EXITED.
                event.mX = 0;
                event.mY = 0;

                // If we've dragged off of a child view or this window, send it the EXITED message
                if (mCurrentDragView != null) {
                    final View view = mCurrentDragView;
@@ -1489,6 +1493,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                    }
                }
                event.mAction = action;  // restore the event's original state
                event.mX = tx;
                event.mY = ty;
            }

            // Dispatch the actual drag location notice, localized into its coordinates
+1 −1
Original line number Diff line number Diff line
@@ -399,7 +399,7 @@ class DragState {
                }
                // force DRAG_EXITED_EVENT if appropriate
                DragEvent evt = obtainDragEvent(mTargetWindow, DragEvent.ACTION_DRAG_EXITED,
                        x, y, null, null, null, null, false);
                        0, 0, null, null, null, null, false);
                mTargetWindow.mClient.dispatchDragEvent(evt);
                if (myPid != mTargetWindow.mSession.mPid) {
                    evt.recycle();