summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/LauncherBackupAgentHelper.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-07-27 14:36:07 -0700
committerSunny Goyal <sunnygoyal@google.com>2015-07-31 12:03:33 -0700
commite5bb705fb79f18df8680958dcf2c5460e16c90b6 (patch)
tree33c20c832cf07556ca8d0d3c114489c95190a3f0 /src/com/android/launcher3/LauncherBackupAgentHelper.java
parente40e77b34f6521d3caaa8eb49b9e073258e91f56 (diff)
downloadandroid_packages_apps_Trebuchet-e5bb705fb79f18df8680958dcf2c5460e16c90b6.tar.gz
android_packages_apps_Trebuchet-e5bb705fb79f18df8680958dcf2c5460e16c90b6.tar.bz2
android_packages_apps_Trebuchet-e5bb705fb79f18df8680958dcf2c5460e16c90b6.zip
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
Diffstat (limited to 'src/com/android/launcher3/LauncherBackupAgentHelper.java')
-rw-r--r--src/com/android/launcher3/LauncherBackupAgentHelper.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/launcher3/LauncherBackupAgentHelper.java b/src/com/android/launcher3/LauncherBackupAgentHelper.java
index b7860d45b..611ab2e92 100644
--- a/src/com/android/launcher3/LauncherBackupAgentHelper.java
+++ b/src/com/android/launcher3/LauncherBackupAgentHelper.java
@@ -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");