Commit Graph

83 Commits

Author SHA1 Message Date
Sunny Goyal e978f6cedb Converting some caching logic booleans to lookup flags
Bug: 366237794
Test: atest IconCacheTest
Flag: EXEMPT refactor

Change-Id: I0d25996181954df22e1cb61596be0a2694ee7068
2024-10-01 17:59:48 +00:00
Sunny Goyal f7c32a29fd Requesting ApplicationInfo in cached object
Bug: 363324203
Test: Presubmit
Flag: EXEMPT refactor
Change-Id: I92f3d3ed8c267b895dc439ba1f01eb67d7f63965
2024-09-27 14:04:16 -07:00
Sunny Goyal 63c24aeacb Merge "Updating IconProvider API to use a single API to load icons" into main 2024-09-27 19:43:54 +00:00
Sunny Goyal a1cebfa0c0 Updating IconProvider API to use a single API to load icons
Bug: 366237794
Test: atest IconProviderTest
Flag: EXEMPT refactor, changes in underlying API

Change-Id: If8c6a4f13de7e7d262ee0b6d0c6897981f75e639
2024-09-26 22:13:11 -07:00
Sunny Goyal 6813d878ef Converting various cache lookup option booleans to flags, so that it can
easily be extended

Bug: 366237794
Test: Presubmit
Flag: EXEMPT refactor, method signature change
Change-Id: I4c334d05c30bfd9eff61c3a01a6b74feb8012322
2024-09-26 13:29:27 -07:00
Sunny Goyal fdc09f4a7c Fixing package override is applied in all lookup options
Bug: 369205074
Test: Verified manually
Flag: com.android.launcher3.enable_support_for_archiving
Change-Id: If9fff32ca3574c4b367c3e149a72b2e63c18c3b4
2024-09-25 19:17:28 +00:00
Sunny Goyal 2a359916ca Moving some utility class to IconCache to make it easier to use outside Launcher
Bug: 366237794
Flag: EXEMPT refactor
Test: Presubmit
Change-Id: I7583ae162b652e73a33f1aee76714e292b707e39
2024-09-18 10:05:05 -07:00
Kevin Lim f284f45581 [IconCache] Override persistent log method for when BaseIconCache
retreived empty ApplicationInfo or default app icon

Bug: b/343233224
Flag: NONE logging change for investigation
Test: NONE logging change for investigation
Change-Id: I5cd586a4868486c540a0497e2130764d44577ee9
2024-05-31 18:53:11 +00:00
Charlie Anderson d073ab0b39 Fix blank pink loading icons by ensuring that cache entry won't downgrade existing icon.
Bug: 326607598
Test: manually tested B&R
Flag: N/A
Change-Id: I8aac643ec5ca3162cd62bf1051cc751800c626dd
2024-05-13 13:55:15 -04:00
Shamali Patwa 1b8fcf4371 Merge "Revert "When getting a widget provider by name, check all categories"" into main 2024-04-18 22:14:29 +00:00
Shamali Patwa 7e5ed568b9 Revert "When getting a widget provider by name, check all categories"
This reverts commit 1f69351310.

Reason for revert: Testing odd behavior between google app and pixel weather and duplicate items issue

Change-Id: If181aa3e86969e8821b7e1cc765c3801f04489d2
2024-04-18 18:16:38 +00:00
Sebastián Franco f0c030380a Merge "When getting a widget provider by name, check all categories" into main 2024-04-17 16:24:21 +00:00
Sebastian Franco 1f69351310 When getting a widget provider by name, check all categories
Some widgets have different categories for special cases for Pixel
widgets and because of that, some times we can't find the provider,
so we need to go through all of the categories.

