mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
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
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user