Commit Graph

43 Commits

Author SHA1 Message Date
Sunny Goyal
77954bae4e Cleaning up some build configurations
> Removing Launcher3Go-without-quickstep
> Removing src_ui_overrides to src_no_quickstep
> Removing unnecessary code swpa for GO builds

Bug: 330920490
Flag: None
Test: Presubmit, everything builds
Change-Id: I5746dbc7c5a37c1d99d78b55bf2a6adce1a711c9
2024-03-26 17:16:52 +00:00
Catherine Liang
975a0695fb Merge "Remove createWindowContext in Launcher preview renderer" into main 2024-03-11 14:13:01 +00:00
Catherine Liang
0089efe18a Remove createWindowContext in Launcher preview renderer
The line causes an error in Window Manager. When removed, it doesn't
seem to have an effect for the Wallpaper Picker use case. The preview
render still shows correctly after config changes including rotation
and dark/light theme because the picker restarts and re-requests a
preview.

Flag: NA
Bug: 328089367
Test: manually tested with config changes and different lifecycle cases
Test: manually tested with multi crop flag on and off
Change-Id: Id1bd30c7ab4c50d29622b647bd368aafbd5c043f
2024-03-05 20:32:45 +00:00
Catherine Liang
71767d1605 Fix Launcher preview crash
Launcher preview could crash when unfolding a foldable device due to the
folded state display id no longer being valid, resulting in getting a
null display. This was leading to an empty preview bundle being
returned, which is unexpected because null is expected in the case of an
exception. Instead of crashing in getDisplayId, it's better to throw an
exception earlier on if the display is null and return null.

Flag: NA
Bug: 326637851
Test: manually verified by testing unfold in WPP in old and new preview

Change-Id: Ibc353d9447a71d33092d96029a812017487d0970
2024-02-26 21:35:20 +00:00
Andy Wickham
b922dccbf5 Cleanup API checks for P, Q, and R.
Test: Build with gradle
Flag: NA
Change-Id: I3ef17090741d14bebd76cf09cf3dc5ac4f11e686
2024-01-24 14:58:08 -08:00
Charlie Anderson
511421c12f Adds logging for Launcher restore metrics in Launcher and LoaderTask
- Adds flag for indicating when we are loading after a restore, separate from the pending restore flag
- Adds many success/failure scenario metrics when loading and binding items

Flag: ACONFIG enable_launcher_br_metrics DEVELOPMENT
Test: locally verified
Bug: 307527314
Change-Id: I9d2660f6d9d7cd5813072201e96b1a64aec4ea4b
2023-12-18 19:32:02 +00:00
Stefan Andonian
dd088daead Revert "Update launcher preview icons on themed icon update"
Revert submission 25242534-launcher-preview-update-themed-icon

Reason for revert: This change potentially breaks the launcher's database.

Reverted changes: /q/submissionid:25242534-launcher-preview-update-themed-icon

Change-Id: I90fd55695b24529752a82cb6bf001935204a53f7
2023-11-30 20:12:40 +00:00
Catherine Liang
d64230f449 Update launcher preview icons on themed icon update
Flag: NA
Bug: 300257098
Test: manually verified
Change-Id: Ic34cdce3021d8fcc97c153671bd1f05013933b6d
2023-11-03 11:40:02 +08:00
Sebastian Franco
1b1c917af5 Adding the avility to have a PreviewSurfaceRenderer per screendID
Flag: persist.wm.debug.wallpaper_multi_crop
Fix: 292152331
Test: Manual testing, make sure to turn on the flags by running this adb commands
adb shell setprop persist.wm.debug.wallpaper_multi_crop 1
adb shell device_config put customization_picker com.android.wallpaper.multi_crop_preview_ui_flag true

Change-Id: Iba9518e93c09f0f8304cbce4c3bee9f8753cd583
2023-10-18 13:35:38 -07:00
Sebastian Franco
1e4e50149b Reorder code so we can use different displays on the preview render
The existing code almost have the avility to use different display
for the preview by providing a different display id, this change
just make sure the InvariantDeviceProfile is created after we
create a new context with the desired display and we need to use
the default display for the SurfaceControlViewHost

