Extending the grid migration logic to handle density changes
For hotseat migratino, we simply drop the items with least weight
If the workspace row/column decreases by 2 or more, we clear the whole workspace
Bug: 25958224
Change-Id: I7131b955023d185ed10955f593184b9238546dc8
diff --git a/src/com/android/launcher3/LauncherBackupHelper.java b/src/com/android/launcher3/LauncherBackupHelper.java
index 509fbf8..4ebead5 100644
--- a/src/com/android/launcher3/LauncherBackupHelper.java
+++ b/src/com/android/launcher3/LauncherBackupHelper.java
@@ -52,7 +52,7 @@
import com.android.launcher3.backup.BackupProtos.Widget;
import com.android.launcher3.compat.UserHandleCompat;
import com.android.launcher3.compat.UserManagerCompat;
-import com.android.launcher3.model.MigrateFromRestoreTask;
+import com.android.launcher3.model.GridSizeMigrationTask;
import com.android.launcher3.util.Thunk;
import com.google.protobuf.nano.InvalidProtocolBufferNanoException;
import com.google.protobuf.nano.MessageNano;
@@ -315,7 +315,7 @@
return true;
}
- if (MigrateFromRestoreTask.ENABLED &&
+ if (GridSizeMigrationTask.ENABLED &&
(oldProfile.desktopCols - currentProfile.desktopCols <= 1) &&
(oldProfile.desktopRows - currentProfile.desktopRows <= 1)) {
// Allow desktop migration when row and/or column count contracts by 1.