Commit Graph

20069 Commits

Author SHA1 Message Date
Federico Baron
df328e5dfa Add logs and prevent collissions when adding items
-AddWorkspaceItemsTask can add multiple items to the same position, we
avoid that here by adding each item to the database before processing
the next item.
-We add more logs to InstallSessionHelper to be able to check who the
installer is

Bug: 432237485, 425754534
Test: AddWorkspaceItemsTaskTest
Flag: EXEMPT bugfix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4b439e999734852a017ce662543b4789b36e0e3b)
Merged-In: I2d238f3eb27734ab9cb723e2fe9d6752c5921dd1
Change-Id: I2d238f3eb27734ab9cb723e2fe9d6752c5921dd1
2025-07-27 22:00:10 -07: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
Brandon Dayauon
ff0e4ec6bb Log event when windowInsetsController is null
Set up ww logging for this case.

bug: 425502603
Test: presubmit and made sure its loggable by setting null
Flag: EXEMPT adding log for ww
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:32ac0c244589cedd65320d68c0c7bcbe3f5939f1)
Merged-In: I800bfc4c902bbdedee770507624b7628489ccc3b
Change-Id: I800bfc4c902bbdedee770507624b7628489ccc3b
2025-07-15 19:57:45 -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 6624691c50)
(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
Federico Baron
361f5a435b Prevent LoaderTask from running during setup wizard
This was causing a bug where simple mode would trigger loadertask to
run, which then led to other errors since it ran prematurely

Bug: 417395120
Test: Manual
Flag: EXEMPT bugfix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c98d20425bf1c4e5d3a1935f11802a16e2d0aa6f)
Merged-In: Ib73e3d7849c5b3d887cbca0fbc8a386ed553f751
Change-Id: Ib73e3d7849c5b3d887cbca0fbc8a386ed553f751
2025-07-09 19:28:23 -07:00
Brandon Dayauon
d0937610f9 Revert "Remove ScrimView's drawing controller when resetting All Apps."
This reverts commit 288006fe11.

Reason for revert: b/428195031

Bug: 426397329
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:f9c3fd3eba6150092e2b1867428e0e5744af00c3)
Merged-In: I58b58e35276a57ffe2e8d9a1f8c916e5d1be9eb0
Change-Id: I58b58e35276a57ffe2e8d9a1f8c916e5d1be9eb0
2025-07-01 20:10:32 -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
Andy Wickham
1fa500b17e Remove ScrimView's drawing controller when resetting All Apps.
Previously broken flow:
 - Open All Apps on inner screen
   - Drawing controller is set to the AllApps container
 - Close All Apps (resting state becomes NORMAL)
 - Fold, unlock
   - Because we are still in NORMAL, the drawing controller was not
     updated. Therefore when the ScrimView draws (alongside all other
     views due to Launcher starting), it asks the inner screen's All
     Apps container to render its panel on the scrim.

The fix is to remove the drawing controller when All Apps resets,
thereby avoiding trying to draw on the scrim in the first place. The
drawing controller is updated upon the next transition to All Apps,
as usual.

Bug: 426397329
Test: Manual: https://drive.google.com/file/d/1l9qAIkrgFalcO5DABOEIRX1Po3POYzab/view?usp=sharing&resourcekey=0-ccU6q2fbYE6y87ehIKdbEQ
Flag: com.android.launcher3.all_apps_sheet_for_handheld
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:288006fe11bdaec4bd229999619dd7097806620a)
Merged-In: I0a4872e6bd668583d08848a8b9c5f0f1389c4f0f
Change-Id: I0a4872e6bd668583d08848a8b9c5f0f1389c4f0f
2025-06-26 19:46:15 -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
Sebastian Franco
cc18ee380e Do not modify the original item info when adding a new item in Worksapce
Fix: 418114270
Test: NA
Flag: EXEMPT bug fix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:dbd6f0d18f69d5d33862aaad015c4c8c5907fb46)
Merged-In: Ic0dd00da4f363868a1c2abeeb736b86f6f706631
Change-Id: Ic0dd00da4f363868a1c2abeeb736b86f6f706631
2025-06-25 21:04:11 -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
Shamali Patwa
f8d94de717 Merge changes from topic "p-shortcut-impl" into main
* changes:
  Widget Picker: Update the launcher integration to support shortcuts
  Widget Picker: Update UI layer to support shortcuts
  Widget Picker: Update data layer to support shortcuts
2025-06-09 11:02:42 -07:00
Treehugger Robot
f23a5060ee Merge "Do not enter desktop mode if the existing fullscreen task is refocused" into main 2025-06-08 19:10:57 -07:00
shamalip
077234aff5 Widget Picker: Update the launcher integration to support shortcuts
Updates drag and drop, tap to add and preview related code.

