Commit Graph

20514 Commits

Author SHA1 Message Date
Jordan Silva a244c0b70e Fix TAPL OverviewTask to use correct resource to measure height
The background in DesktopTaskView wasn't added for accessibility, so it couldn't be retrieved from the view hierarchy during e2e tests. This view is necessary to calculate the correct size of the DesktopTaskView.

The changes in this cl:
- Add backgroundView to DesktopTaskView's children for accessibility
- Use the correct snapshot resource for desktop mode in OverviewTask

Bug: 353948500
Change-Id: I83746510849e4013d623d49cbaccebd81daba96d
Flag: EXEMPT bugfix
Test: TaplTestsOverviewDesktop
2024-10-28 12:25:25 +00:00
Jordan Silva 7054095b16 Add TAPL test for dismiss DesktopTaskView
This CL adds 2 new E2E Tapl tests for checking dismiss DesktopTaskView.
- dismissFocusedTask_thenDesktopIsCentered validates the following scenarios:
  - Scenario: When Focused Task is in the center of the screen, with 1 other task in the grid and 1 desktop task.
  - When focused task is dismissed, the next task in the grid takes its place to be the next focused task at the center of the screen.
  - When the last focused task is dismissed, the desktop task takes its place at the center of the screen.

- dismissDesktopTask_thenFocusedTaskIsCentred validates the following scenarios:
  - Scenario: When Desktop Task is in the center of the screen, with 1 focused task and 1 task in the grid.
  - When focused task is dismissed, the next task in the grid takes its place, adjacent to desktop task.
  - When desktop task is dismissed, the focused task takes its place at the center of the screen.

Fix: 353948500
Flag: com.android.launcher3.enable_large_desktop_windowing_tile
Test: TaplTestsOverviewDesktop
Change-Id: Ie2aa28cd2b30a2bf10e877721416399bcf47acf6
2024-10-28 12:25:25 +00:00
Uwais Ashraf 821bcaade5 Merge changes I65e6ad57,I0335e4d0 into main
* changes:
  Remove listener in destroy() that caused a memory leak.
  Reuse TTV, recreating deps to get faster load times, lower mem usage
2024-10-25 17:11:37 +00:00
Uwais Ashraf b80f90bc0d Remove listener in destroy() that caused a memory leak.
Fix: 370916189
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Test: Manually looking at heap dumps. Verify leaked obj no longer there
Change-Id: I65e6ad57d1ac6873946d836d8221b67deef548b1
2024-10-25 15:18:23 +00:00
Uwais Ashraf 6f61228a6b Reuse TTV, recreating deps to get faster load times, lower mem usage
Use a ViewPool for DesktopTaskView for same reason.

Fix: 369590189
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Test: Manually looking at slow-mo videos of home to overview
Change-Id: I0335e4d0eea4841145815244bbbec19541f31c73
2024-10-25 15:18:08 +00:00
Treehugger Robot 38c94afefc Merge "Actually merge the colors for recent indicators." into main 2024-10-24 23:26:18 +00:00
Mykola Podolian f85a484a9d Merge "Removed stashing hotseat calls." into main 2024-10-24 20:36:06 +00:00
Brandon Dayauon 838a5e9d23 Merge "Add trace logs in Launcher for perfetto to investigate two line issue" into main 2024-10-24 19:35:15 +00:00
Saumya Prakash 747c6b4427 Merge "Prevent Search taskbar edu from showing on home screen." into main 2024-10-24 18:00:24 +00:00
Wen-chien Wang 94fb42cef9 Merge "Add margins to KQS view that is triggered from taskbar" into main 2024-10-24 17:47:37 +00:00
Liran Binyamin abc4b6a137 Merge "Handle taps on bubble bar flyout" into main 2024-10-24 13:26:50 +00:00
Brandon Dayauon 51db65ee49 Add trace logs in Launcher for perfetto to investigate two line issue
bug:375267130
Test manually screenshot:
onIdpChange: https://screenshot.googleplex.com/ASbyGFoAhTXgnWK
statefulActivityOnConfigChange: https://screenshot.googleplex.com/gLqxeJN7TzUURCy
Flag: NONE adding traces to perfetto

Change-Id: Ib2ac49fb8668fdfc91c8e38b91a4afd10127a4c5
2024-10-23 22:59:58 -07:00
Treehugger Robot 388701a031 Merge "Add debugging logs to transition animation" into main 2024-10-24 05:51:18 +00:00
Mykola Podolian 4dc6617988 Merge "Updated bubble bar position to be center aligned with the hotseat" into main 2024-10-24 02:10:43 +00:00
Sihua Ma aa921fa3eb Add debugging logs to transition animation
Test: N/A
Bug: 364465567
Flag: EXEMPT logs only
Change-Id: I8275c43ac44cd4b027fa8ad3d94fe0e84063b8d1
2024-10-24 00:58:58 +00:00
Treehugger Robot 1e4f42ff7f Merge "Account for all apps offset during taskbar layout" into main 2024-10-24 00:10:08 +00:00
Liran Binyamin aa3f772622 Handle taps on bubble bar flyout
Expand the bubble bar when the user taps on the flyout view.

