Commit Graph

166 Commits

Author SHA1 Message Date
Stefan Andonian
eac832aedd Merge "Load Delegate Items in correct order when loading Launcher Data." into udc-dev 2023-04-10 18:26:25 +00:00
Stefan Andonian
e4609a27bd Load Delegate Items in correct order when loading Launcher Data.
Bug: 251502424
Test: Loaded and bound the workspace properly.
Change-Id: Ia6d609ffa21c5036cb48e464d3e8d4fa561cb008
2023-04-10 15:46:12 +00:00
Schneider Victor-tulias
4217c930cc Cleanup ENABLE_BULK_WORKSPACE_ICON_LOADING
Flag: ENABLE_BULK_WORKSPACE_ICON_LOADING
Fixes: 270392203
Test: restarted device
Change-Id: Iac6c3da1fb7cfc5c9f7e947b3caf679a50133343
2023-04-07 17:13:52 +00:00
Schneider Victor-tulias
aba2d9796e Cleanup ENABLE_BULK_ALL_APPS_ICON_LOADING
Flag: ENABLE_BULK_ALL_APPS_ICON_LOADING
Fixes: 270392465
Test: restarted device
Change-Id: I2fe963a512632919c12e1caaf54b2aa8ecd5a3b5
2023-04-05 15:39:51 -07:00
Stefan Andonian
05ca3a8089 Refactor Workspace Loading / Processing code.
There are no behavioral changes (other than we no longer are recycling
objects while processing workspace items), but this refactor will setup
the next change to load the first workspace page before other workspace
pages.

Bug: 251502424
Test: Workspace, app widgets, and containers loaded properly.
Change-Id: I437aab40000d841d7fcc4380d05ab4a8f5d5c2ad
2023-02-15 17:36:27 +00:00
Stefan Andonian
e82476ad3b Rename LoaderResults to LauncherBinder.
LoaderResults implies a data object, not binding code specific to
Launcher UX containers. This CL merely renames this class and its
usages. It also adds a comment that explains why the functionality is
split into a base class and an implementing class.

Bug: 251502424
Test: Compilation worked correctly.
Change-Id: I01b5ac2f717e9b20612538d5c1e0ca947beb593f
2023-01-11 20:32:25 +00:00
Pinyao Ting
dec4305d0c Refactor GridSizeMigrationTaskV2
The majority of the logic in grid size migration should be implemented
as static functions in the first place since (1) they only runs once
after instantiation and (2) they are executed immediately after they are
instantiated.

This CL removes most of the instance variables from grid size migration
in favor of static methods since the later is more efficient, more
testable and therefore considered better programming practice in
general.

Bug: 256859723
Test: atest GridSizeMigrationUtilTest
Change-Id: Ief4654d79ad5cfd636e6145fdcc9dfe5a39cdf62
2022-11-21 15:24:38 -08:00
Sunny Goyal
c5c7da9a8b Removing some obsolete features
PROMISE_APPS_NEW_INSTALLS = true
ENABLE_QUICKSTEP_WIDGET_APP_START = true
FOLDER_NAME_SUGGEST = true
ENABLE_PREDICTION_DISMISS = true
HOTSEAT_MIGRATE_TO_FOLDER = false
ENABLE_DEEP_SHORTCUT_ICON_CACHE = true
ENABLE_THEMED_ICONS = true
ENABLE_ALL_APPS_EDU = true
EXPANDED_SMARTSPACE = false

Bug: 241141733
Test: Presubmit
Change-Id: I72c0c20ab7e214994dc3c3665c90e85d45991a7a
2022-08-02 13:38:38 -07:00
Schneider Victor-tulias
c8c761621b Fix overriden deep shortcut titles and icons
Bulk Icon loading causes all icons that share a component name to share a title and bitmap. This didn't work for deep shortcuts since they were already being loaded individually. Added a check to filter out deep shortcuts.

Note: If future traces show that individual deep shortcut loading is taking too long, then deep shortcut loading can be refactored into bulk icon loading.

