Commit Graph

283 Commits

Author SHA1 Message Date
Uwais Ashraf
62495bbda7 TaskRepository performance improvement
This CL improves Overview's performance by preventing multiple thumbnail and icon fetches for visible tasks. It introduces manual cancellation and removal of tasks that are no longer visible to prevent fetching and listening to changes in such tasks.
- Renamed 'augmentedTasks' to 'tasks' and updated it to be a MutableStateFlow with a map of Task Id and Task.
- When a new task becomes visible, the task is added to a list of requests along with a Job that fetches the Thumbnail and Icon. Additionally, 'taskVisualChangesDelegated' is added and removed for that task per request.
- When a task becomes invisible, the Job is canceled to prevent fetching the Thumbnail and Icon. The thumbnail and icon are cleared from the list of tasks, and the listener from 'taskVisualChangesDelegated' is unregistered.
- The list of tasks is updated when the list of visible tasks changes and a new thumbnail or icon is updated. This list is also updated when a force fresh from getAllTaskData is requested.

Fix: 373361888
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Test: TasksRepositoryTest
Change-Id: Ifd9c54fdfcb85463c043c121fb829dec3e9faedc
2024-10-21 14:34:12 +00:00
Jagrut Desai
c1227779a6 Enable TaskbarEduTooltipControllerTest
Test: Presubmit
Bug: 374312336
Flag: EXEMPT enabling ignored test
Change-Id: I606ab909d5d9b366674492855a940a0f6cc77a86
2024-10-18 09:20:41 -07:00
Sunny Goyal
3c873420e8 Moving SettingsChangeLogger back to MainThreadInitializedObject
SettingsChangeLogger depends on DisplayController which needs to be migrated
first. Otherwise it introduces a deadlock when initializing DisplayController
in constructor

Bug: 373557167
Test: Manual (will merge automated tests once all culprits are resolved)
Flag: EXEMPT dagger
Change-Id: I2386812693e470bcee1a64d5cec49c03fd36f230
2024-10-17 09:51:59 -07:00
Kevin Lim
9c5d8a2059 Merge "[Tests] Clear MAIN_EXECUTOR in NavHandleLongPressInputConsumerTest#tearDown" into main 2024-10-16 00:50:55 +00:00
Kevin Lim
f36375d907 [Tests] Clear MAIN_EXECUTOR in
NavHandleLongPressInputConsumerTest#tearDown

Attempt at fixing flaky tests

Bug: b/359911511,b/355232772
Flag: EXEMPT Test change
Test: NavHandleLongPressInputConsumerTest
Change-Id: I8ea91f732e91b1a7df4b2e2816dc70e35f14d504
2024-10-15 18:32:35 +00:00
Brian Isganitis
dc4f56040a Merge "Migrate to FakeLauncherPrefs for Taskbar unit tests." into main 2024-10-15 17:08:35 +00:00
Jordan Silva
d2867286ff Merge "Update OverviewCommandHelper to use Executors.MAIN to reduce the percentage of missed frames" into main 2024-10-15 16:52:05 +00:00
Liran Binyamin
cfd3326efd Merge "Update taskbar window size for flyout" into main 2024-10-15 13:26:11 +00:00
Andy Wickham
9605643883 Merge "Migrate Contextual Search code to AOSP" into main 2024-10-15 00:47:02 +00:00
Liran Binyamin
c33fe5bd56 Update taskbar window size for flyout
This change updates the taskbar window size after the flyout view
has measured itself. This ensure that the taskbar window is tall
enough to display the entire flyout.

When the flyout is removed we reset the taskbar window size.

Flag: com.android.wm.shell.enable_bubble_bar
Bug: 277815200
Test: builds successfully and tested manually -- code is not wired up
Change-Id: I5e8618e57443212e1c4f19ab20d1542ae2d1b865
2024-10-14 19:59:59 -04:00
Brian Isganitis
a3ec98e06d Migrate to FakeLauncherPrefs for Taskbar unit tests.
Deprecates the preference rules.

Flag: TEST_ONLY
Test: go/testedequals
Bug: 230027385
Change-Id: Ic3a9e589b556232d196942d687e2e2bddc000877
2024-10-14 18:13:23 -04:00
Jordan Silva
7eae20bcb1 Update OverviewCommandHelper to use Executors.MAIN to reduce the percentage of missed frames
This change will reduce the increase in the amount of missed frames measured by crystalball. I believe coroutines launch is competing with Executors.MAIN for scheduling and running tasks in the main thread, thus the increase in missing frames.

