Refactor grid migration
In this CL: -Make GridsizeMigrationLogic functions pure (no side effects) -Make it so GridSizeMigrationLogic contains the migration logic and does NOT interact with the database -Let GridSizeMigrationUtil receive the results from the logic layer and use those results to interact with the database appropriately In future CLs: -Refactor GridSizeMigrationLogic to Kotlin Bug: 358399271 Flag: com.android.launcher3.grid_migration_refactor Test: GridSizeMigrationTest Change-Id: Ifcc5ca356558a7463352580f2e89eef8c86ed16b
This commit is contained in:
@@ -435,7 +435,15 @@ public class LoaderTask implements Runnable {
|
||||
final WidgetInflater widgetInflater = new WidgetInflater(context);
|
||||
|
||||
ModelDbController dbController = mApp.getModel().getModelDbController();
|
||||
dbController.tryMigrateDB(restoreEventLogger);
|
||||
if (Flags.gridMigrationRefactor()) {
|
||||
try {
|
||||
dbController.attemptMigrateDb(restoreEventLogger);
|
||||
} catch (Exception e) {
|
||||
FileLog.e(TAG, "Failed to migrate grid", e);
|
||||
}
|
||||
} else {
|
||||
dbController.tryMigrateDB(restoreEventLogger);
|
||||
}
|
||||
Log.d(TAG, "loadWorkspace: loading default favorites");
|
||||
dbController.loadDefaultFavoritesIfNecessary();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user