Commit Graph
9 Commits
Author SHA1 Message Date
John Andrew Camu 0677ba2420 fix: crashes on android 8 (#6978) 2026-07-11 14:26:02 +08:00
Sebastian Franco 346f5d7890 Actually updating the LayoutParams in the LauncherPreview
When cleaning the code for ag/34436200 I accidentally removed
the fixing line which was removing the old setLayoutParams
for the new one.

Fix: 431696619
Fix: 429081966
Test: Manul test
Flag: EXEMPT bug fix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:fa233150bace5dc6a23272301065d0b35080c215)
Merged-In: I2cca194064b30a61eeacb6a376989c71b3522e87
Change-Id: I2cca194064b30a61eeacb6a376989c71b3522e87
2025-07-15 19:57:54 -07:00
Sebastian Franco d24bc7c690 Centering preview view using gravity Center
We didn't bother to center the view because it just one view that
matches the parent view, the problem is that the peview view is
bigger than it's parent, this is by design so that the preview
matches the full screen and looks the same as the real Launcher.
We then scale the preview view to match the visualization space.

The problem is that the logic that position a view in FrameLayot
doesn't account for children views bigger than itself so in
RTL the view is not "centered" or it doesn't start where we expect
it to start. By using gravity = CENTER it does account correclty
for bigger views.

Fix: 429081966
Test: GridPreviewTest
Flag: EXEMPT bug fix
(cherry picked from commit 6624691c50b29dabb706e52d5bd09d88b257015b)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:e5e32f0ef771417b9bf29a71d6d7fd7b47067dd1)
Merged-In: I1e75087ca68dd3180b0a9f11d9403eafb892391a
Change-Id: I1e75087ca68dd3180b0a9f11d9403eafb892391a
2025-07-11 17:35:23 -07:00
Sunny Goyal 1df1ab60f2 Preventing duplicate inflation during preview initialization
Bug: 421611580
Bug: 426496161
Bug: 427607114
Flag: EXEMPT bugfix
Test: Verified manually
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:991ceca0ae576169399f65000f99293f4ae515ca)
Merged-In: I71139c5b61025ca30cfe8e70a5b09042f7078225
Change-Id: I71139c5b61025ca30cfe8e70a5b09042f7078225
2025-06-26 19:46:25 -07:00
Fengjiang Li 0b844fd156 [Memory Leak] Prevent leak of PreviewSurfaceRenderer and
SurfaceControllHost from IDP's listener

Bug: 427483331
Test: manual
Flag: NONE - released code
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4dda0a2cd9684eeccee7d1836f8ea98b94187998)
Merged-In: I5a47876bb77d65c013478ffb88976878ccb23741
Change-Id: I5a47876bb77d65c013478ffb88976878ccb23741
2025-06-26 19:46:06 -07:00
Sunny Goyal 798ff095e2 Only destroy LauncherPreviewRenderer when a new renderer is ready
> Previously the old renderer was destroed but was still being used until the new renderer was loading

Bug: 426034253
Flag: EXEMPT bugfix
Test: Manually using profiler, Presubmit
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:67fd6c8e17ae7df3b60a092de63b0ef1eb0ba9b1)
Merged-In: I291ea6737d4ed072eb04d007438709f9081f4075
Change-Id: I291ea6737d4ed072eb04d007438709f9081f4075
2025-06-26 19:45:56 -07:00
Fengjiang Li 2594314a58 Fix crash from PreviewSurfaceRenderer#recreatePreviewRenderer()
This is a forward fix of ag/33841218.

IllegalStateException is thrown because getResources() has already been
called in ContextThemeWrapper.applyOverrideConfiguration().

We should avoid getting configuration from ContextThemeWrapper, which
will generate ContextThemeWrapper#mResources and trigger
IllegalStateException from subsequent
ContextThemeWrapper#applyOverrideConfiguration().

Instead, we should get configuration from mPreviewContext which is
ContextWrapper.

Fix: 423802089
Flag: NONE - released code
Test: manual
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:0c218842940c0920b88c9eb2ac30ef76a16edf08)
Merged-In: Ic3d29d7bb2cbf3483e757e5a90ac8d8989adc613
Change-Id: Ic3d29d7bb2cbf3483e757e5a90ac8d8989adc613
2025-06-16 16:44:26 -07:00
Sunny Goyal 8736534932 Using a single preview sandbox perview instead of recreating it everytime
> Reusing the model binding system instead of using a custom implementation
> Reusing the existing grid update API for previews instead of custom implementation
> Any new functionality is protected via the same flag as the grid update path

Bug: 420997234
Bug: 397782741
Flag: EXEMPT refactor
Test: atest GridPreviewTest

Change-Id: Iaf8f34568618f98cc11138ce3fa327707c5f6f1a
2025-06-03 11:40:05 -07:00
Sunny Goyal bf49baab09 Updating launcher preview generation
> Moving classes to a separate package
> Extracting PreviewContext outside of renderer
> Always loading the sandbox instead of loading real model followed by a sandbox
> Binding LoaderTask using params so that it can be customized

Bug: 420997234
Flag: EXEMPT refactor
Test: Presubmit

Change-Id: Idf45eaba9d8309cb55b47847d8e3686cbb6c0a8e
2025-05-30 16:44:49 -07:00