Fix NPE in when dropping from all apps (issue 12917451)

When dropping from all apps, accept drop was returning true if the item
was above a folder, however, when it came time to complete the drop,
the folder wouldn't accept the item. This can be prevented by increasing
the criteria in acceptDrop.

Change-Id: Ib644ec45984e8366c33bb674f3d3a76e22ed5160
This commit is contained in:
Adam Cohen
2014-02-07 16:34:51 -08:00
parent b6d4c2827a
commit ec0d61d79e
+5 -4
View File
@@ -2709,12 +2709,13 @@ public class Workspace extends SmoothPagedView
mTargetCell);
float distance = dropTargetLayout.getDistanceFromCell(mDragViewVisualCenter[0],
mDragViewVisualCenter[1], mTargetCell);
if (willCreateUserFolder((ItemInfo) d.dragInfo, dropTargetLayout,
mTargetCell, distance, true)) {
if (mCreateUserFolderOnDrop && willCreateUserFolder((ItemInfo) d.dragInfo,
dropTargetLayout, mTargetCell, distance, true)) {
return true;
}
if (willAddToExistingUserFolder((ItemInfo) d.dragInfo, dropTargetLayout,
mTargetCell, distance)) {
if (mAddToExistingFolderOnDrop && willAddToExistingUserFolder((ItemInfo) d.dragInfo,
dropTargetLayout, mTargetCell, distance)) {
return true;
}