am c0b52fef: Refactoring to ensure item deletion always removes from the DB.

* commit 'c0b52fefbc11531d560359c093484099f9d1298e':
  Refactoring to ensure item deletion always removes from the DB.
This commit is contained in:
Winson authored and Android Git Automerger committed 2015-09-10 22:03:57 +00:00
commit 7089a4e197
6 files changed
+75 -67

No files matched your search

+5 -8
View File
@@ -1110,9 +1110,9 @@ public class Workspace extends PagedView
LauncherAppWidgetInfo info = (LauncherAppWidgetInfo) v.getTag();
LauncherAppWidgetHostView lahv = (LauncherAppWidgetHostView) info.hostView;
if (lahv != null && lahv.isReinflateRequired()) {
mLauncher.removeAppWidget(info);
// Remove the current widget which is inflated with the wrong orientation
cl.removeView(lahv);
// Remove and rebind the current widget (which was inflated in the wrong
// orientation), but don't delete it from the database
mLauncher.removeItem(lahv, info, false /* deleteFromDb */);
mLauncher.bindAppWidget(info);
}
}
@@ -4448,12 +4448,9 @@ public class Workspace extends PagedView
for (LauncherAppWidgetInfo info : mInfos) {
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.removeAppWidget(info);
CellLayout cl = (CellLayout) view.getParent().getParent();
// Remove the current widget
cl.removeView(view);
mLauncher.removeItem(view, info, false /* deleteFromDb */);
mLauncher.bindAppWidget(info);
}
}