From 7fe1f798bf45da33fa8012d9b28ffccebde32076 Mon Sep 17 00:00:00 2001 From: Vladislav Kaznacheev Date: Thu, 14 Jul 2016 17:15:02 -0700 Subject: [PATCH] Always return valid ClipDescription for ACTION_DRAG_EXITED Bug: 30148704 Change-Id: I5f5cbb35a343e6ef61bed9ff92e3921a4ecce0c0 --- core/java/android/view/ViewRootImpl.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 209886b27c189..4dc1009fe4468 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -5502,6 +5502,15 @@ public final class ViewRootImpl implements ViewParent, if (mView != null && mAdded) { final int what = event.mAction; + // Cache the drag description when the operation starts, then fill it in + // on subsequent calls as a convenience + if (what == DragEvent.ACTION_DRAG_STARTED) { + mCurrentDragView = null; // Start the current-recipient tracking + mDragDescription = event.mClipDescription; + } else { + event.mClipDescription = mDragDescription; + } + if (what == DragEvent.ACTION_DRAG_EXITED) { // A direct EXITED event means that the window manager knows we've just crossed // a window boundary, so the current drag target within this one must have @@ -5509,15 +5518,6 @@ public final class ViewRootImpl implements ViewParent, // for now. mView.dispatchDragEvent(event); } else { - // Cache the drag description when the operation starts, then fill it in - // on subsequent calls as a convenience - if (what == DragEvent.ACTION_DRAG_STARTED) { - mCurrentDragView = null; // Start the current-recipient tracking - mDragDescription = event.mClipDescription; - } else { - event.mClipDescription = mDragDescription; - } - // For events with a [screen] location, translate into window coordinates if ((what == DragEvent.ACTION_DRAG_LOCATION) || (what == DragEvent.ACTION_DROP)) { mDragPoint.set(event.mX, event.mY);