OSDN Git Service

Don't stomp on the drag-focus bookkeeping inadvertently.
authorChris Tate <ctate@google.com>
Wed, 13 Oct 2010 00:39:18 +0000 (17:39 -0700)
committerChris Tate <ctate@google.com>
Wed, 13 Oct 2010 00:39:18 +0000 (17:39 -0700)
Also don't update the focus tracking redundantly.
Fixes bug 3076468

Change-Id: I021e1bb91134d5226735d9510ad7f9a7b650f93f

core/java/android/view/ViewRoot.java

index 9993c10..ae671b8 100644 (file)
@@ -2520,7 +2520,6 @@ public final class ViewRoot extends Handler implements ViewParent, View.AttachIn
                     } catch (RemoteException e) {
                         Slog.e(TAG, "Unable to note drag target change");
                     }
-                    mCurrentDragView = prevDragView;
                 }
             }
         }
@@ -2540,13 +2539,13 @@ public final class ViewRoot extends Handler implements ViewParent, View.AttachIn
                 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);
         }
-        mCurrentDragView = newDragTarget;
         event.mAction = action;  // restore the event's original state
     }