Flag: NA
Test: Manaul testing =(
Test: All widgets in widget_section.xml with alsoKeepInApp set to false will previously dissapear on the preview.
Fix: 331628371
Change-Id: Iffbb788cbb27c79a215d06d21c9d623462d6f7e6
2024-04-15 19:21:21 -07:00
Andrew Cole 64dfdce2c1 Removing Shrink Adaptive Icons
This function is now obsolete and we can remove this and default to always shrinking non-adaptive (legacy) icons

Test: AllAppsSearchImageTest
Bug: 318867282
Flag: None
Change-Id: I1ba1566e362c55eb04871a7515fdc76fbc689d60
2024-04-11 20:28:10 +00:00
Song Chun Fan e5ad96ce10 [Launcher/Archive] remove all checks for the archiving system property
No longer needed

Change-Id: I62c8843aa04a245d1dcc30f7787c71d17993f5d1
BUG: 331165939
Test: builds
2024-04-08 23:14:07 +00:00
Rohit Goyal 86a1b1abf5 Bugfixes: Handle session failure unarchival cases so that icon and title are accurate.
* Remove old package icon entry from IconCache in case of a session failure.
* Allow package entry to fallback to fallback state where missing icon & titles are filled using PackageManager.
* Re-bind archived application in all apps if an unarchival fails.

Test: verified bugfixes locally.
Bug: 326494527
Bug: 328314141
Flag: ACONFIG com.android.launcher3.enable_support_for_archiving DEVELOPMENT
Merged-In: Ib132bece397001e9a14933c2f6d733a04a089ef9
Change-Id: Ib132bece397001e9a14933c2f6d733a04a089ef9
2024-03-15 12:14:43 +00:00
Rohit Goyal b313ac7a30 Bugfix: Add null safety when accessing icon database for main activities for LoaderTask loadAllApps.
Test: verified bugfixes locally.
Bug: 329145005
Flag: NA
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3a6318ab5e2dee0b85c3270467477854301497a1)
Merged-In: I9f3145390d0596e55229d7dda08a4a3034d75f31
Change-Id: I9f3145390d0596e55229d7dda08a4a3034d75f31
2024-03-13 10:52:29 +00:00
Sunny Goyal 72a74669e7 Adding support for async view inflation
Bug: 318539160
Test: atest AsyncBindingTest; atest ItemInflaterTest
Flag: aconfig enable_workspace_inflation DEVELOPMENT
Change-Id: I77a373db7a5805f68f4b8cbfa9b586b5674252de
2024-02-22 10:58:48 -08:00
Sunny Goyal cc1dad0cae Merging multiple implementations of CancellableTask
Bug: 318539160
Flag: None
Test: Manual
Change-Id: Ie855427c2676e0ce76655e4dd67472c0b5e435d8
2024-02-15 13:01:10 -08:00
Jakob Schneider 4f5b60169d Version-2: Prioritize the session-provided icon & label for archived apps during unarchival in the iconCache.
* Also ensures that apps are sorted based on their actual name, so that
  they don't jump around when "Pending.." switches to "Downloading.."
* In case of faillure during unarchival, icons shown are reverted to that of PM supplied ones.

New UI: http://recall/-/gMbThhDGagWFqnJTbQCqSz/fPuzxUuU7cGXCNdygMkXAB

Test: atest CacheDataUpdatedTaskTest.java and locally verified.
Bug: 319495216
Flag: ACONFIG com.android.launcher3.enable_support_for_archiving TRUNKFOOD
Change-Id: I6410482706af900e273fdc6f7cf0b0692442364c
2024-02-09 13:55:41 +00:00
Sunny Goyal 41737b3e8b Fixing icon cache thrashing due to an unsupported icon
Bug: 284032965
Test: Verified by reproducing the use case
Flag: N/A
Change-Id: I835dd545a01eb2fd7990e0fd5ad51bac0e4b1f33
2023-05-31 23:21:13 +00:00
Sunny Goyal 899bf30fe8 Ensuring that badge override is respected even if component name
is set on the Shortcut