Fix: 366077002
Flag: com.android.launcher3.enable_overview_command_helper_timeout
Test: OverviewCommandHelperTest
Test: android.platform.test.scenario.launcher.CloseApp3ButtonModeMicrobenchmark#testOpenLauncher
Test: atp:v2/android-crystalball-eng/health/microbench/launcher/main/launcher-action-suite
Change-Id: I4477879d4f065ec3883f2c3cb3ef044e973ce0cb
2024-10-14 17:46:14 +00:00
Brian Isganitis
805cadc1e7 Fix package name for TaskbarEduTooltipControllerTest
Change-Id: I12795bb8506f44f7bb6af6176f2a647b5f099e50
Flag: TEST_ONLY
Bug: No
Test: go/testedequals
2024-10-14 16:27:19 +00:00
Brian Isganitis
bdc5dd5c86 Merge "Run Taskbar controller tests on VirtualDisplay." into main 2024-10-11 21:03:12 +00:00
Andy Wickham
0b936727d6 Migrate Contextual Search code to AOSP
- Adds ContextualSearchInvoker
 - Adds ContextualSearchStateManager
 - Adds ContextualSearchHapticManager

Example output from ContextualSearchStateManager
in TouchInteractionService dump:
https://paste.googleplex.com/5536017815961600

Bug: 353715553
Test: go/contextual-search-entrypoints-test-plan
Flag: EXEMPT moving code from vendor to aosp

Change-Id: I8253294d6be427e0fc29d6052994de0c03f05a3e
2024-10-10 21:03:42 +00:00
Brian Isganitis
066f5adcf6 Run Taskbar controller tests on VirtualDisplay.
Flag: TEST_ONLY
Test: go/testedequals
Bug: 369641781
Change-Id: Id53f420e7edc1779da9eb7647644ffffb74e67b3
2024-10-10 19:13:40 +00:00
Uwais Ashraf
71fb897f39 Merge "Adds View screenshot tests for TaskThumbnailView." into main 2024-10-10 11:38:19 +00:00
Ats Jenk
d137856e26 Merge "Update bubble bar swipe logic" into main 2024-10-09 21:32:43 +00:00
Ats Jenk
6570ac750f Update bubble bar swipe logic
After changes following swipe interactions are available for the bubble
bar:
1. stashed handle
- swipe up to show bubble bar, after swipe reaches unstash threshold, we
  show the bubble bar
- swipe down to stash bubble bar in the same gesture (without lifting
  finger), do this when swipe moves back below unstash threshold
- expand bubble bar on finger lifted when currently above unstash
  threshold

2. collapsed bubble bar (used in home or overview)
- swipe up and release over unstash threshold to expand bubble bar
- bubble bar can't be swiped down to stash it

3. expanded bubble bar
- no swipe interactions available

Bug: 371229061
Flag: com.android.wm.shell.enable_bubble_bar
Test: BubbleBarSwipeControllerTest
Test: manually test:
  - stashed bubble bar:
      - swipe up and back down => bubble bar shown and stashed
      - swipe up slightly and release => bubble bar not shown
      - swipe up and release => bubble bar shown, expands on release
  - collapsed bubble bar:
      - swipe down => no action
      - swipe up slightly => no action
      - swipe up and release => bar expands on release
Change-Id: I42aa59dc288446603e06a3d02419be38cf17fa1f
2024-10-08 16:17:32 -07:00
Brian Isganitis
46b20441e4 Migrate Taskbar tests to use SandboxApplication.
This class has even better sandboxing and is a TestRule, making it easy to tear down singletons.

Flag: TEST_ONLY
Fix: 369504330
Test: go/testedequals
Change-Id: I86fbfecc275da536ab745d61bef8b9bebb28379c
2024-10-08 16:34:44 +00:00
Liran Binyamin
9c3c7cc3e2 Merge "Store the flyout in BubbleBarBubble" into main 2024-10-08 13:31:53 +00:00
Ats Jenk
ea6e59537e Merge changes I74af6a72,I603a67a8 into main
* changes:
  Animate bubble bar alpha when notif shade opens
  Set bubble bar invisible while stashed
2024-10-07 22:23:02 +00:00
Liran Binyamin
5e04f0960d Store the flyout in BubbleBarBubble
Extracts the flyout message from the bundle and stores it in
BubbleBarBubble.

Flag: com.android.wm.shell.enable_bubble_bar
Bug: 277815200
Test: builds successfully -- code is not wired up yet
Change-Id: I5e810290991b4ee638f43add4d6a6514edb167af
2024-10-07 16:57:08 -04:00
Tony Wickham
fc267fbd69 Merge "Don't invalidate swipe handler until parallel anim finishes" into main 2024-10-07 19:17:03 +00:00
Liran Binyamin
9b093db2f8 Merge "Rename bubble bar flyout fields" into main 2024-10-07 18:27:14 +00:00
Tony Wickham
ee98cd4bdf Don't invalidate swipe handler until parallel anim finishes
- When invalidateHandler() is called, it calls endRunningWindowAnim()
  which includes mParallelRunningAnim. This causes a jump if
  mParallelRunningAnim was not already finished, so we now wait to
  invalidate the handler after mParallelRunningAnim ends.

