Fixing wrong check to determine the drag source
> target it the drop target, i.e., the InfoDropTarget or DeleteDropTarget Change-Id: If4a9f8eb72ee6afb4d80c7df6f0f2ada4bc35b22
This commit is contained in:
@@ -3206,7 +3206,7 @@ public class Launcher extends Activity
|
||||
/**
|
||||
* Returns the CellLayout of the specified container at the specified screen.
|
||||
*/
|
||||
CellLayout getCellLayout(long container, long screenId) {
|
||||
public CellLayout getCellLayout(long container, long screenId) {
|
||||
if (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
|
||||
if (mHotseat != null) {
|
||||
return mHotseat.getLayout();
|
||||
|
||||
@@ -4169,23 +4169,18 @@ public class Workspace extends SmoothPagedView
|
||||
boolean beingCalledAfterUninstall = mDeferredAction != null;
|
||||
|
||||
if (success && !(beingCalledAfterUninstall && !mUninstallSuccessful)) {
|
||||
if (target != this && mDragInfo != null) {
|
||||
if (mDragInfo != null) {
|
||||
removeWorkspaceItem(mDragInfo.cell);
|
||||
}
|
||||
} else if (mDragInfo != null) {
|
||||
CellLayout cellLayout;
|
||||
if (mLauncher.isHotseatLayout(target)) {
|
||||
cellLayout = mLauncher.getHotseat().getLayout();
|
||||
} else {
|
||||
cellLayout = getScreenWithId(mDragInfo.screenId);
|
||||
}
|
||||
if (cellLayout == null && LauncherAppState.isDogfoodBuild()) {
|
||||
throw new RuntimeException("Invalid state: cellLayout == null in "
|
||||
+ "Workspace#onDropCompleted. Please file a bug. ");
|
||||
}
|
||||
final CellLayout cellLayout = mLauncher.getCellLayout(
|
||||
mDragInfo.container, mDragInfo.screenId);
|
||||
if (cellLayout != null) {
|
||||
cellLayout.onDropChild(mDragInfo.cell);
|
||||
}
|
||||
} else if (LauncherAppState.isDogfoodBuild()) {
|
||||
throw new RuntimeException("Invalid state: cellLayout == null in "
|
||||
+ "Workspace#onDropCompleted. Please file a bug. ");
|
||||
};
|
||||
}
|
||||
if ((d.cancelled || (beingCalledAfterUninstall && !mUninstallSuccessful))
|
||||
&& mDragInfo.cell != null) {
|
||||
|
||||
Reference in New Issue
Block a user