Commit Graph

468 Commits

Author SHA1 Message Date
Gustav Sennton
cbb7ecddfe Only set task surface corner radius once in TransformParams
When setting the corner radius constantly in TransformParams sometimes
we set the radius after the end of the recents transition, causing
Desktop tasks to have non-rounded corners at the end of recents
transitions.

Bug: 378657004
Test: manual + TransformParamsTest
Flag: com.android.window.flags.enable_desktop_recents_transitions_corners_bugfix
Change-Id: I2ae919424602d655d0995b4dc1951d96c7dfd3d8
2025-02-07 07:16:33 +00:00
Treehugger Robot
5c11f67ca3 Merge "[CD Taskbar] Refactor TaskbarManager - Make Window Contexts also follow map pattern" into main 2025-01-31 18:02:23 -08:00
Sukesh Ram
2f74082b3b [CD Taskbar] Refactor TaskbarManager - Make Window Contexts also follow map pattern
Make Window Contexts also follow map pattern.

Flag: EXEMPT not adding new behavior
Bug: 391706879
Test: Manual
Change-Id: Ib0672e653b9dbfcb3597210ca244f110515cd4dc
2025-01-31 21:53:46 +00:00
Treehugger Robot
340720e8a7 Merge "Remove all external usages of GroupTask.task1/2 from Launcher3" into main 2025-01-31 11:42:55 -08:00
Ahmed Fakhry
b6ecf5889e Remove all external usages of GroupTask.task1/2 from Launcher3
See go/refactor-group-task for details. This CL removes all the usages
of `task1` and `task2` from `GroupTask` in Launcher3. Follow-up CLs will
remove it from NexusLauncher and remove the fields altogether.

Bug: 388593902
Test: m
Flag: EXEMPT pure refactor with no behavior change.
Change-Id: I902c8135b3a0aae95acf25267b3bcbf286bd4e7d
2025-01-31 17:14:44 +00:00
Sunny Goyal
430fd3104f Not calling updateCallback in constructor as it can cause initialization error
Bug: 390930809
Flag: EXEMPT bugfix
Test: atest ActiveTrackpadListTest
Change-Id: Ifb14e2949f1f399fbb8b63f493f96d0dd54cc081
2025-01-30 13:25:04 -08:00
Treehugger Robot
a804d02912 Merge "Refactor: Extract Thumbnail and sysUiStatusNavFlags from TaskContainerVM" into main 2025-01-29 12:04:37 -08:00
Jordan Silva
39549a3843 Refactor: Extract Thumbnail and sysUiStatusNavFlags from TaskContainerVM
Moves the sysUiStatusNavFlags from TaskContainer to TaskView to align it
 with the new thumbnail architecture. This change allows for better
 management and access of this information within the TaskView.

Bug: 390581380
Doc: go/launcher-overview-unified-taskviewmodel
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Test: GetSysUiStatusNavFlagsUseCaseTest
Test: GetTaskUseCaseTest
Test: TaskUiStateMapperTest
Test: TaskViewModelTest
Change-Id: Ic285e41620350dbd3e975b6223e6b7d4cd62d3c0
2025-01-29 17:57:18 +00:00
Charlie Anderson
db9bb3c869 Merge "Convert UserCache to use Dagger" into main 2025-01-28 16:15:03 -08:00
Anushree Ganjam
79ffb0ed30 Merge "Move SettingsChangeLogger to Dagger." into main 2025-01-28 15:11:59 -08:00
Charlie Anderson
e90282b317 Convert UserCache to use Dagger
Bug: 372012340
Test: Presubmit
Flag: EXEMPT Dagger Change
Change-Id: I36a0a3f56540c0515d99badc127c2ab8534e684e
2025-01-28 15:30:07 -05:00
Treehugger Robot
a8145bc41f Merge "Fix RecentTasksListTest.loadTasksInBackground_freeformTask_createsDesktopTask after flipping a flag" into main 2025-01-28 10:34:58 -08:00
Jordan Silva
2f016c0586 Merge "Refactor: Update task container and thumbnail dimming progress" into main 2025-01-28 08:26:22 -08:00
Alex Chau
64b90c1d92 Fix RecentTasksListTest.loadTasksInBackground_freeformTask_createsDesktopTask after flipping a flag
Change-Id: I3934a37a25279af483e8e19e909c9d6d6727a891
Fix: 392853711
Test: RecentTasksListTest
Flag: EXEMPT TEST_ONLY
2025-01-28 08:25:40 -08:00
Treehugger Robot
7f4ce77932 Merge "Separate external display tasks in Overview" into main 2025-01-28 03:19:20 -08:00
Jordan Silva
beb6122fbe Refactor: Update task container and thumbnail dimming progress
This commit updates the mechanism for dimming task containers and thumbnails in the recents view. These changes simplify the dimming logic and improve the performance of the recents view. It reduces the usage of Flows to propagate progress and animation states through the views and view models.