Test: Manual testing, changing the display id on FixedWidthDisplayRatioFrameLayout
Bug: 292152331
Change-Id: I450d94a9a3f1a6a7b0c2b0722a11cf335122de05
2023-08-14 12:56:13 -07:00
Stefan Andonian
9d7bffe37b Fix NPE in LauncherPreviewRenderer.
The LauncherBinder is null in LauncherPreviewRenderer, which was
causing an NPE in LoaderTask.

Bug: 279347305
Test: Used logs to verify that the LauncherPreviewRenderer was actually
loading using the LoaderTask. Most of the time, it does not, so that is
why I didn't catch this before pushing it.

Change-Id: Ic5b45abfdeb73a4bbe1f521ae4d627b6cfcfec54
2023-05-15 22:41:04 +00:00
Sunny Goyal
7bc6cdee56 Revert "Revert "Revert "Revert "Revert "Revert "Changing GridMigrationTask to use ModelDbController directly""""""
This reverts commit 09905cfa90.

Reason for revert: Fixed the crashing issue

Change-Id: Ibcfc28a89356d262e67e8842d6bae37e230a70f5
2023-05-13 01:59:19 -07:00
Sunny Goyal
09905cfa90 Revert "Revert "Revert "Revert "Revert "Changing GridMigrationTask to use ModelDbController directly"""""
This reverts commit bca4e694f0.

Reason for revert: post submit broken

Change-Id: I8afc63b5aa67ee14127f79e2245ef543bff8cf31
2023-05-11 22:22:16 +00:00
Sunny Goyal
bca4e694f0 Revert "Revert "Revert "Revert "Changing GridMigrationTask to use ModelDbController directly""""
This reverts commit 3772b246c2.

Reason for revert: Fixed the test failure

Change-Id: Ibdc9e184fcb32c7caa4ab25d8753a46fa322b703
2023-05-10 17:49:16 +00:00
Sunny Goyal
3772b246c2 Revert "Revert "Revert "Changing GridMigrationTask to use ModelDbController directly"""
This reverts commit 8d9e468dbb.

Reason for revert: b/281179368

Change-Id: Ibfc5329f72cdbcb37d01a8bf3dac2ba0724b9faf
2023-05-06 18:18:07 +00:00
Sunny Goyal
8d9e468dbb Revert "Revert "Changing GridMigrationTask to use ModelDbController directly""
This reverts commit 30bb3a247a.

Reason for revert: Fixed original issue

Change-Id: I02d85d604631795d96f0379eb94b7b6789102ea9
2023-05-05 16:00:49 +00:00
Charlie Anderson
30bb3a247a Revert "Changing GridMigrationTask to use ModelDbController directly"
This reverts commit 9ef41413e0.

Reason for revert: This was the only launcher CL during the time  b/280669657 and 280680602 occurred

Change-Id: Id7107f0935f84908ca87e1ae4c62ab05efe41a24
2023-05-04 15:19:58 +00:00
Sunny Goyal
9ef41413e0 Changing GridMigrationTask to use ModelDbController directly
instead of using content uris

Bug: 277345535
Test: Updated tests
Flag: Presubmit
Change-Id: Ib62db3334c01d9e7d27ae7b02ea703d046e2bcaa
2023-05-03 08:54:14 -07: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
George Lin
f469c4c006 [Launcher] Hide preview bottom components when overlay tabs are shown
For deciding show/hide of the bottom components, we need to take care of 2 cases
1. When on color update, we need to set the QSB flag and re-render the
   surface
2. When show/hide the wallpaper control, we specifically send a message
   to show/hide the workspace bottom components