Bug: 276319271
Test: atest IconCacheTest
Flag: N/A
Change-Id: I33802ecd23485ba092f842ec3c3d58e2fc286f92
2023-04-03 08:31:02 -07:00
Sunny Goyal 82864d5e13 Merge "Using internal format cache for loading user badged label" into tm-qpr-dev 2023-02-17 21:09:26 +00:00
Sunny Goyal 239d6e9b8d Adding support for customizing shortcut pinning logic
> Allowing support for overring shortcut badge
> Updating pendingShortcutInfo so that the
  handler can be easily overridden

Bug: 268253894
Test: Verified on device
Change-Id: I3184cb6494bc98c7eed33798b35b4e6e6a1e7ddc
2023-02-17 18:07:23 +00:00
Sunny Goyal efad3c2f92 Using internal format cache for loading user badged label
Bug: 267683009
Test: Manual
Change-Id: I7d1df2704c4513bd80e2b6adb7a3921637fa617b
2023-02-17 18:05:25 +00:00
Pinyao Ting 023b973d15 Explicit Nullbility in Launcher (Part 2)
This CL updates the nullabality on methods associated with IconCache in Launcher.

Bug: 242895652
Test: manual
Change-Id: I4832c0950141c8a52c8a9e62659ccabb082897c8
2022-08-22 17:15:44 -07: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
Sihua Ma 4c5bd537bb Attach work badge to Weather and Battery widgets
Moving the part where widget icon is generated from WidgetsListHeader (UI thread) to IconCache (backend)

Test: Open widget picker -> switch to work widget picker -> verify that Battery and Weather are badged
Fix: 226132413, 209995894
Change-Id: I3d649f2b26d7d8e7b756129b5bae4433ea344d43
2022-04-19 15:41:56 -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
Schneider Victor-tulias 64b3497301 Fixing crashloop where LauncherActivityInfo can be null during icon query.
The previous icon loading path checked that the LauncherActivityInfo was not null and did nothing otherwise. Updating bulk icon loading path to do the same.

Fixes: 223219500
Test: manual
Change-Id: I79b7f15c65183f42ed6a23fec05558c250150cb6
2022-03-07 23:22:29 +00:00
Schneider Victor-tulias 2763365eb6 Fix icon loading null pointer.
Filtering out icon itemInfos with null component names when loading icons in bulk

Test: manual
Fixes: 220380324
Fixes: 220345439
Change-Id: I0e6f9ae0a363d17497207c92eadcac64ca42693f
(cherry picked from commit 5597e4825d)
2022-02-22 18:38:07 +00:00
Schneider Victor-tulias c4ed3ab82c Fix blank workspce icons on Launcher data refresh.
Clearing the launcher data with bulk workspace icon loading caused blank app icons to appear. Added fallback title and icon loading flows to the bulk icon loading flow.

Test: manually cleared launcher data
Fixes: 216590478
Bug: 195674813
Change-Id: I8e24a166be9f591155d538dfec865d047131b756
2022-01-31 12:33:29 -08:00
Sunny Goyal d872a97bd0 Updating icon badging logic
Bug: 201682172
Test: Manual
Change-Id: I57421b0c77e12f1cd464e532d2a1383c2cf93981
2021-12-02 22:14:25 +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 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
Sunny Goyal 777d49062f Revert "Revert "Migrating all model tests to Instrumentation tests""
This reverts commit 7a4a30d86d.

Test: Presubmit
Reason for revert: Fixing original bug

Bug: 196825541
Change-Id: Id4b1eb24a89564d264266d305aebea52917dfcd9
2021-08-31 10:51:52 +00:00
Alex Chau 7a4a30d86d Revert "Migrating all model tests to Instrumentation tests"
This reverts commit 455ba62b5d.

Reason for revert: Breaks tests on all targets