Flag: com.android.wm.shell.enable_bubble_bar
Bug: 277815200
Test: atest BubbleBarViewAnimatorTest
Test: atest BubbleBarFlyoutControllerTest
Change-Id: I156acfa663d6a00bc70dd7bbfc35642643902d83
2024-10-23 19:46:14 -04:00
Treehugger Robot 46a98e1827 Merge "Update taskbar overflow button" into main 2024-10-23 22:49:37 +00:00
mpodolian f230eee2ff Updated bubble bar position to be center aligned with the hotseat
Added a method to the device profile to calculate the vertical center of
the hotseat icons. Simplified the logic for positioning the bubble bar.

Test: TransientBubbleStashControllerTest
Test: PersistentBubbleStashControllerTest
Test: Visual. Go to home page, check that bubble bar is vertically
center aligned with the hotseat
Bug: 345491493
Flag: com.android.wm.shell.enable_bubble_bar

Change-Id: I52f1b94de79f6c912f43a88fcc5c884e20e56310
2024-10-23 14:44:40 -07:00
Saumya Prakash 9b60028f99 Prevent Search taskbar edu from showing on home screen.
If a user pins the taskbar and immediately swipes to home, this would
show the taskbar edu tooltip on the home screen. This change checks that
taskbar isn't transitioning to home to prevent that scenario.

Fix: 369061563
Test: Reset Search Taskbar edu, pin taskbar, then swipe to home
immediately. Ensure that the edu doesn't show up on home
Flag: EXEMPT bugfix

Change-Id: I9948189df880b3ed318c4952a8f715cf9a7fa708
2024-10-23 21:38:58 +00:00
Brian Isganitis c0a18d57e8 Actually merge the colors for recent indicators.
Forgot to do a git add :)

Flag: com.android.window.flags.enable_desktop_windowing_taskbar_running_apps
Bug: 356394053
Test: go/testedequals
Change-Id: I42f85f5850152f498db8a399835b19a5e493c68d
2024-10-23 14:45:49 -04:00
Treehugger Robot debda9cdd9 Merge "Import translations. DO NOT MERGE ANYWHERE" into main 2024-10-23 17:34:58 +00:00
Toni Barzic a5b6c155b6 Update taskbar overflow button
Creates a new view for the taskbar overflow button that draws up to 4
recent item previews. The items are stacked on top of each other in
counter clockwise order, with overlapping bounds, recent items closer
to the top. The item icons have a 2 dip ring around them, of the taskbar
background color.

Adjusts logic to calculate which items become part of the overflow
button, so more recent items get shown in the taskbar.

Initial consideration was to usse FolderIcon to represent the overflow
button, but decided against it because:
*    FolderIcon is fairly entangled with the associated folder view
*    item information uses different data structure (ItemInfo) than
     recent items (GroupTasks)
*    item preview layout within the main icon is similar, but
     sufficiently different that using clipped folder layout rules felt
     like hacking around assumptions made for folder icon UI

Bug: 368119679
Test: Keep opening apps until the task bar enters overflow - verify that
overview button shows up, and contains least recent task
representations. Keep adding items, then closing windows, and verify
the icon gets updated accordingly. Done in landscape and portrait, and
ltr and rtl layout.
Flag: com.android.launcher3.taskbar_overflow

Change-Id: I2824cb0db1f7516ebd74361ce00fb8887857325d
2024-10-23 17:05:58 +00:00
Wen-Chien Wang 69ed08ef86 Add margins to KQS view that is triggered from taskbar
Bug: 368119679
Test: open KQS via taskbar and observe the bounds change
Flag: com.android.launcher3.taskbar_overflow
Change-Id: I5060a339cf0cdf70a2a11b57a325767405772ef8
2024-10-23 04:03:50 +00:00
mpodolian f679ba942f Removed stashing hotseat calls.
Removed calls that were stashing and unstashing the hotseat bar.

Flag: com.android.wm.shell.enable_bubble_bar
Test: Manual. Be on Launcher home, have some bubbles. Expand / collapse
bubble bar. Hotseat remains behind the scream view.
Fixes: 373429249

