Fixing talk-back folder icon removal regression.

Change-Id: I0b7fff645828d5198500973f1c9ea74f406a1a43
diff --git a/src/com/android/launcher3/DeleteDropTarget.java b/src/com/android/launcher3/DeleteDropTarget.java
index c3eea2f..5b1e84e 100644
--- a/src/com/android/launcher3/DeleteDropTarget.java
+++ b/src/com/android/launcher3/DeleteDropTarget.java
@@ -73,7 +73,7 @@
         // Remove the item from launcher and the db, we can ignore the containerInfo in this call
         // because we already remove the drag view from the folder (if the drag originated from
         // a folder) in Folder.beginDrag()
-        launcher.removeItem(view, null, item, true /* deleteFromDb */);
+        launcher.removeItem(view, item, true /* deleteFromDb */);
         launcher.getWorkspace().stripEmptyScreens();
         return true;
     }
diff --git a/src/com/android/launcher3/FocusHelper.java b/src/com/android/launcher3/FocusHelper.java
index 5c91cc0..6872d5b 100644
--- a/src/com/android/launcher3/FocusHelper.java
+++ b/src/com/android/launcher3/FocusHelper.java
@@ -247,7 +247,7 @@
             }
         } else if (isDeleteKeyChord(e)) {
             matrix = FocusLogic.createSparseMatrix(iconLayout);
-            launcher.removeItem(v, null, itemInfo, true /* deleteFromDb */);
+            launcher.removeItem(v, itemInfo, true /* deleteFromDb */);
         } else {
             // For other KEYCODE_DPAD_LEFT and KEYCODE_DPAD_RIGHT navigation, do not use the
             // matrix extended with hotseat.
@@ -341,7 +341,7 @@
             }
         } else if (isDeleteKeyChord(e)) {
             matrix = FocusLogic.createSparseMatrix(iconLayout);
-            launcher.removeItem(v, null, itemInfo, true /* deleteFromDb */);
+            launcher.removeItem(v, itemInfo, true /* deleteFromDb */);
         } else {
             matrix = FocusLogic.createSparseMatrix(iconLayout);
         }
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java
index d4e5d6d..58efaaa 100644
--- a/src/com/android/launcher3/Folder.java
+++ b/src/com/android/launcher3/Folder.java
@@ -1115,7 +1115,7 @@
 
                 // Remove the folder
                 if (getItemCount() <= 1) {
-                    mLauncher.removeItem(mFolderIcon, null, mInfo, true /* deleteFromDb */);
+                    mLauncher.removeItem(mFolderIcon, mInfo, true /* deleteFromDb */);
                     if (mFolderIcon instanceof DropTarget) {
                         mDragController.removeDropTarget((DropTarget) mFolderIcon);
                     }
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index e320d4e..84e6b99 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -2419,16 +2419,15 @@
      * Unbinds the view for the specified item, and removes the item and all its children.
      *
      * @param v the view being removed.
-     * @param containerInfo the {@link FolderInfo} container of this view (can be null).
      * @param itemInfo the {@link ItemInfo} for this view.
      * @param deleteFromDb whether or not to delete this item from the db.
      */
-    public boolean removeItem(View v, FolderInfo containerInfo, ItemInfo itemInfo,
-            boolean deleteFromDb) {
+    public boolean removeItem(View v, ItemInfo itemInfo, boolean deleteFromDb) {
         if (itemInfo instanceof ShortcutInfo) {
             // Remove the shortcut from the folder before removing it from launcher
-            if (containerInfo != null) {
-                containerInfo.remove((ShortcutInfo) itemInfo);
+            FolderInfo folderInfo = sFolders.get(itemInfo.container);
+            if (folderInfo != null) {
+                folderInfo.remove((ShortcutInfo) itemInfo);
             } else {
                 mWorkspace.removeWorkspaceItem(v);
             }
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 9c2d450..ee23826 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -1120,7 +1120,7 @@
                     if (lahv != null && lahv.isReinflateRequired()) {
                         // Remove and rebind the current widget (which was inflated in the wrong
                         // orientation), but don't delete it from the database
-                        mLauncher.removeItem(lahv, null, info, false  /* deleteFromDb */);
+                        mLauncher.removeItem(lahv, info, false  /* deleteFromDb */);
                         mLauncher.bindAppWidget(info);
                     }
                 }
@@ -4525,7 +4525,7 @@
                 if (info.hostView instanceof PendingAppWidgetHostView) {
                     // Remove and rebind the current widget, but don't delete it from the database
                     PendingAppWidgetHostView view = (PendingAppWidgetHostView) info.hostView;
-                    mLauncher.removeItem(view, null, info, false /* deleteFromDb */);
+                    mLauncher.removeItem(view, info, false /* deleteFromDb */);
                     mLauncher.bindAppWidget(info);
                 }
             }