mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Homescreen migration from a larger grid to a smaller grid.
Adding support for restoring from a larger device, if the grid size difference is not more that 1. During restore add all the items in the DB, and run a one-time migration the next time launcher starts. The migration strategy is defined in ShrinkWorkspaceTask.java which involves resizing, moving and removing some items. Change-Id: I6ee411f6db5bf0152b527e16146a88c56dec2d97
This commit is contained in:
@@ -24,6 +24,8 @@ import android.database.Cursor;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.launcher3.model.MigrateFromRestoreTask;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class LauncherBackupAgentHelper extends BackupAgentHelper {
|
||||
@@ -96,6 +98,13 @@ public class LauncherBackupAgentHelper extends BackupAgentHelper {
|
||||
LauncherAppState.getLauncherProvider().updateFolderItemsRank();
|
||||
}
|
||||
|
||||
if (mHelper.shouldAttemptWorkspaceMigration()) {
|
||||
MigrateFromRestoreTask.markForMigration(getApplicationContext(),
|
||||
(int) mHelper.migrationCompatibleProfileData.desktopCols,
|
||||
(int) mHelper.migrationCompatibleProfileData.desktopRows,
|
||||
mHelper.widgetSizes);
|
||||
}
|
||||
|
||||
LauncherAppState.getLauncherProvider().convertShortcutsToLauncherActivities();
|
||||
} else {
|
||||
if (VERBOSE) Log.v(TAG, "Nothing was restored, clearing DB");
|
||||
|
||||
Reference in New Issue
Block a user