The following changes were made:

- The `TaskThumbnailViewModel` no longer provides a dimming level.
- The `TaskViewModel` now provides a `tintAmount` flow that represents the dimming level for a task.
- The `TaskContainer` and `TaskThumbnailView` now use the `tintAmount` flow to update their dimming level.
- The `TaskContainer` now also updates the dimming level based on the menu open progress.
- The `TaskThumbnailView` now uses a `MultiPropertyFactory` to manage the dimming level, allowing it to be controlled by both the tint amount and the menu open progress.

Bug: 390581380
Doc: go/launcher-overview-unified-taskviewmodel
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Test: OverviewImageTest
Test: TaskViewModelTest
Test: TaskThumbnailViewModelImplTest
Test: TaskThumbnailViewScreenshotTest
Change-Id: I04d5dee534d56857b977d7f3ed6d4eda9f93be45
2025-01-28 10:33:36 +00:00
Anushree Ganjam
545416cc29 Move SettingsChangeLogger to Dagger.
Bug: 361850561
Test: Presubmit
Flag: EXEMPT dagger
Change-Id: I46b740b3eef97ce85ed24d695ed68c12f8e12758
2025-01-27 19:15:16 -08:00
Alex Chau
5201f78a1f Separate external display tasks in Overview
- Sort external display tasks into front of Overview to create its own sections, all external display tasks are treated as large tile
- Fixed expected position of currentPage and runningTask respectively
- Fixed Desktop and fullscreen TaskView to launch with displayId from its first available task

Bug: 391311008
Flag: com.android.launcher3.enable_separate_external_display_tasks
Test: RecentTasksListTest
Change-Id: Ida0ccab00d3e4d74513812a11241dfc908bde991
2025-01-27 16:37:08 +00:00
Jordan Silva
fe4152e608 Merge "Refactor: Remove TaskThumbnailViewModel and introduce TaskViewModel" into main 2025-01-27 03:09:37 -08:00
Cosmin Băieș
e05eaa3cf0 Rename IME_SHOWN states to IME_VISIBLE
This renames the SysUI states related to the IME and IME Switcher button
visibility from "shown" to "visible", to maintain consistency.

Flag: EXEMPT refactor
Bug: 366129400
Test: n/a
Change-Id: I45219e62b633ca984de98df43f5c238604b38109
2025-01-25 01:18:11 +01:00
Jordan Silva
3bf3740891 Refactor: Remove TaskThumbnailViewModel and introduce TaskViewModel
- Remove TaskThumbnailViewModel and replace it with TaskViewModel
- Introduce TaskUiStateMapper class to map between TaskData and TaskThumbnailUiState
- Improve TaskView by introducing TaskViewModel and delegate to TaskContainer to show changes
- Refactor TaskThumbnailView to simplify its responsability and be able to receive TaskThumbnailUiState.
- Add TaskViewModel test and TaskUiStateMapper tests

Bug: 390583187
Doc: go/launcher-overview-unified-taskviewmodel
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Test: OverviewImageTests
Test: TaskViewModelTest
Test: TaskUiStateMapperTest
Test: TaskThumbnailViewModelImplTest
Test: TaskThumbnailViewScreenshotTest
Change-Id: I90bb08d377d7a24ca803c552e0cf3897c8888b76
2025-01-24 11:36:22 -08:00
Treehugger Robot
b22158206b Merge "Introduce SingleTask and SplitTask" into main 2025-01-24 02:59:37 -08:00
Ahmed Fakhry
f87e44376b Introduce SingleTask and SplitTask
See go/refactor-group-task for details. This CL introduces `SingleTask`
and `SplitTask` and makes `GroupTask` abstract.

