Commit Graph

20 Commits

Author SHA1 Message Date
Andras Kloczl
971da6c3aa Add logging to catch rare launcher wipe issue
Test: not necessary
Bug: 200010396
Change-Id: If7c478e220c2c0ee9f6479b18bf05bf39811b451
2021-09-16 17:26:04 +01:00
Alex Chau
1e4484669d Remove widget panel
- Remove all usage of LEFT_PANEL_ID and fixed left panel code
- For preview renderer, load screen 0 + screen 1 instead
- Added a split display specific default workspace layout, with a placeholder app to pass test before we implement page pairing(b/196376162)
- Known issue: If screenId 1 is deleted, right panel will disappear from Wallpaepr & Style because there is no screenId 1. Will be resovled after page pairing(b/196376162)

Bug: 175939730
Test: manual and TaplTestsLauncher3#testWorkSpace
Change-Id: Icac1c94165c14a49c17897c45355b6cdc4d87e91
2021-08-13 21:48:35 +01:00
Sunny Goyal
68031ca3f9 Storing form factor as part of backup and disabling restore if form-factor is different
Bug: 195301649
Test: Manual
Change-Id: I9a9c4bc9246f40af2209cb914b3966319bc78bff
2021-08-04 09:51:04 -07:00
Andras Kloczl
ac3f08558c Fix launcher preview for two panel home
Test: manual
Bug: 185508060
Gif: http://shortn/_oOgKLjg5QC
Change-Id: I216b3761b3bd15c7069b92aa4a1bff8ad655b767
2021-07-13 23:13:17 +02:00
TreeHugger Robot
cdb4505020 Merge "Remove some noisy logs by setting DEBUG = false" into sc-dev 2021-04-20 19:58:51 +00:00
Tony Wickham
b87f3cdc1c Add support for having more hotseat icons in the DB than we show
Split InvariantDeviceProfile#numHotseatIcons into two variables:
numDatabaseHotseatIcons and numShownHotseatIcons. These are generally
the same, but different DisplayOptions within the same GridOption
can choose to show different numbers of hotseat icons while sharing
the same database.

numDatabaseHotseatIcons is used for all reading/writing/migrating
purposes, while numShownHotseatIcons determines how many Hotseat
icons to show in the UI.

Test: Existing tests pass, added two new migration tests
Bug: 184789479
Bug: 171917176

Change-Id: I54583504f61a47a4444b6a637ebb7e3ab31528b7
2021-04-12 16:08:15 -07:00
Tony Wickham
81ca1f8802 Remove some noisy logs by setting DEBUG = false
Change-Id: I050676c0f4750e06a9052fd1c2ebe1e8badcfd92
2021-04-09 15:40:08 -07:00
Yogisha Dixit
741fae9ea2 Move widget files into widget folder + add tests.
I will use the newly created LauncherAppWidgetProviderInfoTest in a follow-up CL to add tests for the newly added widget sizing APIs.

Test: Automatic: Ran all robolectric tests in launcher3,
      Manual: Added a widget, edited the widget, removed the widget
Bug: 179807199
Change-Id: I540b2dbe284c6eb5aa2466a1d13a9581ee59425b
2021-03-01 13:59:52 +00:00
Tracy Zhou
85f9efa7c2 Infinite loop when migrating calendar widget
Second page can take y = 0

Fixes: 161201598
Test: manual
Change-Id: I6654db5c2c358dfb132268218dd044674e302e83
2020-07-16 05:38:00 +00:00
Tracy Zhou
76773cd210 Support having dup items in folder for migration
Fixes: 159312066
Test: Have two dup items in a folder under one grid setting. Migrate. Make sure the folder is migrated correctly to the new grid setting.
Change-Id: Ic5aeb30a1c8acb382bccf744d7553913d8a8a320
2020-06-23 00:29:23 -07:00
Tracy Zhou
fa88a25ea4 Consider folder diff differently
Fixes: 157813770
Test: manual

Change-Id: I0e95f7d9709cacfe1c3b8384dfb15208a4c36914
2020-06-10 10:40:47 -07:00
Tracy Zhou
51e33e187b Workspace migration should start from CellY = 1
Test: Manual
Fixes: 155828336
Change-Id: Ic262f63e5e9dc0a5738f71a84dc5cc8b0cefd321
2020-06-10 00:42:07 -07:00
Tracy Zhou
1983faca2d Fix icons not rendering in folder migration
Fixes: 157813770
Test: manual

