Fix issue where hotseat wasn't being correctly persisted (issue 6259158)
Change-Id: Ie19c0f8e79a91a1021a3576f48e1db7d0c3478e1
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 239031f..eacafde 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -3349,14 +3349,22 @@
void updateItemLocationsInDatabase(CellLayout cl) {
int count = cl.getShortcutsAndWidgets().getChildCount();
+
int screen = indexOfChild(cl);
+ int container = Favorites.CONTAINER_DESKTOP;
+
+ if (mLauncher.isHotseatLayout(cl)) {
+ screen = -1;
+ container = Favorites.CONTAINER_HOTSEAT;
+ }
+
for (int i = 0; i < count; i++) {
View v = cl.getShortcutsAndWidgets().getChildAt(i);
ItemInfo info = (ItemInfo) v.getTag();
// Null check required as the AllApps button doesn't have an item info
if (info != null) {
- LauncherModel.moveItemInDatabase(mLauncher, info, Favorites.CONTAINER_DESKTOP,
- screen, info.cellX, info.cellY);
+ LauncherModel.moveItemInDatabase(mLauncher, info, container, screen, info.cellX,
+ info.cellY);
}
}
}