Bug: 388593902
Test: m
Flag: EXEMPT pure refactor with no behavior change.
Change-Id: I96d0eb0600420ce5cb2fff30ed9d766224b6961e
2025-01-23 23:48:01 +00:00
Treehugger Robot
ed5910ad52 Merge "Revert "Revert "Migrating RecentsAnimationDeviceState and depend..."" into main 2025-01-23 11:02:36 -08:00
Treehugger Robot
86864f95c3 Merge "AllApps tray icon tap: use showDesktopApp() for existing Desktop tasks" into main 2025-01-23 03:34:55 -08:00
Gustav Sennton
1427068342 AllApps tray icon tap: use showDesktopApp() for existing Desktop tasks
When tapping an icon in the AllApps tray, before this CL, we would use
the WM Shell API startLaunchIntentTransition() to launch a task for that
app icon. However, this would break the window limit logic since in WM
Shell (startLaunchIntentTransition()) we think we're launching a new
task, when in fact we're just moving an existing one to the front.
With this CL we instead reuse the showDesktopApp() API whenever the app
we're trying to launch has an already visible / minimized Desktop task.

Bug: 391365151
Test: launch visible Desktop app from AllApps - doesn't overtrigger
window limit
Flag: com.android.window.flags.enable_desktop_app_launch_transitions_bugfix

Change-Id: Ia3638012226fe28c853ec6cfd0523a8fb23b8961
2025-01-23 00:46:08 -08:00
Sunny Goyal
a5fef475a5 Revert "Revert "Migrating RecentsAnimationDeviceState and depend..."
Revert submission 31416515-revert-31332401-recents-device-state-LXBUANUQFL

Reason for revert: Fixing build breakage and resubmitting

Reverted changes: /q/submissionid:31416515-revert-31332401-recents-device-state-LXBUANUQFL

Change-Id: I3b89356df57f1e7ff1a9e364c0d766578e23798c
2025-01-22 18:31:06 -08:00
Toni Barzic
f817372651 Show desktop tasks when taskbar is pinned on home
Updates taskbar and KQS to show (running) desktop tasks when taskbar is
shown on the home screen - adds `shouldShowDesktopTasksInTaskbar` method
to TaskbarDesktopModeController to be used instead of
`areDesktopTasksVisible*()` to determine whether to show desktop tasks
in the taskbar. The method, in addition to desktop tasks visibility,
also considers whether taskbar should be shown on the home screen, and
whether current launcher state is home.

The launcher state is fetched from `TaskbarStashController`, which
already keeps track of this state. This is likely not ideal, but can be
removed in the long term - see http://b/390665752.

Furthermore, updates ReventsModel login not to always filter out desktop
tasks with no non-minimized tasks (which is currently expected behavior
in overview) in `getTasks()`. The filtering is now done by the filter
passed to `getTasks()` method, instead of when processing tasks in the
background. The filter used by default is updated to filter out such
desktop tasks, but callsites from `KeyboardQuickSwitchController` and
`TaskbarRecentAppsController` are updated to use an empty filter, so
they can display desktop tasks when they're all minimized.

Bug: 376711722
Bug: 390665160
Test: Manual on desktop device - verify that taskbar and KQS when shown
on home screen display desktop tasks, including the case all tasks are
minimized.
Flag: com.android.window.flags.enter_desktop_by_default_on_freeform_displays

Change-Id: Iabc22e20bf64aa9a826b4a5952f1edc6ea639cdc
2025-01-22 22:36:02 +00:00
Liana Kazanova (xWF)
fa30e3fc0e Revert "Migrating RecentsAnimationDeviceState and dependent obje..."
Revert submission 31332401-recents-device-state

Reason for revert: DroidMonitor: Potential culprit for http://b/391684419 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Reverted changes: /q/submissionid:31332401-recents-device-state

