Reattach LauncherAppWidgetHostView to its parent after canceling drag
onDrop isn't called if the drag is canceled at Launcher.onPause. Let's
also reattach LauncherAppWidgetHostView to its parent in this case.
Test: long press and hold a widget and, at the same time, press the
power button. Don't let go of the long press and press the power
button. No crash observed.
Fix: 190950646
Change-Id: Id52a51291863b7ef63c861eb6dc23b015484be65
This commit is contained in:
1 parent
d541300f0e
commit
a5e1453779
1 file changed
+4
@@ -2791,6 +2791,10 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
||||
removeWorkspaceItem(mDragInfo.cell);
|
||||
}
|
||||
} else if (mDragInfo != null) {
|
||||
// When drag is cancelled, reattach content view back to its original parent.
|
||||
if (mDragInfo.cell instanceof LauncherAppWidgetHostView) {
|
||||
d.dragView.detachContentView(/* reattachToPreviousParent= */ true);
|
||||
}
|
||||
final CellLayout cellLayout = mLauncher.getCellLayout(
|
||||
mDragInfo.container, mDragInfo.screenId);
|
||||
if (cellLayout != null) {
|
||||
|
||||
Reference in new issue
Block a user