Bug: 196825541
Bug: 197570389
Change-Id: Ida6792a09c54dee46105b6b914a0dd1545bdf48d
2021-08-24 17:27:52 +00:00
Sunny Goyal 455ba62b5d Migrating all model tests to Instrumentation tests
Bug: 196825541
Test: Presubmit
Change-Id: Iebd46eb41eb46c187d569197f4b97b4fddc0f6f7
2021-08-23 12:34:44 -07:00
Hyunyoung Song 2e747e2194 Remove APP_SEARCH_IMPROVEMENTS
Bug: 190104801
Test: manual, builds

Change-Id: Icd7f0f17bf79eda9fa8e10a6699be3852a34de67
2021-06-03 20:22:29 -07:00
Sunny Goyal df4241ca4e Fixing Launcher preview leaking surface and memory
> Closing existing preview if a new request comes for same host token
> Closing in-memory icon db when closing preview
> Removing unnecessary wait blocks on UI thread and rendering
  view asynchronously
> Fixing preview loading failing on LauncherAppState access

Bug: 186712316
Bug: 187140897
Test: Manual
Change-Id: I045930b007e5dc015320224a197eee20a8354d17
2021-05-20 21:37:28 +00:00
Sunny Goyal b47172bc4e Linking various settings that control icon cache to icon state
Also separating icon provider for recents from Launcher as it used a fixed size

Bug: 183641907
Test: Verified on device
Change-Id: I6ea3caa0066d1483bfb8a81f0e8aaa472c813afe
2021-05-05 23:05:38 -07:00
Sunny Goyal 9ab43772ab Adding support for using themed icons on workspace
Bug: 183641907
Test: Manual

Change-Id: Ieda7e73b3ae4dfe3009e3f23754aff5f8826a967
2021-05-03 20:00:38 -07:00
Steven Ng 833a0b9fa9 Add a widget conversations category for grouping widgets in the picker
Bug: 184878454
Test: Open the full widget picker and observe the conversation widget
      from SystemUi is listed under conversations.
Change-Id: I53cd74d80ce3c4ff77a92cd660ca9283416e9fd3
2021-04-08 22:35:55 +01:00
Samuel Fufa 342e9df03c [Search]Implement search session cache in AllApps
- Skips SearchTarget reapplication if the id has not changed
- Resolves Incessant  subtitle on short row

Bug: 181510793
Test: Manual
Change-Id: Ic10ef9682fd3700616b7b1b7a60e82b5f2250fd3
2021-03-15 11:31:51 -05:00
Sunny Goyal 79e52fc23b Moving slice loading on a background thread
> Also fixing slice icon loading, such that the request is cancelled
  if views are recycled quickly
> Loading widget label on dg thread and cancelling request if views
  are recycled quickly.

Bug: 179068415
Test: verified locally
Change-Id: Id5a524e2bf596862330a8170394aef9ffd708544
2021-02-04 13:03:33 -08:00
TreeHugger Robot ae06e768ca Merge "Refrain from overwriting shortcut icon with default icon" into rvc-qpr-dev am: 3cdba9d5b5 am: 837e8d58fe
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12516071

Change-Id: Ib016c3ffd100badf1d6e776be8ab7ac2449278d0
2020-09-08 23:35:08 +00:00
Pinyao Ting 52dede83f1 Refrain from overwriting shortcut icon with default icon
Invert the condition check in IconCache so that, if a shortcut is
already using a non-default icon, do not replace it with default icon
again.

Bug: 162783875
Test: add weather shortcut, backup, restore, verify its icon is not
replaced by default droid icon

Change-Id: Idaf4ce4afa84d21f7192a2f4ce41a6f8daa8d3f2
(cherry picked from commit 61e8ae1d9d)
2020-09-03 23:37:55 +00:00
Sunny Goyal 53116c6cc8 Simplifying InstallShortcutReceiver
> Removing support for legacy shortcuts (with embedded icon)
> Unifying pattern for storing the data in prefs

Change-Id: Ife250807c7ce5337969d25444ee23c751bc2a487
2020-08-11 16:41:45 -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 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