Flag: EXEMPT bugfix
Test: AbsSwipeUpHandlerTestCase (added two tests for this)
Fixes: 370208192
Change-Id: I37ed281a993b1d2fa3634754378314511f3295f0
2024-10-07 16:45:19 +00:00
Liran Binyamin
f44690bd69 Merge "Pass bubble flyout from wm shell to launcher" into main 2024-10-07 16:22:13 +00:00
Ats Jenk
df819b6145 Merge changes Iccb870b0,Ibea2dbe0 into main
* changes:
  Inject bubble controllers directly
  Allow injecting bubble controllers in taskbar test
2024-10-07 16:12:41 +00:00
Liran Binyamin
75675e123d Rename bubble bar flyout fields
Long term we'd like to use bubbles for any app, so this change
uses more general names instead of the chat-specific naming

Flag: com.android.wm.shell.enable_bubble_bar
Bug: 277815200
Test: built and tested on a device
Change-Id: Idec2aa7d9a8df5df0df49231e8871298084f8aa1
2024-10-07 10:37:55 -04:00
Schneider Victor-Tulias
12aff98cd8 Add a AbsSwipeUpHandlerTestCase for the RecentsWindowSwipeHandler
- Added RecentsWindowSwipeHandlerTestCase
- Slightly refactored AbsSwipeUpHandlerTestCase for simplicity

Flag: EXEMPT adding test code
Bug: 292269949
Test: RecentsWindowSwipeHandlerTestCase
Change-Id: Iacd8ff8261ad262d4645ba97c35d296050e61195
2024-10-04 13:37:01 -04:00
Ats Jenk
2166749190 Set bubble bar invisible while stashed
Update bubble bar visibility when it is stashed.
Ensures that if alpha is updated, it won't show up.

Bug: 345687278
Test: TransientBubbleStashController
Flag: com.android.wm.shell.enable_bubble_bar
Change-Id: I603a67a824a5cee0fb35de7c3f2dc98d9d2323ed
2024-10-03 15:33:38 -07:00
Ats Jenk
35b87d33b2 Inject bubble controllers directly
Replace injecting bubble controllers class with each controller
separately.c

Bug: 371017282
Test: TaskbarStashControllerTest
Flag: TEST_ONLY
Change-Id: Iccb870b0976b51fcd5a987cf208531da413921d1
2024-10-03 10:09:30 -07:00
Mady Mellor
2aedf52b8f Merge "If we're going to overview we might need to unstash" into main 2024-10-03 16:12:09 +00:00
Ats Jenk
936fec94bd Allow injecting bubble controllers in taskbar test
Update TaskbarUnitTestRule @InjectController annotation to support
injecting bubble controllers.
Bubble controllers are optional and only initialized if the feature flag
is enabled.
Add a test to check that bubble controllers are only initialized when
the flag is on.

Bug: 371017282
Test: TaskbarUnitTestRuleTest
Flag: TEST_ONLY
Change-Id: Ibea2dbe0db854d530ef93ac53204a361572fa5b2
2024-10-02 15:56:08 -07:00
Liran Binyamin
d8c3328d4d Pass bubble flyout from wm shell to launcher
Flag: com.android.wm.shell.enable_bubble_bar
Bug: 277815200
Test: atest BubbleBarViewAnimatorTest
Change-Id: I8666765937a491903c6fc042d2d629374be4c70d
2024-10-02 12:27:52 -04:00
Liran Binyamin
1663bb3004 Merge "Bubble bar flyout polish" into main 2024-10-02 16:15:53 +00:00
Uwais Ashraf
67d0d59caf Adds View screenshot tests for TaskThumbnailView.
Bug: 344800402
Test: TaskThumbnailViewScreenshotTest
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: If6530ea9dfe026589f05731d5362dc10f719fc70
2024-10-01 23:42:39 +00:00
Ats Jenk
da477af93d Fix comment in TransientBubbleStashControllerTest
Bug: 345488489
Change-Id: Ide38c1e36a0da53e9fcc7a5c6b0c3241eff24add
Test: na
Flag: DOCS_ONLY
2024-10-01 21:06:02 +00:00
Mady Mellor
fd6772ab84 If we're going to overview we might need to unstash
Flag: com.android.wm.shell.enable_bubble_bar
Test: atest NexusLauncherTests:PersistentBubbleStashControllerTest
Test: atest NexusLauncherTests:TransientBubbleStashControllerTest
Test: manual - swipe up to overview from home & from in an app, ensure
               bubble bar is unstashed
             - switch between home / overview / in app in transient
               and persistent taskbar to make sure things work