Change-Id: I1a9ba39c8ca11d49340f217f095d5e872b06105b
2024-10-22 15:25:26 -07:00
Treehugger Robot 08007068d4 Merge "Generalize ActivityTracker to support RecentsWindowManager" into main 2024-10-22 21:26:58 +00:00
Bill Yi 451a5e395f Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Ie3164382c2b9dbf6623f91721a88a2347b9fdde1
2024-10-22 13:45:15 -07:00
Brian Isganitis 8018dcad35 Merge "Update recent indicators to match spec." into main 2024-10-22 19:31:48 +00:00
Schneider Victor-Tulias 8463dc47eb Generalize ActivityTracker to support RecentsWindowManager
Continued quick switch couldn't work using existing infrastructure until RecentsWindowManager could be properly tracked by ActivityTracker. Refactored ActivityTracker into ContextTracker to support this.

Also refactored ActivityInitListener into ContextInitListener to fit the updated pattern.

Flag: com.android.launcher3.enable_fallback_overview_in_window
Fixes: 366023051
Test: RecentsWindowSwipeHandlerTestCase; Attempted continued quick switch from home and launched app
Change-Id: Ic38ebf3611ef22fbfd1ddeb79d72d8a3621940a0
2024-10-22 15:29:59 -04:00
Treehugger Robot 08f950245e Merge "Fix swipe up from Desktop Tasks is updated does not show focused task" into main 2024-10-22 16:40:34 +00:00
Jordan Silva a48efb33f2 Fix swipe up from Desktop Tasks is updated does not show focused task
Fixes the condition that defines which task should be the focused task when grid-only is enabled and desktop windowing is the running task.

In some cases, when the user adds or removes a task from Desktop Window, the DesktopTaskView does not get updated with the new list of tasks. This causes a mismatch of tasks that are inside the DesktopTaskView and the actual Desktop Windowing. So, RecentsView can't match the previous DesktopTaskView with the current running tasks, entering a specific condition to update the runningTaskViewId. The method called in this condition (showCurrentTask) also updates the focusedTaskViewId for some situations. This CL fixes the conditions which focusedTaskViewId is set to prevent it to replace the focused task id when it's not needed.

Fix: 370736395
Flag: com.android.launcher3.enable_large_desktop_windowing_tile
Test: Manual
Change-Id: I25f5bd67ee0486f6754673eec404832779fc0498
2024-10-22 15:38:49 +01:00
Mykola Podolian 18b3171980 Merge "Revert "Made the taskbar touchable during animation to home."" into main 2024-10-22 03:59:13 +00:00
Mykola Podolian 164b832ec4 Revert "Made the taskbar touchable during animation to home."
This reverts commit d89732ef85.

Reason for revert: b/374080485
Flag: NONE
Change-Id: I56236f539957efaaa4caa30a4b887d017037709f
2024-10-21 17:36:49 -07:00
Artsiom Mitrokhin 76fa57f418 Merge "Update popup and arrow positioning logic" into main 2024-10-21 23:55:14 +00:00
Uwais Ashraf bea43b0c03 Merge changes I54ea7a71,Ifd9c54fd into main
* changes:
  Set task properties to prevent the task being null. This behaviour is expected by existing callers and was likely broken by ag/28151977
  TaskRepository performance improvement
2024-10-21 22:40:51 +00:00
Treehugger Robot 80d18e0138 Merge "Fixing deadlock in dagger singletons" into main 2024-10-21 22:29:57 +00:00
Toni Barzic 9a5941ab91 Account for all apps offset during taskbar layout
When laying out its contents, TaskBarView generally lays the icons so
they get centered in the task bar - this is done by calculating the
total size of all icons during layout (this will generally be transient
taskbar icon sizes), and substracting extra margins that get removed
from the divider view. After initial layout, `TaskbarViewController`
adjusts the icon view positions to match expected icon sizes (it
offsets icons horizontally reducing margins between icons to match
intended icon sizes for the taskbar type). Additionally,
`TaskbarViewController` translates all apps button container - this
transformation is asymetric, and causes the task bar contents to become
off-center. To account for this, update taskbar layout to reduce the
total icon size used for centering icons by the amount all apps button
is offset. This makes the taskbar off-center after initial layout, but
by the amount by which all apps button is eventually offset (resulting
in centered taskbar content).

This alone worked for left-to-right UI direction, but not right-to-left.
To fix this, correct the reference point from which
TaskBarViewController offsets icon positions. The offset used to be
calculated by distance of an icon index from half of the icon count -
instead offset needs to be calculated relative to mid-index.
For example, icon at index i needs to be offset by
(mid_index - i) * difference_in_icon_size: ((n-1) / 2 - i) * diff).
Code used to work for LTR UI layout because the list of icons contained
invisible qsb view, which incresed both n and indices by 1, so
(n' / 2 - i') * diff_in_icon_size worked fine, as it evaluated to
((n + 1) / 2 - i - 1) * diff = ((n - 1) / - i) * diff

