diff options
author | Tony Wickham <twickham@google.com> | 2016-10-26 12:51:14 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2016-10-26 12:51:14 -0700 |
commit | 4feb27e6b1b548be7ed8abd7d76fd4d8d5dcfa6e (patch) | |
tree | 5514c476602d18cd0afbb815c145cfd8fd430af3 | |
parent | 5fd72d865e690a3bafedd39a6237152dbc894cc9 (diff) | |
download | android_packages_apps_Trebuchet-4feb27e6b1b548be7ed8abd7d76fd4d8d5dcfa6e.tar.gz android_packages_apps_Trebuchet-4feb27e6b1b548be7ed8abd7d76fd4d8d5dcfa6e.tar.bz2 android_packages_apps_Trebuchet-4feb27e6b1b548be7ed8abd7d76fd4d8d5dcfa6e.zip |
Restore mDragInfo when deferring onDropComplete() for uninstall.
We moved mDragInfo = null to onDragEnd() since onDropComplete()
isn't called for pre-drags, but this led to NPE when returning
from unistall or app info since onDropComplete() is called after
onDragEnd() in this case. So now we restore a copy of mDragInfo.
Bug: 32415014
Change-Id: I7ef4fb7145c3c78039af1131e77538969db58141
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index ae3463820..f7147e49f 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -3656,8 +3656,10 @@ public class Workspace extends PagedView public void onDropCompleted(final View target, final DragObject d, final boolean isFlingToDelete, final boolean success) { if (mDeferDropAfterUninstall) { + final CellLayout.CellInfo dragInfo = mDragInfo; mDeferredAction = new Runnable() { public void run() { + mDragInfo = dragInfo; // Restore the drag info that was cleared in onDragEnd() onDropCompleted(target, d, isFlingToDelete, success); mDeferredAction = null; } @@ -3685,6 +3687,7 @@ public class Workspace extends PagedView && mDragInfo.cell != null) { mDragInfo.cell.setVisibility(VISIBLE); } + mDragInfo = null; if (!isFlingToDelete) { // Fling to delete already exits spring loaded mode after the animation finishes. |