Fix: 235358918
Test: Manual
1. Rebooted the device and verified that widgets are still updating properly
2. Changed the theme from dark to daylight, then from daylight back to dark and verified that widgets are working
3. Kept the device on for several days and verified that widgets are still updating
4. Turn on auto-rotate for the launcher, open any app then exit, verified that widgets will not vanish and reappear
5. Add & remove widgets from the screen, added widgets are still updating
Change-Id: I98ee902f7d16b47bd77626201a4fefc897ba17a0
As observed in b/248291728, widgets are disappeared after OTA update,
this CL includes additional logging to reveal more information.
Bug: 248291728
Test: manual
Change-Id: I5cf968efc358c3315e5e6ecc4861d5bc888569f1
- Moved debug logs under DEBUG flag which defaults to false
- Moved info+ logs to permanent log tags
Fix: 198965093
Test: manual
Change-Id: Iea99f053da08e921542a8f532a9837997e10de5e
- Added TAPL objects to support TAPL tests for taskbar features
- Added tests for major taskbar features: hiding/showing the taskbar, opening all apps, lauching apps and app deep shortcuts from the taskbar/all apps page, launching apps and app deep shortcuts in splitscreen
- These tests should only run for large devices
Design: go/taskbar-tapl-tests
Test: ran tests locally with invalid configurations and remotely
Bug: 215218813
Change-Id: I3c28c339707467414aa47fa633f87fa0c1fdee57
- IDP can get re-initializeed during grid migration task, causing src/dest dbFile to be the same when prepareForMigration, which fails the migration and causes a wipe
- The fix is to cache IDP state as DeviceGridState, and use DeviceGridState to determine migration, trigger migration and save configuration after migration
- This should avoid migration failure in b/198965093 that causes homescreen wipe. Homescreen icon may still be messed up by the migration, but won't completely disappear
Bug: 198965093
Fix: 223579388
Test: manually trigger grid migration
Change-Id: I9890a6d5d530ff87aed8f601ec7d35a672b7cd46
- Allow icons to be added to first row where search container does not occupy
- On upgrade, clean up first row of screen 0 which may have junk data, as we used to assume first forw of screen 0 is always occupied
Bug: 210127246
Test: manual
Change-Id: I835a321964984e02632c8a70474a6551b5e360f7
Remove maxScreenId from LauncherProvider and whenever we need
a new screenId, query the database to calculate a new screenId.
Also converted and refactored AddWorkspaceItemsTaskTest
and added some extra test cases.
Test: manual & AddWorkspaceItemsTaskTest.kt
Bug: 199160559
Change-Id: I185f6823fed171d778af0130497f5ffaf89c0a70
- In RestoreDbTask.sanitizeDb, add extra step to fill all screenIds gaps so that no empty pages are left in between
e.g. [0, 3, 4, 6, 7] -> [0, 1, 2, 3, 4]
Fix: 201085524
Test: RestoreDbTaskTest
Change-Id: If0b577bf789347cc490ada0b22f2cd39ee1a33bb
- This ensure hotseat to be populated with default items, so it won't result in an empty taskbar which get stashed in apps
- Workspace needs to be cleared because shortcut / widget dragging won't always work if there are items in workspace. It only happens in test due to the way we drag items.
Fix: 202546679
Test: NexusLauncherTests:com.android.launcher3.ui.widget.RequestPinItemTest
Change-Id: Ib3ded6a685eaa1b169b75fd179c9e29ca4be1e72
Upgrade launcher DB version and remove items with
widget panel IDs from the database.
Test: follow test instructions (in CL comment)
Bug: 198254728
Change-Id: I077a5f70ee93b7eca738b38f6b0e788d49f7ce70
Test: manual
(1) Upgrading to new DB version is successful (no errors thrown in logcat)
(2) Widgets that were added with the old DB version have CONTAINER_UNKNOWN as their source container
(3) Widgets that are added with the new DB version still log source container after reboot
Bug: 185778648
Change-Id: Iaa38f0be6bc4cb0d29842f9a2ea0d08de000c930
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
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
Launcher overwrites user's favorites table (icons in WorkSpace) upon new
install session from Play Store with install reason being restore. The
overwrite was introduced in the attempt to mitigate failed restore
session due to asynchronous nature of user profile restore, but it has
been causing general instability in backup and restore. Going forward
Launcher should be moving away from table overwrite approach, this will
be implemented in b/148284747.
Bug: 171774227
Test: manual
Change-Id: I91221544dbaeb42224ce9f595906b6d9f0e4aa89
already-closed DB.
Since the DB is already closed, if we can't end the
transaction, it should not put the code in a bad state.
Bug: 173162852
Test: manually tested backup and restore flow and existing tests
Change-Id: I2692d98f0a8efc8aeb6bfd826fe738e4436c6ee4
When loading the workspace, Launcher pins/unpins shortcuts in comply
with the loaded workspace. Since minimal device mode creates a mostly
empty workspace, existing shortcuts are getting unpinned as a result.
To mitigate the issue this CL compares the db name and only invoke
sanitizeData when it matches the one defined in InvariantDeviceProfile.
Bug: 170611866
Test: manual
1. add some deep shortcut in workspace (e.g. long tap on chrome, drag
"incognito tab" to workspace)
2. opt-in to sunshine fishfood (g/sunshine-teamfood)
3. enable bedtime mode with minimal device in Settings -> Digital
Wellbeing -> Show Your Data -> Bedtime mode -> Customize -> minimal
device
4. toggle bedtime mode, wait for apps in minimal device to show, then
toggle off bedtime mode
5. verify the deep shortcut still exist
Change-Id: Ie18216ecb288e7481aa2404c4cb3ea418aee85cb
(cherry picked from commit 702ed27886)
Introduces a separate database for minimal device mode.
When minimal device mode is enabled/disabled:
1. WellbeingModel receives onChange event from ContentObserver
2. WellbeingModel called DWB's ContentProvider for latest state in
minimal device mode
3. Based on the state, WellbeingModel calls LauncherProvider to put
launcher into normal/minimal mode.
4. When going from normal -> minimal, Launcher switches to a different
database, namely minimal.db, then proceed to database initialization.
5. If the database hasn't been initialized yet, Launcher will call
ContentResolver#openInputStream with following uri:
content://com.google.android.apps.wellbeing.api/launcher_layout
to get the default layout xml.
6. The default layout is then saved in database, and the database is
considered initialized and doesn't need to go through step 5 again in
the future.
7. In case of minimal -> normal, Launcher switches back to its original
database (e.g. launcher.db if the grid size is 5x5), then reload launcher.
Bug: 161462256
Change-Id: I6bafa66440da23281f63454b698ea56b15960022
- Creates a backup table `hybrid_hotseat_restore` and copies current workspace layout before hotseat migration
- restores to back up when user turns off suggestions and launcher receives empty predicted items
- deletes hybrid_hotseat_restore table if there's a layout change
Test: Manual
Bug: 157688471
Change-Id: Iaf7ddb33799493d36dbcd12408b57224162221d9
1. Instead of debouncing launcher restore when new install session
(triggered by Play Service due to restore) is created, it is now
throttled at once every 30 seconds. (i.e. Launcher restore is triggered
immediately, but cannot be triggered again within 30 seconds)
2. Removes the backup table when all items are restored. (i.e. no item
were removed as a result of sanitize db due to user didn't sign in to
their work profile)
Bug: 153648870
Change-Id: I32df371f8b47c60a72515876217fd83ac1e56f0a
Test: manually verified with deferred restore
- 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
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
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
The flag is only set when building from Android Studio... and is never
used for dogfood.
Test: local
Change-Id: I898d585f4558c2437f0152ef102bea59c351f80b
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
1. Create feature flag for new backup & restore flow.
2. For each restore session (install reason is restore),
if its creation time is newer than the one we have in
SharedPreference, we update the entry and restores
favorite table from backup.
3. The restore operation is debounced so that when
multiple restore session is created within a small
amount of time, only the last invocation will get
executed.
Bug: 141472083
Change-Id: I7b5b63ec28741ba2b02ccfd13f591c961362ba36
Test:
1. apply on master, build & flash on physical device.
2. factory reset the device.
3. go through SuW, perform restore, exit without
adding work profile.
4. settings -> account -> add work profile account.
5. finish work profile setup, verify work profiles
is restored as well.
(see go/play-launcher-plan-launcher-implementation)
1. When Launcher launches for the first time, creates a backup
of the workspace before sanitizing db entries.
2. Creates a new path in LauncherProvider that triggers workspace
restore using last stable db entry of the same grid size.
3. When restore from backup created this way, the table will be
sanitized afterward.
Test:
1. apply on master, build & refresh on physical device
2. factory reset, go through SuW and perform restore
3. exit SuW without signing into Work Profile
4. run following commands in console
adb root
adb remount
adb pull
/data/data/com.google.android.apps.nexuslauncher/databases/launcher.db
sqlite3 ./launcher.db
.tables
SELECT * FROM favorites_bakup;
Bug: 141472083
Change-Id: I8032866a97eb333946d4f62352595d180364126b
> Changing the lifecycle to follow other static objects in Launcher
> Removing compat interface and inlining everything to helpers
Bug: 141376165
Change-Id: I82bd5db1969101de9a7eac77f32728d70195bb35
Previously, it was possible for AppWidgetsRestoredReceiver to
start the restore process before work profile has finished restoring which
resulted in the work profile items being removed from the workspace.
Bug: 131315856
Change-Id: I2f295a1ca91f1996522bcc8052aa139979526e3b