Change-Id: I3986328ee3aa8ebb822f7ef05b9f80ef68872aef
2025-01-22 13:50:08 -08:00
Sunny Goyal
d7bfa76bcc Migrating RecentsAnimationDeviceState and dependent objects to Dagger
Bug: 361850561
Flag: EXEMPT dagger
Test: Presubmit

Change-Id: I2c45ec49a913abb0532e83b09e797012e06eb8c4
2025-01-21 23:53:02 -08:00
Treehugger Robot
bfd58c8c00 Merge "Remove some usages of GroupTask.task1" into main 2025-01-21 17:04:01 -08:00
Treehugger Robot
6b6020da2d Merge "Add TaskViewModel to fetch and map Tasks data" into main 2025-01-17 11:00:32 -08:00
Ahmed Fakhry
26a43abbe2 Remove some usages of GroupTask.task1
See go/refactor-group-task for details. This is another incremental
change towards deprecating `GroupTask.task1`.

Bug: 388593902
Test: m
Flag: EXEMPT pure refactor with no behavior change.
Change-Id: Ib9b38268374277f485c6856a012b5b7f02e37055
2025-01-17 17:47:26 +00:00
Jordan Silva
be4ceb26c9 Add TaskViewModel to fetch and map Tasks data
This commit introduces a new `TaskViewModel` which retrieves task data using `GetTaskUseCase` and maps them to `TaskTileUiState`.
It also adds new files `TaskTileUiState` and `GetTaskUseCase` with their corresponding models.
- `TaskTileUiState` is used to represent the UI state of a single overview tile.
- Introduced `TaskData` sealed interface to encapsulate different states of a task.
- `GetTaskUseCase` is used to fetch a single task given an id from the repository.
- `TaskViewModel` fetches and maps tasks to `TaskUiState`.
- Added unit tests for `TaskViewModel` to ensure the correct data is being emitted.
- Added unit tests for `GetTaskUseCaseTest` for testing task retrieval logic.
- `TaskModel` is the new data model representing the data fetched by the repository.

Fix: 390578940
Fix: 390578937
Bug: 388486032
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Test: GetTaskUseCaseTest
Test: TaskViewModelTest
Change-Id: Ibf728eccc31270c0d0d8668a503e26d6d0e88f59
2025-01-17 16:44:56 +00:00
Sihua Ma
8fc266d063 Move tests to multivalent
Test: SysUI studio
Test: atest NexusLauncherRoboTests
Flag: EXEMPT test migration
Change-Id: Idd9e52f281d955e87f6db638ebfd8218a4dcb77f
2025-01-17 00:04:27 +00:00
Anushree Ganjam
25717836e1 Merge "Use RunListener to Clear inline mocks at the end of each test class." into main 2025-01-16 13:28:04 -08:00
Anushree Ganjam
0a29e73ffb Use RunListener to Clear inline mocks at the end of each test class.
Inline mocks are leaking activity contexts and accumulation of these activity contexts led to OOM that resulted in test failure.

See https://github.com/mockito/mockito/issues/1614 for details on mockito caused memory leaks

This change works for both soong and gradle builds.

Bug: 378520480
Test: atest and android studio builds
Flag: TEST_ONLY
Change-Id: I4a50993621ea416a02a41dd2f9c330d1599f065c
2025-01-16 11:19:52 -08:00
Saumya Prakash
26bceb527e Merge "Avoid per task app icons in Taskbar for desktop mode" into main 2025-01-15 14:18:38 -08:00
Gustav Sennton
777b5575b2 Reland "Override desktop tasks corner radius during recents tr..."
Set the corner radius of desktop task surfaces to 0 during recents
transitions so that corner radius doesn't interfere with the surface
bounds and corner radius applied to the RemoteAnimationTarget leashes.

The issue in b/388979758 (causing the original CL to be reverted) was fixed by changes to OtherActivityInputConsumer - in the original CL the callback `FinishImmediatelyHandler#onRecentsAnimationStart()` in that class was never called because it wasn't annotated `@Override` and its base method had a default implementation.

