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:
Sunny Goyal
2015-03-02 11:31:35 -08:00
parent 8dbf0fff1f
commit 9282059e44
2 changed files with 8 additions and 13 deletions
+1 -1
View File
@@ -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();
+7 -12
View File
@@ -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) {