Fixes: 224891898
Test: manual
Change-Id: I112fcd4a889071e5b523d56731bad8ecdee08abc
2022-03-18 17:50:22 +00:00
kholoud mohamed
c76b2035aa Allow overriding enterprise related strings in Launcher
Test: manual
Bug: 188414133
Bug: 211422509
Bug: 188410712
Change-Id: I75858cdcf2057e7c270da5893cd9a90c6753f182
2022-01-28 16:33:03 +00:00
Schneider Victor-tulias
c817dac4cd Merge ag/16307859 into master without bug fix.
- Copied ag/16307859, with a modification to QuickstepModelDelegate#getContainer. This allows the crash from b/173838775 to continue occuring with additional debuging logs.

Bug: 173838775
Test: manual
Change-Id: Ic96a25665457c80f5c9ab45a896fada34a3a68ff
2021-11-30 12:08:23 -08:00
Schneider Victor-tulias
8664cb1261 Revert "Fix ClassCastException in QuickstepModelDelegate"
This reverts commit 380f8fd890.

Reason for revert: remove bug fix on master

Bug: 173838775
Change-Id: I3cbb3e383c52095a10b3e22ea4c586c0c3c8d7a9
2021-11-29 22:34:04 +00:00
Schneider Victor-tulias
380f8fd890 Fix ClassCastException in QuickstepModelDelegate
- Added a casting check as an immediate fix to b/173838775
- Added logging to help debug the corrupt state where an item of type other than FolderInfo is used as an other item's container.
- Added LoaderMemoryLogger for adding large logs that are only conditionally printed.

Bug: 173838775
Test: manually checked logs
Change-Id: I9491cb421b9fb807d5fb110b04ad069481de768f
2021-11-24 14:26:45 -08:00
Thales Lima
9a6b20f0cb Merge "launcher: create more space options" into sc-v2-dev 2021-10-05 15:38:57 +00:00
Thales Lima
78d00adcbe launcher: create more space options
The grid doesn't have a constant space between cells anymore, so we need
new attributes for the different spaces in different situations.

Bug: 191879424
Test: checking cell size and extra space in dumpsys
Change-Id: I4b6aae5b3fea281490c00cd13d0cd3a25372f21b
2021-10-05 12:26:05 +01:00
sfufa@google.com
ca76de0e6e Support drag/drop on search results
Bug: 199341710
Test: manual
Change-Id: I9879c2a3769d4f930ab0289d2f26e4757971549d
2021-10-04 13:14:12 -07:00
Steven Ng
9114f280a2 Merge "Group weather widgets under the widget category" into sc-v2-dev 2021-10-01 10:17:47 +00:00
Steven Ng
43859f10bc Group weather widgets under the widget category
Test: manual (see video in bug) and added PackageUserKeyTest
      Also tested pending conversation widget to ensure the right icon
      is shown.
Fix: 201062480
Change-Id: If23c28bd93c54fb1747648309ab3c238a1810902
2021-09-30 14:22:21 +01:00
Schneider Victor-tulias
dccfe04a3a Improve all apps loading times.
Updated loadAllApps to load all required icons in a series of bulk sql queries. This reduces the cost of SQL lookups (up to two lookups per user, rather than one lookup per icon)

Bug: 195674813
Test: Added all icons to workspace, added duplicate icons, added icons for same component name from different users
Change-Id: Ifda8980386084999c53d7f881e8967be0d57d263
2021-09-29 12:37:40 -07:00
Schneider Victor-tulias
b988ab77cb Improve workspace loading times.
Updated loadWorkspace to load all required icons in a series of bulk sql queries. This reduces the cost of SQL lookups (up to two lookups per user, rather than one lookup per icon)

Bug: 195674813
Test: Added all icons to workspace, added duplicate icons, added icons for same component name from different users

Change-Id: I56afaa04e7c7701f0d3c86b31c53f578dfa73fe6
2021-09-15 17:09:06 -07:00
Schneider Victor-tulias
927d6dcc6c Add tracing to help in launcher load time profiling.
Bug: 195674813
Test: None
Change-Id: I895a64bbba515ce7b7df8d093d40e0a5b6056d2e
2021-09-15 17:08:53 -07: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
Steven Ng
f4b1b0af75 Merge "Don't delete widgets that violate min size requirement" into sc-dev am: 5fc53cbc22
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15455163

