Commit Graph

27 Commits

Author SHA1 Message Date
Shamali P
992facdff3 Unregister widget prediction callback on clear
Noticed that predictor holds the registered callback and caused leak.
Using named listener classes for better stacks and also unregisters them

Bug: N/A
Flag: EXEMPT BUGFIX
Test: WidgetPredictionsRequesterTest
Change-Id: I94211ddbc77077c98b804827bb1cecdefe57703b
2025-03-06 14:25:13 -08:00
Sunny Goyal
5025b9ab04 Moving widgetFilter to dagger
Moving widget filtering to UI layer as it changes with surface

Bug: 361850561
Test: Presubmit
Flag: EXEMPT dagger
Change-Id: I9d9377540ca36873659cea4ecc91fb162d82cd44
2025-03-03 10:27:14 -08:00
Shamali P
f6efa25a49 Update widgetsModel to return pickable vs all widgets separately.
Earlier wallpaper preview was reading widgets that were eligible for
displaying in picker, which means widgets that are marked as hidden in
picker wouldn't show up in wallpaper preview.

This fix updates widgets model to maintain map of all widgets (instead of just pickable widgets like before), so that the existing `getWidgetsByComponentKey` function used by wallpaper preview can see all widgets. And, updates picker specific methods to use separate functions (suffixed `forPicker` that filter out picker ineligible widgets when read by picker code).

Bug: 385695615
Test: WidgetsModelTest, WidgetsPredictionUpdateTaskTest and demo
Flag: EXEMPT BUGFIX
Change-Id: I59efe38be0ce1f8a956ba4be42fb6e8b48b5d323
2025-02-20 14:13:16 -08:00
Shamali P
2e1b51c54b Support exclusion widget category filter in the widget picker
The newly added NOT_KEYGUARD category enables hosts that shows all
widgets to let widgets opt out from being displayed in keyguard like
surfaces.

Bug: 394047125
Test: Unit tests and support app
Flag: EXEMPT bugfix

Change-Id: Ibaab0c8a052700b77289cd571bca33e3d96fa09f
2025-02-03 14:33:20 +00:00
Johannes Gallmann
f47df1f60a Merge "Use FlingOnBackAnimationCallback for predictive back" into main 2024-11-11 08:29:47 +00:00
Shamali P
ea078cb647 Add a resource override for providing default widgets filter.
The implementation in this CL is no-op i.e. all widgets will be shown

Bug: 356127021
Flag: com.android.launcher3.enable_tiered_widgets_by_default_in_picker
Test: Verified with other child cls
Change-Id: I0a6f8973dc8ec58fd87d29b3f291b5e290ea988d
2024-11-04 22:17:23 +00:00
Johannes Gallmann
600c1af779 Use FlingOnBackAnimationCallback for predictive back
Use FlingOnBackAnimationCallback to get automatically interpolated progress and out-of-the-box support for back gesture flings.

Bug: 362938401
Test: Manual, i.e. testing launcher predictive back cases (all apps, widget-picker)
Flag: com.android.window.flags.predictive_back_timestamp_api
Change-Id: I35806dbf005eb6fce97327d26c1e75bca60c2c77
2024-10-30 13:32:15 +00:00
Treehugger Robot
8ffec48bf7 Merge "WidgetPicker - enable enterprise string cache in standalone activity." into main 2024-09-10 00:10:01 +00:00
Zak Cohen
7493f450f3 WidgetPicker - enable enterprise string cache in standalone activity.
The WidgetPickerActivity wasn't exposing a string cache for enterprise
overrideable strings, meaning that default fallback messages were showing
when the picker was in standalone (not in the launcher) mode.

Bug: 358002534
Test: Manual
Flag: EXEMPT bug fix

Change-Id: I67ccd46370708fb70a3a5233929a9c3b33c312f7
2024-09-06 14:35:20 -07:00
Fengjiang Li
1f25f6405c [Predictive Back] Clean up flags
Fix: 270614790
Flag: NONE - clean up flag
Test: presubmit
Change-Id: I956ce6067dca5d2517b45046ae8a392df1023e49
2024-08-29 13:38:05 -07:00
Shamali P
66614049eb Update references that wrote widget data to popup data provider
Migrates to write to widget picker data provider instead

Test: Existing tests
Flag: EXEMPT minor refactoring
Bug: 353347512
Change-Id: I1735151e133db0358dfd4f7fa824c6bc7d792307
2024-07-22 23:58:04 +00:00
Shamali P
54bd36ef81 Move out picker related methods from widgets model
* The WidgetsBaseEntry and related types are specific to picker UI.
So, moved them to a entry builder class.

