mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 01:16:49 +00:00
The new grid migration algorithm
go/grid-migration-v2 When changing grid from option 1 to option 2, we calculate the diff and add the icons that are in option 1 but not option 2, to option 2's workspace, according to the reading order. Test: manual and unit tests Fixes: 144052802 Change-Id: Id01f69e90ce656a9b7c9051fed499807ee9ac0f7
This commit is contained in:
@@ -936,8 +936,8 @@ public class GridSizeMigrationTask {
|
||||
|
||||
boolean dbChanged = false;
|
||||
if (migrateForPreview) {
|
||||
copyTable(transaction.getDb(), Favorites.TABLE_NAME, Favorites.PREVIEW_TABLE_NAME,
|
||||
context);
|
||||
copyTable(transaction.getDb(), Favorites.TABLE_NAME, transaction.getDb(),
|
||||
Favorites.PREVIEW_TABLE_NAME, context);
|
||||
}
|
||||
|
||||
GridBackupTable backupTable = new GridBackupTable(context, transaction.getDb(),
|
||||
@@ -950,10 +950,11 @@ public class GridSizeMigrationTask {
|
||||
|
||||
HashSet<String> validPackages = getValidPackages(context);
|
||||
// Hotseat.
|
||||
if (srcHotseatCount != idp.numHotseatIcons) {
|
||||
// Migrate hotseat.
|
||||
dbChanged = new GridSizeMigrationTask(context, transaction.getDb(), validPackages,
|
||||
migrateForPreview, srcHotseatCount, idp.numHotseatIcons).migrateHotseat();
|
||||
if (srcHotseatCount != idp.numHotseatIcons
|
||||
&& new GridSizeMigrationTask(context, transaction.getDb(), validPackages,
|
||||
migrateForPreview, srcHotseatCount,
|
||||
idp.numHotseatIcons).migrateHotseat()) {
|
||||
dbChanged = true;
|
||||
}
|
||||
|
||||
// Grid size
|
||||
|
||||
Reference in New Issue
Block a user