Change-Id: I2783668d3315537fd64b2a6175064abbcbbe132f
2021-08-04 20:29:24 +00:00
Steven Ng
b269cc5150 Don't delete widgets that violate min size requirement
Test: Manual
Bug: 194766124
Change-Id: I4713e65e27da23d833bb60fb556ae8924a63e305
2021-08-04 11:14:09 +01:00
Sunny Goyal
278939fdf3 Removing GridMigrationTask-v1 since it has been disabled for a while
Also removing some data migration support

Bug: 194937047
Test: Presubmit
Change-Id: I392a5f6e49ec170f63056a7664de47229896f390
2021-07-28 15:55:43 -07:00
Sunny Goyal
12e3f1f2f7 Removing UI dependency from LauncherModel in case of 2-panel layout
Bug: 175939730
Bug: 192431856
Bug: 185515153
Test: Manual
Change-Id: I8baa1cf9e5a8a04d5b8bc38c1f4b0755265cd8a9
2021-07-22 10:34:25 -07:00
Sunny Goyal
711c596c86 Binding Taskbar directly from Launcher model
This allows taskbar to be loaded even in case of 3P Launchers
and removes dependency on LauncherActivity lifecycle

Bug: 187353581
Bug: 188788621
Test: Manual
Change-Id: I5a0988e0697b41677d4c58f0213aef14ec0c0972
2021-07-15 12:43:11 -07:00
Yogisha Dixit
ba28286260 Merge "Log widgets source." into sc-dev am: f9acf1d5d4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14690879

Change-Id: I2fa39b66ca31549f7754657b7d3bde6bdf8a5f59
2021-06-30 18:33:44 +00:00
Yogisha Dixit
658c5dafd4 Log widgets source.
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
2021-06-30 17:48:14 +00:00
Steven Ng
755c2c54c7 Merge "Use category icon for pending conversation widgets" into sc-dev am: d35dcdec05
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15142493

Change-Id: Id2b6a1429d1b8f84e901fffc0e669c357888d9be
2021-06-29 23:16:56 +00:00
Steven Ng
12f7a59e5c Use category icon for pending conversation widgets
Fix: 192333050
Test: Manual
Change-Id: Ie3895cd4747f1bec1c8ca9af82347bb0eafa7415
2021-06-29 18:04:09 +01:00
Steven Ng
2c1fb29d26 Merge "Log widget dimensions before deleting a widget violating min size" into sc-dev am: 21780405ac
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15015050

Change-Id: I8e2b4160bef59aa17f131a384642975eb0bfbd2c
2021-06-18 10:38:35 +00:00
Steven Ng
b50d747d20 Log widget dimensions before deleting a widget violating min size
Test: N/A
Bug: 191223844
Change-Id: Id909ee19be1a1c7d70a09643422d9ed62a2d82a9
2021-06-17 21:13:17 +01:00
Andras Kloczl
55edfe55f7 Add two panel home support for page binding logic
There's a logic which prioritizes the binding for the
current page and defers the other pages' binding.
If two panel home is enabled, we want to bind both pages
together. LauncherPageRestoreHelper has been created to
contain the logic for persisting restoring and calculating
which pages to load immediately.

Test: manual + run LauncherPageRestoreHelperTest robo test
Bug: 174464691
Change-Id: I57ac3f7150303b95b272e922f44bda26f9d5ce2a
2021-05-24 23:22:06 +02:00
Pinyao Ting
486ce88f18 Additional debug logging to triage shortcut related issue.
Bug: 185614138
Test: flash and verify logs shows up in bugreport
Change-Id: Ie7b45b5ffbd9ee2ed64f478647779e240f3255a7
2021-04-19 11:17:42 -07:00
Sunny Goyal
d197ebcfd5 Moving data sanitization before bind
Data sanitization changes the launcher model data, which makes it
out of sync with what Launcher is displaying.
This would lead to widgetsIds getting deleted when they are created
by Launcher on UI thread, but have not yet been updated in the model
Also clearing all ghost widgets on every load. This would remove
the flaky behavior where widget update depends on folder and
other icons getting removed

Test: Presubmit
Bug: 181680555
Change-Id: I3cce69383d9d92a283c5197c3f99fbb539d93dbb
2021-03-02 10:58:16 -08:00
Yogisha Dixit
a6554759aa Merge "Move widget files into widget folder + add tests." into sc-dev 2021-03-02 09:30:02 +00:00
Sunny Goyal
ca6a539faa Only fetching relevant widget info during first pass
This avoids loading resources for allwidget providers when they
are not added to homescreen.

