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

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

No files matched your search

@@ -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;
}