Bug: 378657004
Change-Id: I40444e7e9367a6833171a2e413b51d0d3f974318
Test: manual
Flag: com.android.window.flags.enable_desktop_recents_transitions_corners_bugfix
2025-01-15 04:35:38 -08:00
Treehugger Robot
bc3995222b Merge "Moving DisplayController to dagger" into main 2025-01-14 13:39:19 -08:00
Sunny Goyal
55dc2d1c31 Moving DisplayController to dagger
Separating various overrides to individual modules so that they can be reused in tests

Removing ContextualEduStatsManager and directly using SysUiProxy as all the usescases
are only in quickstep/
This avoids additional Module definition and delegation

Bug: 361850561
Test: Presubmit
Flag: EXEMPT dagger
Change-Id: I096459d638553991ed01766002b874589c6b976e
2025-01-14 11:40:35 -08:00
Saumya Prakash
aabcfa27ae Avoid per task app icons in Taskbar for desktop mode
Until Taskbar multi instance support was in place, Taskbar would show
multiple icons for different instances of the same app in desktop mode.
Now this is no longer needed as taskbar has multi instance support, so
now there is only one icon per instance of an app of the same user.

Fix: 382589460
Test: Started several Chrome windows -> Taskbar has 1 icon for chrome
Flag: com.android.launcher3.enable_multi_instance_menu_taskbar
Change-Id: I2df4327dcdc9d221164055ebc33ff508273e7ef9
2025-01-13 22:37:25 +00:00
Treehugger Robot
d64bb9392c Merge "Fix NPE in LauncherSwipeHandlerV2Test.setup (follow up)" into main 2025-01-13 13:34:59 -08:00
Xiaoqian (Daisy) Dai
6dbd67ae7d Merge "desktop-exploded-view: Add header to individual windows." into main 2025-01-13 11:40:53 -08:00
Mykola Podolian
987de5534e Merge "Hide bubble bar stash handle when the notification shade is open." into main 2025-01-13 11:40:18 -08:00
Schneider Victor-Tulias
2b64aa0b13 Fix NPE in LauncherSwipeHandlerV2Test.setup (follow up)
Since there is no display being used for LauncherSwipeHandlerV2Test, then no RecentsDisplayResource gets created for the DEFAULT_DISPLAY (and so RecentsDisplayModel.getFallbackWindowInterface returns null). Adding a mock display

Flag: com.android.launcher3.enable_fallback_overview_in_window
Bug: 377678992
Test: pre/postsubmit
Change-Id: I43754eafb4f6a9b393e6a7b7fbd5b27903d2f9b9
2025-01-13 14:12:29 -05:00
Treehugger Robot
c9f33fba00 Merge "Revert "Override desktop tasks corner radius during recents tran..."" into main 2025-01-11 01:06:00 -08:00
mpodolian
f1186f9d14 Hide bubble bar stash handle when the notification shade is open.
Introduced logic to control the bubble bar stash handle alpha based on
the notification shade state.

Test: TransientBubbleStashControllerTest
Test: Manual. Have bubbles and the bubble bar stashed. Open the
notification shade, observe that the stash handle fades away. Close the
notification shade, observe that the stash handle fades back in.
Have few bubbles, open bubbles test app, click on bubble icon. Observe
the bubble bar expands without blinking.
Test: Manual.
http://recall/-/gx8ASgewUeUS3QYohfrd1J/e1iUtwaFdezKOb0gBRff7Z
Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 376140839
Fixes: 376141264

Change-Id: Id9c473f9aead0e4c5830793d9f3b0b1ae86453e7
2025-01-10 14:33:30 -08:00
Mykola Podolian
11fcd29cdf Merge changes I8ec01d69,If2366ec1,I8321e2f5 into main
* changes:
  Take bubble selection from the shell update.
  Fix bubbles animation when the new bubble added and old bubble removed.
  Fix arrow animation when the new bubble added and old bubble removed.
2025-01-10 14:28:52 -08:00
Michele Fan
89b039da83 desktop-exploded-view: Add header to individual windows.
The header has an app icon, app title and a close button. Currently
clicking on the close button does nothing. Will address it in a
following CL.

Flag: com.android.launcher3.enable_desktop_exploded_view
Test: Manual
Bug: 353965691

Change-Id: I5e0303a02d5f8afd16a5f5f0335a8fa489ff98f2
2025-01-10 22:25:43 +00:00