Bug: 368364143
Change-Id: I34c22b000d1fcc75489ea6da497f14def9649a20
2024-10-01 11:57:26 -07:00
Ats Jenk
da8487eb33 Merge "Update bubble stash test for transient taskbar" into main 2024-10-01 18:53:36 +00:00
Liran Binyamin
8bd8feb72d Bubble bar flyout polish
Animate the elevation of the flyout along with the expansion animation.
Also start revealing the triangle as soon as we're past the bubble bar.

Flag: com.android.wm.shell.enable_bubble_bar
Bug: 277815200
Test: atest BubbleBarFlyoutViewScreenshotTest
Test: atest BubbleBarFlyoutControllerTest
Change-Id: Ie7e27240ae3ab86f8e7c3f39aa1c80885cfdc98e
2024-10-01 12:06:36 -04:00
Ats Jenk
5464ce0084 Update bubble stash test for transient taskbar
Include unit test to check that view properties are set to expected
values at the end of an unstash animation.
Add tests to check that alpha for bubbles and background changes
separately during unstash and stash animations.

Bug: 345488489
Test: TransientBubbleStashControllerTest
Flag: com.android.wm.shell.enable_bubble_bar
Change-Id: Ifd10d4524128d42d23fe67c0eff2c4ae16d3b27b
2024-09-30 15:43:15 -07:00
vinayjoglekar
562ab4d188 Fixed split in Desktop windowing
When desktop windowing is enable and split is selected, during second app selection apps' scroll was far off on left. There were several things needed to fix this :
1. Hide DesktopTaskView during split select mode by changing splitAlpha
2. Fix min/max scroll calculation by excluding DesktopTaskView in split select mode
3. Exclude DesktopTaskView in updateGridProperties row length calcualtion

Testing: Manually needed to test multiple scenarios
1. Split focused task.
2. Split Even/Odd tasks in top and bottom rows.
3. Split tasks from home screen
4. Split and rotate screen.
5. Split from app icon chip

Test: SplitSelectStateControllerTest, Manual
BUG: 330342294
FIX: 330342294
Flag: com.android.launcher3.enable_large_desktop_windowing_tile
Change-Id: I789873100f42896c9ed3084accb0f6970abcba0c
2024-09-30 15:22:40 -07:00
Liran Binyamin
74299edbc6 Merge "Update flyout content during animation" into main 2024-09-30 16:54:15 +00:00
Jeremy Sim
ce40e83e56 Merge "Update splitscreen SnapPosition constants" into main 2024-09-28 02:54:10 +00:00
Liran Binyamin
5c34cf2741 Update flyout content during animation
This change translates the content of the flyout according
to the progress of the animation. Adding an outline provider
allows clipping the content to the bounds of the animating
background.

Also animate the color of the background.

Demo:
on left - http://recall/-/bJtug1HhvXkkeA4MQvIaiP/cH2EK0FiD92dykhLkLeyh1
on right - http://recall/-/bJtug1HhvXkkeA4MQvIaiP/btpcter79rAlcavd4xxHu7

Flag: com.android.wm.shell.enable_bubble_bar
Bug: 277815200
Test: atest BubbleBarFlyoutViewScreenshotTest
Test: atest BubbleBarFlyoutControllerTest

Change-Id: Id142af2041410c0570759a360146d5e084411cc1
2024-09-27 17:27:20 -04:00
Ats Jenk
e7d52f523d Merge "Handle swipe down on collapsed bubble bar" into main 2024-09-27 19:44:56 +00:00
Jeremy Sim
66b695b5fd Update splitscreen SnapPosition constants
Bug: 349828130
Test: No logical changes, continues to pass tests
Flag: com.android.wm.shell.enable_flexible_split
Change-Id: I7b0b436c7eabf7d9fc46e2c6d6e504343d06e48a
2024-09-27 19:17:20 +00:00
Liran Binyamin
272eea45e6 Merge "Implement bubble bar flyout background animation" into main 2024-09-27 12:45:41 +00:00
Liran Binyamin
f7fc19bec1 Implement bubble bar flyout background animation
Update the bubble bar flyout drawing behavior to allow to animate
from a collapsed position into an expanded position.

This change only handles the rounded rect and the triangle. The
text is still left unchanged.

When wired up this looks like this:
left: http://recall/-/bJtug1HhvXkkeA4MQvIaiP/gIsckRmFKj8CceafiJnPTa
right: http://recall/-/bJtug1HhvXkkeA4MQvIaiP/dpn51yXFCCkT6ViUegf351

Flag: com.android.wm.shell.enable_bubble_bar
Bug: 277815200
Test: atest BubbleBarFlyoutViewScreenshotTest
Test: atest BubbleBarFlyoutControllerTest
Change-Id: I85ae3bf908c04e5473655c9e536495f56d80f466
2024-09-26 14:38:41 -04:00