launcher3: Introduce onGridMigrationComplete callback.

onGridMigrationComplete is invoked when grid migration
  successfully completes.

  ModelDelegate's can choose to observe this by overriding
  the callback.

Test: manual, existing
Flag: com.android.launcher3.one_grid_specs
Bug: 386802204

Change-Id: Iaca2e61a95c3d3decc12b2cc54461dba441202a0
This commit is contained in:
Adnan Begovic
2024-12-30 11:48:20 -08:00
parent 666d5f1427
commit 4b9b9d7e40
9 changed files with 47 additions and 18 deletions
@@ -61,9 +61,11 @@ public class FavoriteItemsTransaction {
ModelDbController controller = model.getModelDbController();
// Migrate any previous data so that the DB state is correct
if (Flags.gridMigrationRefactor()) {
controller.attemptMigrateDb(null /* restoreEventLogger */);
controller.attemptMigrateDb(
null /* restoreEventLogger */, model.getModelDelegate());
} else {
controller.tryMigrateDB(null /* restoreEventLogger */);
controller.tryMigrateDB(null /* restoreEventLogger */,
model.getModelDelegate());
}
// Create DB again to load fresh data