Change-Id: I68a2685482756a2b8afa65bf652b667972158a46
2020-06-09 14:40:17 -07:00
Tracy Zhou
b48e289e63 Improve V2 grid migration algorithm
- Reset next X when finding the next available space for placement
- Cache icons by screen id in a map so that we don't need to load it each time
- Update tests accordingly

Test: Manual and unit test
Fixes: 155828336
Change-Id: I848775725a624b7a62154224c0745cd680d2e5f0
2020-06-03 15:19:11 -07:00
Tracy Zhou
ed5f3082b0 Special handling when a db for one grid option is not setup yet
- Init KEY_MIGRATION_SRC_WORKSPACE_SIZE and KEY_MIGRATION_SRC_HOTSEAT_COUNT
- Load default workspace only when default db is created, not when peeking into dbs of other grid options during grid preview / migration

Fixes: 154184711
Test: run grid preview and migration right after a cleared cache Pixel Launcher
Change-Id: I86c7072b8c4a9da76e289c55ab440071f192fc38
2020-04-22 18:13:42 -07:00
Sunny Goyal
e396abf502 Moving model data structures to a separate file
Change-Id: I77ad7a5219e72d2e0d6c1803de2ac3ed6a65a8f7
2020-04-09 13:20:39 -07:00
Tracy Zhou
c0000450b5 Support grid preview with v2 migration algorithm
The focus of ag/10346770 is around the actual algorithm, while in the meantime our preview logic has changed during the code review of ag/10100264.

GridSizeMigrationTaskV2 addresses both cases, the difference being preview passes in constructed IDP while actual migration uses IDP from the current Context.

When doing actual migration, we call METHOD_UPDATE_CURRENT_OPEN_HELPER to update the current db helper and copy the favorites table from the previous db into the current db in favorites_tmp table. Then we do migration from there.

When calculating preview, I added METHOD_PREP_FOR_PREVIEW in this change to copy the favorites table from the intended grid setting to the current grid setting in favorites_preview table. Then we calculate migration from the current favorites table to favorites_preview table and save into favorites_preview table.

Bug: 144052802
Fixes: 144052839

Test: Manual

Change-Id: I64a8b61a4e0bf8399c0ae1af4ef9d2bde0f1ee2f
2020-03-25 21:58:19 -07:00
Tracy Zhou
f601872a0a The new grid migration algorithm
go/grid-migration-v2

When changing grid from option 1 to option 2, we calculate the diff and add the icons that are in option 1 but not option 2, to option 2's workspace, according to the reading order.

Test: manual and unit tests
Fixes: 144052802

Change-Id: Id01f69e90ce656a9b7c9051fed499807ee9ac0f7
2020-03-13 14:56:38 -07:00
Tracy Zhou
be13d109b7 Render user's actual workspace in ThemePicker preview (Part 3)
go/grid-migration-preview

With this change, we can see actual grid migration in wallpaper preview.

The approach here: we use a tmp table (favorites_preview) here specifically for this preview (to write off the migration results), and load from this tmp table workspace items if migration is necessary and successful. Otherwise, we load from the current workspace.

UPDATED: this change should be completely compatible with the new multi-db grid migration algorithm. Here is why
1. In LauncherPreviewRender#renderScreenShot, I added a check to decide which grid migration preview method we should call. Once v2 preview method is implemented, it should be integrated with other parts of this change perfectly (the reason will be mentioned below).
2. While we have multiple DBs, mOpenHelper in LauncherProvider always points to the current db we are using. Queries using CONTENT_URI is routed to whatever DB mOpenHelper points to, so it works perfectly to directly operate on CONTENT_URI even when we use multi-db underneath the hood.
3. With 1 and 2 mentioned, I believe in order for this preview change to support multi-db, we only need to implement the V2 grid migration algorithm. Because most of what we are doing in this change is wrapped in GridSizeMigrationTask, it's perfectly safeguarded.

Bug: 144052839
Change-Id: Ie6d6048d77326f96546c8a180a7cd8f15b47e4c4
2020-02-21 15:49:00 -08:00
Tracy Zhou
7df93d28d4 Setup infrastructure (multi-db support) for the new grid migration algorithm
We'll have a db for each grid option and a db for back up / restore.

TODO(pinyaoting): support back up / restore using the new infrastructure, particularly calls to GridBackupTable should use different DBs when the feature flag (NEW_GRID_MIGRATION_ALGORITHM) is on.

Bug: 144052802
Test: N/A

Change-Id: I644a3e70148bd78204a747a337446a3c038f616f
2020-02-05 19:55:05 -08:00