Merge "Fixing crash in D&D due to race conditions during drag end."
This commit is contained in:
committed by
Android (Google) Code Review
commit
1ee3e370f9
@@ -1419,8 +1419,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
|
||||
|
||||
case DragEvent.ACTION_DRAG_ENDED: {
|
||||
// Release the bookkeeping now that the drag lifecycle has ended
|
||||
if (mChildrenInterestedInDrag != null) {
|
||||
for (View child : mChildrenInterestedInDrag) {
|
||||
final HashSet<View> childrenInterestedInDrag = mChildrenInterestedInDrag;
|
||||
if (childrenInterestedInDrag != null) {
|
||||
for (View child : childrenInterestedInDrag) {
|
||||
// If a child was interested in the ongoing drag, it's told that it's over
|
||||
if (child.dispatchDragEvent(event)) {
|
||||
retval = true;
|
||||
@@ -1428,12 +1429,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
|
||||
child.mPrivateFlags2 &= ~View.DRAG_MASK;
|
||||
child.refreshDrawableState();
|
||||
}
|
||||
|
||||
mChildrenInterestedInDrag.clear();
|
||||
if (mCurrentDragStartEvent != null) {
|
||||
mCurrentDragStartEvent.recycle();
|
||||
mCurrentDragStartEvent = null;
|
||||
}
|
||||
childrenInterestedInDrag.clear();
|
||||
}
|
||||
if (mCurrentDragStartEvent != null) {
|
||||
mCurrentDragStartEvent.recycle();
|
||||
mCurrentDragStartEvent = null;
|
||||
}
|
||||
|
||||
if (mIsInterestedInDrag) {
|
||||
|
||||
Reference in New Issue
Block a user