Bug: 353347512
Flag: EXEMPT BUGFIX
Test: Unit test
Change-Id: I42b3083b42ee03dc8d548e7464689ea270a36f22
2024-07-18 18:35:19 +00:00
Shamali P
8654ff0116 Set default widgets and all widgets separately from standalone activity
Bug: 347288851
Flag: EXEMPT standalone picker
Test: Manual
Change-Id: I4eaeb7cb44b8b9c4187f7cf8fdc1b80143bb322e
2024-07-17 22:56:30 +00:00
Shamali Patwa
d16ea2650e Align predictive back in standalone picker activity
Bug: 346332606
Test: Manual
Flag: EXEMPT BUGFIX
Change-Id: I34882389029a5f095ab8d910791f7be34f7b8355
2024-07-11 13:03:55 +00:00
Shamali P
96ebf67b9f Update the title and description provided by intent params.
Bug: 347288851
Flag: EXEMPT flagged in sys ui
Test: Manual (automated covered in b/339716822)
Change-Id: I71f21bc48fd03dbbe2b3804b7fcade5940606917
2024-07-03 15:49:32 +00:00
Zak Cohen
a0a810daac WidgetPicker - allow user ids to be passed as filter arguments
Bug: 330377706
Test: adb shell am start -n com.google.android.apps.nexuslauncher/com.android.launcher3.WidgetPickerActivity --eial filtered_user_ids 1
0  check that WP doesn't show up
Flag: com.android.systemui.communal_hub

Change-Id: I375545190839101681a037a4481bf4cf92128d33
2024-07-02 15:07:01 -07:00
Shamali P
558afdafe2 [part 2] Update standalone picker to align widget loading and animations
In usual picker, widgets are already available before picker opens, so,
the work that happens during animations doesn't interrupt animations
on the scale it interrupt animations in standalone picker.

Bug: 346341156
Flag: EXEMPT bugfix
Test: Manual / see before after video
Change-Id: I7c8701447bd519b306799b28341d8f2f03daf59f
2024-06-24 16:58:32 +00:00
Shamali P
77e42868da Consider WidgetSections for suggestions in standalone picker
This cl address the problem for standalone picker (follow up to match
ag/27720721) to ensure widgets that aren't in section of their owning
package didn't appear in suggestions

Bug: 345520128
Test: Unit tests
Flag: EXEMPT bugfix
Change-Id: Ia0ef96c5be77db56b84c76ace498125d07f4be42
2024-06-17 20:02:18 +00:00
Shamali P
277a4f9d78 Use just the preview for drag and drop in the standalone activity
Bug: N/A
Test: Manual
Flag: EXEMPT bugfix
Change-Id: I62c42b649e720826979123ae2ff6c5e238fe59dc
2024-06-07 00:00:31 +00:00
Shamali P
7ae51788da Update the WidgetPickerActivity to display recommendations for hub host
- Accepts a ui_surface param of format "widgets{_hub}" and existing
widgets on the surface to be excluded from predictions
- Refactored the widgets prediction update task to extract reusable
logic that maps the predictions to widget items and reused it.

http://screencast/cast/NjE1MTA5MDI0NzU2NTMxMnwzMGE3NTMwNi1hZg

Bug: 326092660
Test: WidgetsPredictionHelperTest and see screencast above.
Flag: N/A
Change-Id: I6ceeb752c167893bab4ed496cedc5e8081e1b950
2024-04-01 20:16:37 +00:00
Will Leshner
0467404c25 Tweak WidgetPickerActivity size filtering.
Better conform to documentation about how to use widget sizes when
filtering for sizes in WidgetPickerActivity.

Bug: 322191186
Test: atest Launcher3Tests
Flag: NA
Change-Id: I4239e64dd620e00a3c55046bfb66fe3099336aac
2024-02-22 12:50:50 -08:00
Will Leshner
afe715a64b Add widget category filter to WidgetPickerActivity.
The category filter can be added to the intent used to show the widget
picker activity.

Bug: 314804170
Test: manually
Flag: NA
Change-Id: I1c2006e23fb5cf076166f7c376298527e47d2e9e
2024-02-11 15:31:00 -08:00
Will Leshner
f0be49e693 Filter widgets in widget picker activity by size.
Bug: 322191186
Test: atest Launcher3Tests
Flag: NA

Change-Id: I003e05cc16ae576cda07d249d036d2f9dbacdcc2
2024-01-30 15:42:00 -08:00
Shamali P
ddde81f4c0 Filter shortcuts in the widget picker activity.
In its current state the WidgetPickerActivity only allows adding widget
items, so to match the state, updated it to show only widgets.

manual test - https://screen/cast/NDUxMjg1NjI0MTM0MDQxNnwxMzE4MzNhOS1mZg

Bug: 320495335
Test: atest Launcher3Tests
Flag: N/A
Change-Id: Ifa75f457219efef49e104efc428d369187db2710
2024-01-16 21:19:16 +00:00
Shamali P
790d599d2a Add long click listener to the widget picker activity
The listener allows us to drag and drop widgets outside the launcher.

Bug: 315209740
Test: atest Launcher3Tests
Flag: NA

Change-Id: Iafc6e8903ea4f32540df30152b35d9eb7e98c6d6
2023-12-20 14:30:44 +00:00
Will Leshner
531fc4985b Handle widget taps in WidgetPickerActivity.
Bug: 307306823
Test: atest Launcher3Tests
Flag: NA
Change-Id: I05cd42eae91447cfe99165096a735f6e04257203
2023-12-07 13:53:45 -08:00
Will Leshner
9dce65e05a Show Launcher's widget picker in an activity.
Bug: 307306823
Test: atest Launcher3Tests
Flag: NA

Change-Id: I28ef731abcdf1bd44c66366d42a135912dbcc5be
2023-12-05 13:12:05 -08:00