Test: https://drive.google.com/file/d/1z1EG6KsLKFxAlS8GBLV16GoGvwI72IHc/view?usp=sharing&resourcekey=0-OGzB0RmiK5qvV2rwMYvUHQ
Test: https://drive.google.com/file/d/1gK54Y5MuHTt2tAuFDxY7z8RIL22J5c9f/view?usp=sharing&resourcekey=0-jPPC1pl1VkCS_tib2-pVxA
Test: https://drive.google.com/file/d/1ntUSgD7KbHPDGNpomQ5zE0D2fsYVeuNA/view?usp=sharing&resourcekey=0-TCuuvL4p022ATzKYuF-Q1A
Test: https://drive.google.com/file/d/1yA1K52N-orajamnrxWD17Qg7bCclmq53/view?usp=sharing&resourcekey=0-6LHnZGM5JpFQISNJ6X7jEg
Bug: 266618769
Change-Id: I428e6f50dc71369aa8fcdee31629023709e6503f
2023-03-23 18:36:18 +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
Sihua Ma
dfd8bfc7e0 Added functions to pass launcher widget span info to preview
To calculate the widget scales correctly for the launcher preview in different grids, the span info of the widgets in the launcher is necessary. Querying the launcher widget info in the database and passing it to the preview render.

Test: Verified that no exceptions were happening when changing preview grid layouts
Bug: 228328759
Change-Id: I681d21b176c8fe5208431a79009d9ba8279cda6a
2022-07-14 20:17:19 +00:00
kholoud mohamed
9b38947b32 Fix crash when loading string cache
Crash was caused by a null context in ModelDelegate

Fixes: 218305827
Test: manual
Change-Id: I1b046e24427dbdc6752ac100f488c428838ac31f
2022-02-21 11:29:24 +00:00
Brian Isganitis
1094b503f5 Support dark theme in wallpaper launcher preview.
Test: Search bar in wallpaper preview follows dark theme without themed
icons enabled.
Fix: 197475508

Change-Id: Ib71356fad3510348c1408c886c4796bc16a59642
2021-08-27 14:23:17 -04:00
Andras Kloczl
8c574de97f Two panel home empty page removing logic change
- Don't remove a single page if it's empty, only if both pages are empty.
- Add back empty pages after they were removed while the phone
  was on single panel home.
- On two panel home don't add new workspace items onto the second screen

Test: manual
Bug: 196376162
Change-Id: I4c54ffa3b359a236deb3ab67adb54111e77ec896
2021-08-26 12:06:50 +01:00
TreeHugger Robot
04c4f94223 Merge "Fixing ModelPreload cancelling existing load" into sc-qpr1-dev am: 8782ad4f99
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15524186

Change-Id: Ib89cd2bbe854242c87f52d2edc384ae864af01c2
2021-08-18 05:21:30 +00: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
57e0866fdd Fixing ModelPreload cancelling existing load
When a model preload call was made while the loader task is running
(eg: on enabling/disabling icon theme, Launcher reloads and then
launcher preview start a model-preload), it would cancel the original
loader and then start a new loader with empty callbacks. So the
model indeed get loaded, but the original callbacks never got notified
of it.

> Instead we only start preload if an existing task is not running.
> Also when preloading, we use existing callbacks, instead of using
  empty callbacks

Bug: 193851085
Bug: 195155924
Test: Verified repro steps
Change-Id: I0a96310be8489756f364aa2a12e4345e1418733d
2021-08-12 21:33:33 +00: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
Andras Kloczl
454ea214ad Fix launcher preview for two panel follow up
Fixing a possible context issue that was suggested
on the previous CL (ag/15079450) after it got submitted.

Bug: 185508060
Test: manually check launcher preview in wallpaper app
Change-Id: Ia653b833e4c1b911c7d7cac38c35ec2d12ab3a29
2021-07-27 00:27:32 +02: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
Brian Isganitis
b684c1b59b Revert "Merge "Revert "Use wallpaper colors for widgets in wallpaper change preview"" into sc-dev"
This reverts commit 7de95d6767, reversing
changes made to 0a70a5a690.

Lints have been added to fix errorprone.

