summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/model
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-05-24 13:19:01 -0700
committerSunny Goyal <sunnygoyal@google.com>2016-06-23 16:31:54 -0700
commiteb77aaea8990ede3ba774c7b92d48d098bda0f24 (patch)
tree0149f4586d7f7e56febd287d7b354e119bedf6a9 /src/com/android/launcher3/model
parent0d21daace200502c45e0c976dd6a91eea03808e0 (diff)
downloadandroid_packages_apps_Trebuchet-eb77aaea8990ede3ba774c7b92d48d098bda0f24.tar.gz
android_packages_apps_Trebuchet-eb77aaea8990ede3ba774c7b92d48d098bda0f24.tar.bz2
android_packages_apps_Trebuchet-eb77aaea8990ede3ba774c7b92d48d098bda0f24.zip
Removing Key-Value pair backup logic as Launcher now uses full-data backup
Change-Id: I3bbaec2b33afe8c1da3ca1468c7c733cc3194604
Diffstat (limited to 'src/com/android/launcher3/model')
-rw-r--r--src/com/android/launcher3/model/GridSizeMigrationTask.java30
1 files changed, 2 insertions, 28 deletions
diff --git a/src/com/android/launcher3/model/GridSizeMigrationTask.java b/src/com/android/launcher3/model/GridSizeMigrationTask.java
index cb1acaac2..5941af888 100644
--- a/src/com/android/launcher3/model/GridSizeMigrationTask.java
+++ b/src/com/android/launcher3/model/GridSizeMigrationTask.java
@@ -51,10 +51,6 @@ public class GridSizeMigrationTask {
private static final String KEY_MIGRATION_SRC_WORKSPACE_SIZE = "migration_src_workspace_size";
private static final String KEY_MIGRATION_SRC_HOTSEAT_COUNT = "migration_src_hotseat_count";
- // Set of entries indicating minimum size a widget can be resized to. This is used during
- // restore in case the widget has not been installed yet.
- private static final String KEY_MIGRATION_WIDGET_MINSIZE = "migration_widget_min_size";
-
// These are carefully selected weights for various item types (Math.random?), to allow for
// the least absurd migration experience.
private static final float WT_SHORTCUT = 1;
@@ -81,11 +77,9 @@ public class GridSizeMigrationTask {
private final int mDestHotseatSize;
protected GridSizeMigrationTask(Context context, InvariantDeviceProfile idp,
- HashSet<String> validPackages, HashMap<String, Point> widgetMinSize,
- Point sourceSize, Point targetSize) {
+ HashSet<String> validPackages, Point sourceSize, Point targetSize) {
mContext = context;
mValidPackages = validPackages;
- mWidgetMinSize.putAll(widgetMinSize);
mIdp = idp;
mSrcX = sourceSize.x;
@@ -886,16 +880,6 @@ public class GridSizeMigrationTask {
return String.format(Locale.ENGLISH, "%d,%d", x, y);
}
- public static void markForMigration(
- Context context, HashSet<String> widgets, BackupProtos.DeviceProfieData srcProfile) {
- Utilities.getPrefs(context).edit()
- .putString(KEY_MIGRATION_SRC_WORKSPACE_SIZE,
- getPointString((int) srcProfile.desktopCols, (int) srcProfile.desktopRows))
- .putInt(KEY_MIGRATION_SRC_HOTSEAT_COUNT, (int) srcProfile.hotseatCount)
- .putStringSet(KEY_MIGRATION_WIDGET_MINSIZE, widgets)
- .apply();
- }
-
/**
* Migrates the workspace and hotseat in case their sizes changed.
* @return false if the migration failed.
@@ -957,14 +941,6 @@ public class GridSizeMigrationTask {
+ " to " + targetSize);
}
- // Min widget sizes
- HashMap<String, Point> widgetMinSize = new HashMap<>();
- for (String s : Utilities.getPrefs(context).getStringSet(KEY_MIGRATION_WIDGET_MINSIZE,
- Collections.<String>emptySet())) {
- String[] parts = s.split("#");
- widgetMinSize.put(parts[0], parsePoint(parts[1]));
- }
-
// Migrate the workspace grid, step by step.
while (targetSizeIndex < sourceSizeIndex ) {
// We only need to migrate the grid if source size is greater
@@ -974,8 +950,7 @@ public class GridSizeMigrationTask {
if (new GridSizeMigrationTask(context,
LauncherAppState.getInstance().getInvariantDeviceProfile(),
- validPackages, widgetMinSize,
- stepSourceSize, stepTargetSize).migrateWorkspace()) {
+ validPackages, stepSourceSize, stepTargetSize).migrateWorkspace()) {
dbChanged = true;
}
sourceSizeIndex--;
@@ -1006,7 +981,6 @@ public class GridSizeMigrationTask {
prefs.edit()
.putString(KEY_MIGRATION_SRC_WORKSPACE_SIZE, gridSizeString)
.putInt(KEY_MIGRATION_SRC_HOTSEAT_COUNT, idp.numHotseatIcons)
- .remove(KEY_MIGRATION_WIDGET_MINSIZE)
.apply();
}
}