Fix drag enter/exit reporting

Now, each ViewGroup is tracking which of its child views [which might
themselves be ViewGroups] is currently under the drag point, and when the
drag leaves that child, a DRAG_EXITED is synthesized and dispatched all
the way down to the leaf view previously under the point.  ENTERED is
still *not* dispatched down like this; instead, it's calculated and
synthesized directly at each level based on the new LOCATION.

The ViewRoot still tracks the leaf drag target, but solely for the
purpose of reporting changes to the OS after full dispatch of a new
LOCATION -- the entered/exited messaging is no longer initiated at the
ViewRoot level.

Change-Id: I0089cc538b7e33a0440187543fcfd2f8b12e197d
diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java
index 22a7773..c7c2071 100644
--- a/core/java/android/view/ViewRoot.java
+++ b/core/java/android/view/ViewRoot.java
@@ -2493,11 +2493,12 @@
                 // a window boundary, so the current drag target within this one must have
                 // just been exited.  Send it the usual notifications and then we're done
                 // for now.
-                setDragFocus(event, null);
+                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;
@@ -2557,22 +2558,10 @@
         outLocation.y = (int) mLastTouchPoint.y;
     }
 
-    public void setDragFocus(DragEvent event, View newDragTarget) {
-        final int action = event.mAction;
-        // If we've dragged off of a view, send it the EXITED message
+    public void setDragFocus(View newDragTarget) {
         if (mCurrentDragView != newDragTarget) {
-            if (mCurrentDragView != null) {
-                event.mAction = DragEvent.ACTION_DRAG_EXITED;
-                mCurrentDragView.dispatchDragEvent(event);
-            }
             mCurrentDragView = newDragTarget;
         }
-        // If we've dragged over a new view, send it the ENTERED message
-        if (newDragTarget != null) {
-            event.mAction = DragEvent.ACTION_DRAG_ENTERED;
-            newDragTarget.dispatchDragEvent(event);
-        }
-        event.mAction = action;  // restore the event's original state
     }
 
     private AudioManager getAudioManager() {