Test: Widgets should adapt to wallpaper colors in launcher preview.
Bug: 192205054
Merged-In: I3fb76b6036cb909771b789eac15742df78c2c742
Merged-In: I4da9ad1cc88be251f97e86b6c8c9b346ed20f586
Change-Id: I6866f8521ed427d096f27da0a92d8b40e1099187
2021-07-19 21:03:26 -04:00
Jonathan Miranda
f5fee1a7d3 Revert "Use wallpaper colors for widgets in wallpaper change preview"
Revert "Implement generateColorsOverride from LocalColorExtractor"

Revert submission 15331418-colorcp

Reason for revert: Broke the build
Reverted Changes:
Ife80b07f9:Use wallpaper colors for widgets in wallpaper chan...
I1371eb787:Implement generateColorsOverride from LocalColorEx...

Bug: 194138049

// Using original change's merged-in tag to avoid clashing
Merged-In: I3fb76b6036cb909771b789eac15742df78c2c742
Merged-In: I4da9ad1cc88be251f97e86b6c8c9b346ed20f586

Change-Id: I3835dfb8efe745dc0a654712a5b1f68c4946f446
2021-07-20 00:44:42 +00:00
Brian Isganitis
74e6ced362 Use wallpaper colors for widgets in wallpaper change preview
Test: Widgets should adapt to wallpaper colors in launcher preview.
Bug: 192205054
Merged-In: I3fb76b6036cb909771b789eac15742df78c2c742
Merged-In: I4da9ad1cc88be251f97e86b6c8c9b346ed20f586
Change-Id: Ife80b07f99da913d65bff96fba2ccd76b0a2ed48
2021-07-19 16:58:20 -04: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
Brian Isganitis
4a76315805 Use wallpaper colors for widgets in wallpaper change preview
Test: Widgets should adapt to new wallpaper colors in launcher preview.
Bug: 191499358
Change-Id: I3fb76b6036cb909771b789eac15742df78c2c742
2021-06-21 19:18:17 -04:00
Chihhang Chuang
ccb71776c6 Apply the current system window insets to launcher preview
For wallpaper picker, the position of app icon on the wallpaper preview would match to the launcher after applying the wallpaper.

Wallpaper picker: https://screenshot.googleplex.com/JZazpgZLgzacZMZ.png
Launcher: https://screenshot.googleplex.com/9uTTQwdmcnFZ7Vi.png
Gesture mode: https://screenshot.googleplex.com/3YaKbBerYgtHBFb.png
3-button mode: https://screenshot.googleplex.com/7sA5nE3GmbuKf62.png

Fixes: 188539072
Test: Manually
Change-Id: I553000e6ae646207eb94fa33e97d00a3990043c8
2021-05-21 14:41:37 +08: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
9ab43772ab Adding support for using themed icons on workspace
Bug: 183641907
Test: Manual

Change-Id: Ieda7e73b3ae4dfe3009e3f23754aff5f8826a967
2021-05-03 20:00:38 -07:00
Tracy Zhou
6b79a3767d Do preview grid migration in a worker thread
Also remove USE_SURFACE_VIEW_FOR_PREVIEW flag

Fixes: 159755324
Test: manual
Change-Id: I6517c34911e217a69063226b01e4583194902f9c
(cherry picked from commit 633a4bdf57)
2020-06-25 21:05:04 +00:00
Tracy Zhou
7087a7bd91 Don't continue rendering preview screen when binder is dead
Fixes: 155365052
Test: manually quick switches between different grid options
Change-Id: I31dc14b0a50b5e3a5c81272b693303034fcf8b40
2020-05-13 14:06:05 -07:00
Tracy Zhou
0d880c876b Fade in grid preview
Fixes: 156406762
Test: https://drive.google.com/open?id=1JshUMjd1ASjHcAhnAiG3PEC-6wCRY7EE
Change-Id: I6a99650796fe64a6c11ee9fad6904b14373c6363
2020-05-12 14:43:44 -07:00
Tracy Zhou
bb353d3741 Switch to public API for surface view when rendering preview
Bug: 152003916
Test: Manual
Change-Id: I539ed2876d869366fa7635f4467d19e8488b7a1a
2020-04-06 14:39:52 -07:00