Bug: 372567501
Test: Verify that taskbar icons are centered when it needs to be, both
with ltr and rtl language UI.
Flag: EXEMPT bugfix

Change-Id: Ic06873cc225a4361d9140d72c055db23f446a1ad
2024-10-21 20:49:05 +00:00
Treehugger Robot e6e9cd23c5 Merge "Don't enforce max tasks in KeyboardQuickSwitchView" into main 2024-10-21 20:26:27 +00:00
Brian Isganitis 27e05992f6 Update recent indicators to match spec.
Does not implement any animations.

Flag: com.android.window.flags.enable_desktop_windowing_taskbar_running_apps
Fix: 356394053
Test: go/testedequals
Change-Id: If8e319b605beedd0e9b14dc37da1b5ffa12f3c9f
2024-10-21 15:04:03 -04:00
Artsiom Mitrokhin ade96d0199 Update popup and arrow positioning logic
1) By default, it's centered relative to the event position
   https://screenshot.googleplex.com/5Wri2CX3vASCxWt
2) It becomes left or right aligned near edges of the screen
   https://screenshot.googleplex.com/9AEQxWcmYX63jTv
   https://screenshot.googleplex.com/39KMeG2eWKr2QC6
3) And never goes beyond the minimum padding
   https://screenshot.googleplex.com/5LiPHiXiJSyGdx5
   https://screenshot.googleplex.com/86KQnKXa38NoYpM

Bug: 297325541
Flag: com.android.launcher3.show_taskbar_pinning_popup_from_anywhere
Test: manual, flip the flag, open popup from different positions
Change-Id: I06cf0c0352da946da7a62413144c304623557216
2024-10-21 14:32:00 -04:00
Sunny Goyal 0b7f4cf1e2 Fixing deadlock in dagger singletons
Bug: 373557167
Flag: EXEMPT dagger
Test: atest DaggerSingletonDeadlockTest

Change-Id: I2304237bfd818c99b82bbfceea8a81ddb136b5a1
2024-10-21 18:09:37 +00:00
Treehugger Robot d4a04f9de5 Merge "Update removeTaskInternal Desktop case" into main 2024-10-21 16:21:13 +00:00
Uwais Ashraf 36402adaa6 Set task properties to prevent the task being null. This behaviour is expected by existing callers and was likely broken by ag/28151977
Fix: 374339873
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Test: manual
Change-Id: I54ea7a714174375eb0d7481cab246fbbe9133fb4
2024-10-21 14:44:23 +00:00
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
Jordan Silva 9dbae036d3 Merge "Fix crash when initiating split with 5 instances of Chrome in Desktop Windowing" into main 2024-10-21 13:55:56 +00:00
Orhan Uysal ea49585931 Update removeTaskInternal Desktop case
- Pass TaskView directly to removeTaskInternal
- Update the bug id

Bug: 370757235
Test: Manual
Flag: EXEMPT No-op
Change-Id: I0ad0d42541221d1ce6e27c708f469e5c0757b8ef
2024-10-21 13:53:35 +00:00
Jordan Silva ca034f122a Fix crash when initiating split with 5 instances of Chrome in Desktop Windowing
When opening 5 instances of Chrome in Desktop Windowing, navigating back to Overview and trying to split a new Chrome instance from the Taskbar resulted in a crash.

This happened because SplitSelectStateController searches for the last active task of the app chosen to be in split. Then, it returns its taskId that is used in RecentsView to find the TaskView to be animated to split.

However, after the 5th Chrome instance in opened in Desktop Windowing, the last active taskId is no longer visible in Overview or Desktop Windowing. Then, RecentsView won't find any TaskView with that taskId and mSplitHiddenTaskView will be null. This will result in a crash because we have some if-else conditions assuming that is not null because of mSplitSelectStateController has a task to be dismissed during the split animation.

More info in the bug report.

Bug: 372400577
Flag: EXEMPT bugfix
Test: Manual. Steps in the bug report.
Test: Manual. Open 5 windows of Chrome in Desktop Windowing. Go Home. Open a Fullscreen App. Go Overview. Split a new Chrome instance from the Taskbar.
Change-Id: I0f3757e898b606b4e0a180f43c73f1e2d887e996
2024-10-21 13:33:41 +00:00
Jordan Silva 4a08fcc3d9 Merge "Revert "Update OverviewCommandHelper to use Executors.MAIN to reduce the percentage of missed frames"" into main 2024-10-21 13:18:28 +00:00
Alex Chau 5d40236037 Merge "Update comments on createAdjacentPageAnimForTaskLaunch" into main 2024-10-21 12:46:23 +00:00
Liran Binyamin 2c908e2c10 Merge "Wire up flyout to new bubble animation" into main 2024-10-21 12:20:23 +00:00