Commit Graph

16 Commits

Author SHA1 Message Date
Federico Baron b8030e9627 Fix issue where hotseat apps don't migrate to the new grid
Hotseat apps would not migrate to a new grid if the new grid already had
hosteat filled out. This resolves the issue and addresses the issue of
workspace spots showing up as occuppied when they should be available

Bug: 395786587
Test: GridSizeMigrationTest, GridMigrationTest, ValidGridMigrationTest
Flag: EXEMPT bugfix
Change-Id: I79613986702c7dddf15a9a31c29b4ef59eac2b3a
2025-02-14 18:30:54 +00:00
Cole Faust 1b9fd985d4 Replace .toList() with .collect()
.toList() was only introduced to android in api level 34, which is newer than
this module's min_sdk_version. Replace it with .collect().

This was found while updating android lint.

Flag: EXEMPT refactor
Bug: 394096385
Test: Presubmits
Change-Id: Id8d1de1531b67a7daf448e45592b7ef78f685fc2
2025-02-03 14:19:12 -08:00
Federico Baron 7938a50b28 If onegrid is on we don't check if destination db is new or not
We just migrate them using the special case where everything shifts up
if we meet the criteria

Bug: 392978014
Test: GridSizeMigrationTest
Flag: com.android.launcher3.one_grid_specs
Change-Id: I4efda781d6fbe6f3e1854b22685abd1b923c3dc4
2025-01-30 15:51:54 -08:00
Federico Baron 12856a32b7 When doing the special case migration where cells shift up, only modify workspace items
Fix: 393212285
Test: Verified DB values
Flag: com.android.launcher3.one_grid_specs
Change-Id: I6cd1d520a2128925664ff3ac65ec75c86a7fb54b
2025-01-30 07:00:42 +00:00
fbaron a80aed9429 Fix hotseat issue on grid migration where extra items get removed
Flag: EXEMPT bugfix
Test: n/a
Fix: 333849747
Change-Id: I6bf3b291de33930764ca8e4fac82c59c328adbde
2025-01-28 17:07:47 +00:00
Federico Baron 8d3883def3 Remove heuristic that determines whether to shift cells down or not
We decided to always shift the cells down, so that the new row always
shows up at the top

Bug: 391697719
Test: GridMigrationTest
Flag: com.android.launcher3.one_grid_specs
Change-Id: Id093e0d64e437bf218f942bfdf6d2f14ee875776
2025-01-22 23:19:43 +00:00
Adnan Begovic 4b9b9d7e40 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
2025-01-13 09:52:16 -08:00
fbaron a94ecdfac0 Move all db calls for grid migration inside a SQLiteTransaction
Bug: 388564911
Flag: com.android.launcher3.one_grid_specs
Test: GridSizeMigrationTest
Change-Id: I22a373ea5b71a0713eeba37e8d09e09130eae525
2025-01-08 13:44:34 -08:00
fbaron cdde399a00 Add new heuristic for deciding whether we should add extra rows on grid migration to the bottom or top of the grid
Bug: 364711064
Flag: com.android.launcher3.one_grid_specs
Test: GridSizeMigrationTest
Change-Id: I070ed1eddc2c7ab475267268ebdbb2e559ab6dda
2024-11-15 13:44:01 -08:00
fbaron 3c8a6c6914 Resolve issue where incorrect grid migration logic was used when migrating to strictly taller new grid
Bug: 364711064
Flag: com.android.launcher3.one_grid_specs
Test: n/a
Change-Id: I615c2ada4a2275899c08f8b40589c53c9e1dff84
2024-11-07 22:22:35 -08:00
Federico Baron cf929471a1 Merge "Remove flags that are no longer necessary" into main 2024-11-06 00:38:14 +00:00
fbaron 8f26e042b2 Remove flags that are no longer necessary
Flag: EXEMPT code cleanup
Test: GridSizeMigrationTest
Bug: b/325286145, b/325285743
Change-Id: I056021c299b56a186b754b94b33509d0b01816e0
2024-11-05 14:22:37 -08:00
fbaron 3d534b15bc Remove logs for resolved bug, and make some logs permanent
Bug: 360462379
Flag: EXEMPT code cleanup
Test: n/a
Change-Id: I99d4eb55b9241a472f38c90e36ad60f2f9f3d521
2024-11-05 11:13:15 -08:00
fbaron 65ee96c65d Convert GridSizeMigrationLogic and DbEntry to Kotlin
Bug: 358399271
Flag: com.android.launcher3.grid_migration_refactor
Test: GridSizeMigrationDBControllerTest, ValidGridMigrationUnitTest
Change-Id: I2f9373fbc52a3d1c29242f7cd5a4042af617f0af
2024-10-30 09:32:49 -07:00
fbaron 22029f6517 Fix grid migration tests with grid migration refactor flag on
Bug: 358399271
Flag: com.android.launcher3.grid_migration_refactor
Test: GridSizeMigrationDBControllerTest, ValidGridMigrationUnitTest
Change-Id: I2dceb5f9756da7ee7e7ef2d5ec29b3550a51e965
2024-10-28 10:46:17 -07:00
fbaron a796d74e36 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
2024-10-23 22:26:38 +00:00