Fix crash with app pairs and grid migration
This CL makes it so that app pair contents are loaded properly during grid migration, like folder contents.
Fixes: 316052056
Test: Have app pairs on home screen, change home grid (e.g. 4x5 to 5x5), launcher does not crash
Flag: ACONFIG com.android.wm.shell.enable_app_pairs DEVELOPMENT
Change-Id: I6a531d0d29d15ed7b8dfe7933690effe5344d941
diff --git a/src/com/android/launcher3/model/GridSizeMigrationUtil.java b/src/com/android/launcher3/model/GridSizeMigrationUtil.java
index efd5574..af66431 100644
--- a/src/com/android/launcher3/model/GridSizeMigrationUtil.java
+++ b/src/com/android/launcher3/model/GridSizeMigrationUtil.java
@@ -262,7 +262,8 @@
String srcTableName, String destTableName) {
int id = copyEntryAndUpdate(helper, entry, srcTableName, destTableName);
- if (entry.itemType == LauncherSettings.Favorites.ITEM_TYPE_FOLDER) {
+ if (entry.itemType == LauncherSettings.Favorites.ITEM_TYPE_FOLDER
+ || entry.itemType == LauncherSettings.Favorites.ITEM_TYPE_APP_PAIR) {
for (Set<Integer> itemIds : entry.mFolderItems.values()) {
for (int itemId : itemIds) {
copyEntryAndUpdate(helper, itemId, id, srcTableName, destTableName);