Test: Verified on device
Bug: 180867488
Change-Id: If9adde8eb035ecac75dc4e3e37cd3f0f526865e5
2021-03-01 15:33:15 -08: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
Schneider Victor-tulias
78fb71458f Fix incorrect launcher loading.
Apps that were installed and downloading incrementally would be shown as fully downloaded on reboot. Updated LoaderTask and AppInfo.updateRuntimeFlagsForActivityTarget to account for this.

Fixes: 178528867

Test: manual with hardcoded values

Change-Id: I088e43ae886b4157bad9f4fa8d40373cf7f8235a
(cherry picked from commit 6d0fec8ac7)
2021-01-28 22:21:08 +00:00
Schneider Victor-tulias
6a5f431a7b Revert "Revert "Add UI updates for incremental app installs.""
This reverts commit 229497d182.

Reason for revert: Patching bugs

Fixes: 176901235, 176992421, 176884453

Test: manual

Change-Id: I57e13a15e72284564a10761966732ee31d15fd08
2021-01-12 12:22:33 -08:00
Schneider Victor-tulias
229497d182 Revert "Add UI updates for incremental app installs."
This reverts commit 84269d349d.

Reason for revert: causes b/176884453 and b/176992421

Change-Id: I3398674a0acbad8329df5d341ae074ac073a6bf9
2021-01-07 19:44:44 +00:00
Schneider Victor-tulias
84269d349d Add UI updates for incremental app installs.
1. Changed Preload Icon UI to be grayscale while the app is not startable.
2. Added progress bar for when app is installed but still ownloading.
3. Updated Preload Icon progress and click handling to use new incremental api.

Progress bar color updates will follow in a separate CL.

Demo: https://drive.google.com/file/d/1H1EvtTorLeJwC1eiq10tm-TT81YZ6osk/view?usp=sharing

Bug: 171008815

Test: manual

Change-Id: I5874a5146d79a8c91d7d90ff0b9c1c427a3c95dd
2021-01-05 15:17:26 -05:00
Sunny Goyal
cfcefb0c47 Synchronizing model data access
Test: Presubmit
Bug: 173328873
Change-Id: Ifc1724e17ebfa2ee5f21bb3f272986b8a14fdbc1
2020-12-10 16:24:19 -08:00
Pinyao Ting
0d97f8d19a Disable Database overwrite upon restore
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
2020-12-05 07:05:12 -08:00
Pinyao Ting
af0391f9b2 Include more error logging for widget restore
Bug: 171774227
Test: manually tested complete backup & restore flow
Change-Id: Ieb4b39d80a24b4dff377ee74d24d9010acd0daca
(cherry picked from commit ae1997b9d5)
2020-11-11 19:36:09 +00:00
Sunny Goyal
b694a69f53 Integrating snapshot logging in Launcher
> Workspace snapshot is logged when the workspace loads (at most once a day)
> Removing unnecessary thread jumping when logging folders
> Preference snapshot is logged on process start and whenever something changes

Change-Id: I93767de89b11522d843c0e8300d1f108c78f6d90
2020-10-27 11:25:43 -07:00
Pinyao Ting
702ed27886 Fix the issue where shortcuts are removed in minimal device mode
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
2020-10-15 12:56:44 -07:00
Jon Miranda
1d7ed30dba Remove widgets that no longer fit the workspace in their current spans.
This can happen when display size changes.
We compare span sizes of widget in the db to the min sizes of the widget
in the current display size. If the widget can no longer fit in its existing
spans, we remove it.

Also update test widgets to have minWidth/minHeight of 1dp. This ensures that
the spanX, spanY, min* values remain consistent between different test devices.

Bug: 168818961
Change-Id: I723372e4582658f78b2f23ced9073cb77977a6b8
2020-09-30 16:19:21 -07:00
Jonathan Miranda
9fcb45f872 Revert "Remove widgets that no longer fit the workspace in their current spans."
This reverts commit bf6e8ffbf0.

Reason for revert: broken tests
Bug: 141313472
Change-Id: I1e93e21e2c6618dea6cd099a46c9b9d2ab3ab81c
2020-09-29 02:08:43 +00:00