Merge "Setup infrastructure (multi-db support) for the new grid migration algorithm" into ub-launcher3-master

This commit is contained in:
Tracy Zhou
2020-02-07 00:00:26 +00:00
committed by Android (Google) Code Review
14 changed files with 164 additions and 42 deletions

View File

@@ -19,6 +19,7 @@ package com.android.launcher3.model;
import static com.android.launcher3.ItemInfoWithIcon.FLAG_DISABLED_LOCKED_USER;
import static com.android.launcher3.ItemInfoWithIcon.FLAG_DISABLED_SAFEMODE;
import static com.android.launcher3.ItemInfoWithIcon.FLAG_DISABLED_SUSPENDED;
import static com.android.launcher3.config.FeatureFlags.MULTI_DB_GRID_MIRATION_ALGO;
import static com.android.launcher3.model.ModelUtils.filterCurrentWorkspaceItems;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
import static com.android.launcher3.util.PackageManagerHelper.hasShortcutsPermission;
@@ -318,7 +319,9 @@ public class LoaderTask implements Runnable {
clearDb = true;
}
if (!clearDb && !GridSizeMigrationTask.migrateGridIfNeeded(context)) {
if (!clearDb && (MULTI_DB_GRID_MIRATION_ALGO.get()
? !GridSizeMigrationTaskV2.migrateGridIfNeeded(context)
: !GridSizeMigrationTask.migrateGridIfNeeded(context))) {
// Migration failed. Clear workspace.
clearDb = true;
}