Merge "Start the memory dumper directly." into jb-ub-gel-agar
diff --git a/res/layout-sw720dp/launcher.xml b/res/layout-sw720dp/launcher.xml
index 156b8c3..33fafea 100644
--- a/res/layout-sw720dp/launcher.xml
+++ b/res/layout-sw720dp/launcher.xml
@@ -63,12 +63,6 @@
             launcher:pageSpacing="@dimen/workspace_page_spacing"
             launcher:scrollIndicatorPaddingLeft="@dimen/workspace_divider_padding_left"
             launcher:scrollIndicatorPaddingRight="@dimen/workspace_divider_padding_right">
-
-            <include android:id="@+id/cell1" layout="@layout/workspace_screen" />
-            <include android:id="@+id/cell2" layout="@layout/workspace_screen" />
-            <include android:id="@+id/cell3" layout="@layout/workspace_screen" />
-            <include android:id="@+id/cell4" layout="@layout/workspace_screen" />
-            <include android:id="@+id/cell5" layout="@layout/workspace_screen" />
         </com.android.launcher3.Workspace>
 
         <include layout="@layout/hotseat"
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 853e9ee..cac3d66 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -457,10 +457,8 @@
         cl.setClickable(true);
         cl.setContentDescription(getContext().getString(
                 R.string.workspace_description_format, getChildCount()));
-    }
 
-    @Override
-    public void onChildViewRemoved(View parent, View child) {
+        super.onChildViewAdded(parent, child);
     }
 
     protected boolean shouldDrawChild(View child) {
@@ -3635,6 +3633,7 @@
         long screenId = getIdForScreen(cl);
         int container = Favorites.CONTAINER_DESKTOP;
 
+        Hotseat hotseat = mLauncher.getHotseat();
         if (mLauncher.isHotseatLayout(cl)) {
             screenId = -1;
             container = Favorites.CONTAINER_HOTSEAT;
@@ -3645,8 +3644,14 @@
             ItemInfo info = (ItemInfo) v.getTag();
             // Null check required as the AllApps button doesn't have an item info
             if (info != null) {
-                LauncherModel.addItemToDatabase(mLauncher, info, container, screenId, info.cellX,
-                        info.cellY, false);
+                int cellX = info.cellX;
+                int cellY = info.cellY;
+                if (container == Favorites.CONTAINER_HOTSEAT) {
+                    cellX = hotseat.getCellXFromOrder((int) info.screenId);
+                    cellY = hotseat.getCellYFromOrder((int) info.screenId);
+                }
+                LauncherModel.addItemToDatabase(mLauncher, info, container, screenId, cellX,
+                        cellY, false);
             }
             if (v instanceof FolderIcon) {
                 FolderIcon fi = (FolderIcon) v;