Bug: 370950552
Flag: com.android.launcher3.enable_widget_picker_refactor
Test: Drag and drop shortcuts on home screen
Change-Id: Iccfe329296dbf4b0770628e77df5cd9b42ac9b21
2025-06-08 20:40:21 +00:00
shamalip
bb86bde284 Widget Picker: Update data layer to support shortcuts
Adds sealed class for widget info that can contain either appwidget info
or shortcut info.

Also kept the aosp config.xml empty to keep everything eligible for
 featured

Bug: 370950552
Flag: com.android.launcher3.enable_widget_picker_refactor
Test: Open picker for homescreen and lockscreen hosts
Change-Id: Iceafc2c1234063b16421f90bf00cf96114e9870c
2025-06-08 20:10:53 +00:00
Treehugger Robot
fb0f2ff41d Merge "Add remove system shortcut to folder items" into main 2025-06-07 14:08:44 -07:00
Treehugger Robot
4047867239 Merge "Implement InMemoryLauncherPrefs backed by InMemorySharedPreferences." into main 2025-06-06 17:20:16 -07:00
Federico Baron
ffd3ced53f Add remove system shortcut to folder items
Bug: 419289205
Test: NexusLauncherImageTests
Flag: com.android.launcher3.enable_long_press_remove_shortcut
Change-Id: I4bba230d13696d8d9dc02e232f8a302ae9e893e0
2025-06-06 22:02:32 +00:00
Treehugger Robot
5135248ada Merge "Fix incorrect talkback announcement for app -> home" into main 2025-06-06 14:35:25 -07:00
Brian Isganitis
8f8e82c02d Implement InMemoryLauncherPrefs backed by InMemorySharedPreferences.
Flag: EXEMPT bugfix
Bug: 415787583
Test: InMemoryLauncherPrefsTest
Change-Id: I507d02e45c7ace1cf6cb8df7018f6767e1fdb8af
2025-06-06 17:11:16 -04:00
Schneider Victor-Tulias
672c8a10e4 Fix incorrect talkback announcement for app -> home
This change removes the talkback announcement for the background app LauncherState, which defaulted to "Recent apps".

Flag: EXEMPT bug fix
Fixes: 418854152
Test: attempted home/overview/quick switch gestures from home and app
Change-Id: I1f390902dfddd2e8576743dbbddce65121690f14
2025-06-06 15:03:51 -04:00
Toshiki Kikuchi
4e9affa253 Do not enter desktop mode if the existing fullscreen task is refocused
This CL prevents taskbar from forcefully moving the existing fullscreen
task to desktop on desktop-first display.
On desktop-first displays, we want to keep the current windowing mode
when its taskbar app icon is clicked.

Flag: com.android.window.flags.enable_desktop_first_fullscreen_refocus_bugfix
Bug: 420499923
Test: TaskbarRecentAppsControllerTest
Change-Id: I5e5c950d2e7bd25762eaddad94c57a4bf29ee800
2025-06-06 09:58:42 +09:00
Toni Barzic
2d0ca1a195 Move logic for stable scale factor to DisplayController
When selecting grid size to use for desktop, size breakpoints are
compared to the display dimensions with "stable" device density.
Expose the scale factor that needs to be applied to dimensions
provided in spec via DisplayController::Info, so it can be more easily
faked in tests.

Bug: 375643744
Test: atest DeviceProfileDumpTest
Flag: com.android.launcher3.enable_scalability_for_desktop_experience
Change-Id: I836430cc052f72c0f89b6cdd5ab5309a3482d94e
2025-06-05 05:16:23 +00:00
Treehugger Robot
1c7238e383 Merge "Using a single preview sandbox perview instead of recreating it everytime" into main 2025-06-03 19:34:12 -07:00
Treehugger Robot
61b5bd5502 Merge "Let Workspace handle ACTION_CANCEL and ACTION_UP events." into main 2025-06-03 18:19:54 -07:00
Matthew Mourgos
0fed92d45c Merge "Launch home intent on workspace click/tap" into main 2025-06-03 16:05:43 -07:00
Stefan Andonian
73a32b607d Let Workspace handle ACTION_CANCEL and ACTION_UP events.
This will let it settle correctly if opening the all apps page during a
swipe or snap.

Bug: 415773533
Test: Verified that this works well locally. This is easy to reproduce.
Flag: EXEMPT bug fix
Change-Id: I74131b8d65cbc4466de4fed8638f8da7347aef49
2025-06-03 22:56:52 +00:00
Adnan Begovic
b00e10d899 launcher3: Change promise icon id key to not be backed up.
LauncherPrefs wrapper adds a backup when using backedUpItem for promise icon ids.
Disable backup and restore for this preference as it could cause unwanted situations

Bug: 419426642
Test: None yet
Flag: EXEMPT Bug fix
Change-Id: I4cfef8c587b951ee6b4753e5f2e2a45409294ef3
2025-06-03 12:49:37 -07:00
Adnan Begovic
0e8be78021 launcher3: Handle case where install session could be invalid.
If the install session comes back as invalid, we can fail to add
a promise icon which leads to icons not showing up on the workspace.

Bug: 419426642
Test: None yet
Flag: EXEMPT Bug fix
Change-Id: I592948eb2b60c2249bb5b141d499d1d5ea01aebc
2025-06-03 12:48:54 -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
Matthew Mourgos
606677a48a Launch home intent on workspace click/tap
When an emtpy area of the workspace is tapped/clicked, and tasks are
shown on top of the home screen, launch an Intent to bring the Home
activity to the front. This behavior is intended for the desktop form
factor.

Bug: 419565810
Test: Manual and onWorkspaceTouch_whenHomeBehindDesktop_launchesHomeIntent
Flag: com.android.window.flags.show_home_behind_desktop
Change-Id: Id66e7700873db8d11addf2b5283b4ac126acde5f
2025-06-03 09:55:53 -07:00
Treehugger Robot
c1b78276cc Merge "Add remove shortcut to long press menu" into main 2025-06-03 01:54:01 -07:00
Shamali Patwa
8f9d26d3ee Merge "Move host constraint builder logic to the concrete wrapper implementation." into main 2025-06-03 00:28:40 -07:00
Treehugger Robot
7860bd9db3 Merge "Adding interfaces for long press menu updates" into main 2025-06-02 23:58:31 -07:00
Shamali Patwa
a1c4ff596d Move host constraint builder logic to the concrete wrapper implementation.
Fix build.


Bug: 408283627
Flag: EXEMPT independent module
Test: See demo
Change-Id: Ic15eb61eaa76ee9eeb1680dfe90cb89442f7d159
2025-06-02 22:34:00 -07:00
Shamali Patwa
622eb1d043 Listen to and handle drag and drop for homescreen and lockscreen widgets in widget picker activity wrapper.
Bug: 408283627
Flag: com.android.launcher3.enable_widget_picker_refactor
Test: See demo in comments.
Change-Id: Idcc94d35ca02cb31ce191bc99b5e21f5f0a395c4
2025-06-02 18:47:08 -07:00
Shamali Patwa
5a02a996c6 Add widget picker drag and add item listeners.
These handle those two operations for home screen when widget picker is
opened as a separate activity.

Bug: 408283627
Flag: com.android.launcher3.enable_widget_picker_refactor
Test: Not applicable.
Test: See demo in comments
Change-Id: I37f626b57610379a8af4e7a229406ed0656806c2
2025-06-02 18:46:45 -07:00
Federico Baron
fc68cd402a Adding interfaces for long press menu updates
Bug: 416087474
Test: EXEMPT adding interfaces only
Flag: EXEMPT adding interfaces only
Change-Id: I50d73b655622a249ce293e1dc456b6a2a27fe810
2025-06-02 17:44:13 -07:00
Federico Baron
9290666f24 Add remove shortcut to long press menu
Flag: com.android.launcher3.enable_long_press_remove_shortcut
Test: NexusLauncherImageTests
Bug: 419289205
Change-Id: I44f12a47f48179be36dea8052080fd61fff05357
2025-06-02 17:43:37 -07:00
Sebastián Franco
b11936e0f5 Merge "Moving AllApps device profile variables to their own class" into main 2025-06-02 13:34:10 -07:00
Andy Wickham
eeaebacf66 Merge "Fix reverse interpolation when closing All Apps." into main 2025-06-02 12:57:02 -07:00
Sunny Goyal
81207acbbf Merge "Fixing widget size incorreectly updated during preview" into main 2025-06-02 12:09:51 -07:00
Sunny Goyal
f6b98ada0d Fixing widget size incorreectly updated during preview
Bug: 408934352
Bug: 228328759
Flag: EXEMPT bugfix
Test: Manually verified
Change-Id: Ie69e67cfaee6231da3971323ae98d2b3ab514c0d
2025-06-02 09:40:35 -07:00
Uwais Ashraf
3883ac96ff Merge "Change bg Coroutine dispatchers to use single thread." into main 2025-06-02 02:32:57 -07:00
Treehugger Robot
a6bab0b412 Merge "Updating launcher preview generation" into main 2025-05-30 19:19:38 -07:00
Treehugger Robot
2f9d81a9d7 Merge "Converting FastBitmapDrawable to kotlin" into main 2025-05-30 17:38:05 -07:00
Treehugger Robot
17d69d9db5 Merge "Use pixels as breakpoints for non-desktop grid sizes" into main 2025-05-30 17:29:53 -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
Andy Wickham
e8526c5593 Fix reverse interpolation when closing All Apps.
This was inadvertently reverted in ag/33712864.

Bug: 415247657
Test: Manual
Flag: com.android.launcher3.all_apps_sheet_for_handheld
Change-Id: Iac3be94342e7def142e31bac34ab9043e870c305
2025-05-30 16:17:18 -07:00