Commit Graph

1333 Commits

Author SHA1 Message Date
Mady Mellor
33a70394ca Merge changes from topic "mm_remove_floating_tasks" into tm-qpr-dev
* changes:
  Add a flag for the bubble bar
  Remove FloatingTaskController & replace usages with Bubbles
2022-11-03 22:48:32 +00:00
Mady Mellor
46faccde4a Remove FloatingTaskController & replace usages with Bubbles
Switch to using newly exposed method Bubbles#showAppBubble as what
FloatingTaskController does is no longer POR.

Calling this allows 1 bubble from a specific app to be added to the
stack. The only user of this method is NoteTaskController which is guarded by the NOTE_TASK.

Bug: 237678727
Test: treehugger
Change-Id: I47c5c010a050796eff848ba3fcabc40cf5fbd902
2022-11-02 10:01:32 -07:00
Jerry Chang
23f1e2836d Add sub owner to common/split and tests
Ignore-AOSP-First: no merge branch from AOSP
Test: n/a
Bug: 207582920
Change-Id: I46cc309b2453296910c8516cffd2b5b352376b01
Merged-In: I46cc309b2453296910c8516cffd2b5b352376b01
2022-11-02 12:35:40 +00:00
Matt Sziklay
e480be9300 Merge "Add handle menu to bar type window caption." into tm-qpr-dev 2022-11-01 21:43:35 +00:00
TreeHugger Robot
c6e40030ce Merge "Fix NPE when run the splitscreen test" into tm-qpr-dev 2022-11-01 06:36:52 +00:00
mattsziklay
dde7e758e8 Add handle menu to bar type window caption.
Adds a menu on clicking handle that will enable windowing changes. Still
to implement for this prototype: More button, Split Screen button,
Overtop/Float button.

Bug: 239960071
Test: Launch various tasks, confirm handle menu appears, drag
functionality is unaffected.

Change-Id: I0aeeffb44e6bfd580c70270e562d8c04031892de
2022-10-31 16:24:06 -07:00
Jeff Chang
df3a229ee1 Fix NPE when run the splitscreen test
ccfed74e82, add the toast maker in StageCoordinator. NPE is
thrown when running the splitscreen test. It can't toast on a
thread that has not been called Looper.prepare(). This CL adds the
@UiThreadTest on needed tests to fix the NPE.

Bug: 256087248
Test: atest com.android.wm.shell.splitscreen
Change-Id: I9fef85c58570a9c1ca2741d1a8aa81439850cc88
2022-10-31 01:46:49 +00:00
Jerry Chang
b8a27eb601 Merge "Add fallback logic to cancel entering split screen" into tm-qpr-dev 2022-10-27 03:55:19 +00:00
Jerry Chang
abd653a6a0 Add fallback logic to cancel entering split screen
There are cases not having enough task changes to enter split screen.
Update to support canceling the enter-transition by reparenting tasks
back to display.

Fix: 237635859
Bug: 250853925
Test: atest WMShellFlickerTests
Test: enable shell transition and verify the following behaviors
      1. drag and drop Phone to enter split while Phone in front
      2. select "split right" on Phone icon and Phone thumbnail in
	 recents to enter split
Change-Id: I0fe8dfc0c46a8b1f5ee70d85359d2078c263ac80
2022-10-26 04:54:52 +00:00
Ats Jenk
da0d26e567 Merge "Limit freeform to front for freeform task launches" into tm-qpr-dev 2022-10-24 16:58:08 +00:00
Mady Mellor
731095e5cf Merge "Track visible tasks in DesktopModeController and add a listener" into tm-qpr-dev 2022-10-24 16:04:59 +00:00
Shan Huang
92d7e3329f Merge "DO NOT MERGE Spring controlled back progress API" into tm-qpr-dev 2022-10-21 23:54:12 +00:00
Shan Huang
188dee2b3b DO NOT MERGE Spring controlled back progress API
This CL introduces BackProgressAnimator which runs in app's main thread.
It receives target progress values from SysUI and drives the actual
progress value passed to the app with a high stiffness, no bounce
spring.

Bug: 238475284
Test: atest WindowOnBackDispatcherTest
Test: atest BackAnimationControllerTest
Test: atest TouchTrackerTest

Change-Id: Ib0d3ebe43929c405b10681000fb4e7ef8bccce34
2022-10-21 22:12:53 +00:00
Mady Mellor
457d8317f1 Track visible tasks in DesktopModeController and add a listener
- Adds DesktopModeTaskRepository to FreeformTaskListener to track
  visible freeform tasks
- Adds a listener on DesktopModeController to allow sysui to find
  out about freeform tasks becoming visible
- Adds a sysui state flag for freeform tasks being visible

Bug: 245569277
Test: manual - add freeform task => launcher contents are gone
             - remove freeform task => launcher contents are visible
Test: WMShellTest DesktopModeTaskRepositoryTest
Change-Id: I2d717052678bc35a4c59b0bc03e0c4d22e6b103d
2022-10-20 17:25:11 -07:00
Garfield Tan
2bbcd6ada5 Fix a few issues in WindowDecor
This CL does the following:

1. Fix misuses of mTaskInfo in CaptionWindowDecoration because it's the
   old value at that time.
2. Reset RelayoutParams before using it so we don't pass old values.
3. Restore the test values by using the resources in test package so
   that we don't need to change the test every time we change the
   resources in prod.
4. Change loadResource() to loadDimension() and loadDimensionPixelSize()
   to avoid confusion with other type of resources. Also make them
   static just in case we need similar logic on other instances of
   Resources.
5. Moved RelayoutParams closer to RelayoutResult.

It also cleans up some commented out code.

Bug: 254658472
Test: atest WindowDecorationTests
Change-Id: I6fa1b06351c388e3ca6985e76c889f4ec5506c38
2022-10-20 17:11:10 -07:00
Ats Jenk
40828e9713 Limit freeform to front for freeform task launches
When freeform tasks are visible and user attempts to go home, it
triggers a TRANSIT_OPEN transition with target as home screen.
Our current logic checks for TRANSIT_OPEN and brings all freeform apps
to front when this is detected.
Limit bringing freeform apps to front only if a freeform task launches.
Otherwise skip.

Bug: 254736507
Test: atest DesktopModeControllerTest
Change-Id: Ib1ec6449e5236d6e34efdad277fb35bfda7bd068
2022-10-20 17:10:11 -07:00
Maryam Dehaini
74e9e231c2 Merge "Move caption view constants to resources" into tm-qpr-dev 2022-10-19 16:21:35 +00:00
Maryam
222289603a Move caption view constants to resources
Test: Manual Testing
Bug: 251908245
Change-Id: I4133afe8bd82da125b9c374621a285ed72adce04
2022-10-18 16:47:59 -07:00
TreeHugger Robot
9baf3ce919 Merge "Add edge extension for ActivityEmbedding Shell transition animation" into tm-qpr-dev 2022-10-14 11:48:05 +00:00
Chris Li
fcc0747278 Add edge extension for ActivityEmbedding Shell transition animation
Refactor the edge extension logic from DefaultTransitionHandler to the
helper class so that we can reuse it for ActivityEmbedding.

Bug: 207070762
Test: manually verify with Settings.
Merged-In: I6a89b549e7b117caae75ceba6df8f41f5c4d4a15
Change-Id: I6a89b549e7b117caae75ceba6df8f41f5c4d4a15
2022-10-14 14:28:31 +08:00
Ikram Gabiyev
8664c9501c Merge "User-resize pip to normal bounds when (un)folding" into tm-qpr-dev 2022-10-13 21:03:24 +00:00
Ikram Gabiyev
862c902a5c User-resize pip to normal bounds when (un)folding
If folding or unfolding makes the pip window size either larger
than maximum size or smaller than minimum size, then user-resize
to normal bounds.

Test: manually reproduced steps in the bug listed
Test: atest WMShellUnitTests:PipResizeGestureHandlerTest

Bug: 198679951
Bug: 198645990
Change-Id: I4a8c0a3a0fa75ab3d51d30e75bc85a53e4801086
2022-10-12 22:29:21 +00:00
TreeHugger Robot
14bc57382c Merge "Update split context when display size changed" into tm-qpr-dev 2022-10-12 03:14:15 +00:00
Matt Sziklay
a5285231c8 Merge "Add bar type window caption." into tm-qpr-dev 2022-10-11 00:37:41 +00:00
mattsziklay
bd839dbdd1 Add bar type window caption.
This is the first CL towards implementing the bar type caption which
will have a back button, a handle, and a close button. The caption will
also disappear when the attached task is not in focus.
Still to be implemented:
1: Windowing options appearing on handle click
2: Drag down in fullscreen to enter desktop mode
3: Caption display via hovering when cursor available

Bug: 239960071
Test: Manual: confirm new caption displays with the correct buttons/layout.
Confirm buttons work and focus change works with multiple tasks.
Test: Atest WindowDecorationTests

Change-Id: I2ebed76b803d1f337edc3e7340966909f63eaf40
2022-10-10 12:02:44 -07:00
Winson Chung
dc06f11eb0 Merge "Simplify exposing external interfaces to Launcher" into tm-qpr-dev 2022-10-07 16:55:55 +00:00
Winson Chung
c03010f150 Simplify exposing external interfaces to Launcher
- Currently, the collection of binders to send to Launcher is inverted
  and managed by OverviewProxyService which has to know about each
  component directly (and a SysUI interface has to be created to support
  this even if there are no other calls in SysUI to that component).

  Instead, we should have each component register itself with the
  ShellController for controllers which can be exposed to an external
  process, and each product can customize which set of controllers it
  needs to support.
- Add missing dump registration for ShellController
- Updating docs for creating remote callable controllers

Bug: 238217847
Test: atest WMShellUnitTests
Change-Id: Icd0ed33bdbd68b1dd9d782b9ba1f5b4a604479ba
Merged-In: Icd0ed33bdbd68b1dd9d782b9ba1f5b4a604479ba
2022-10-06 22:49:13 +00:00
Tony Huang
b3d7ef6d85 Update split context when display size changed
Because SnapAlgorithm use many resources value and it will be
affected by density, we should update context and
mDividerSnapAlgorithm too when configuration density changed.

Fix: 250483334
Test: manaul
Test: atest SplitLayoutTests
Change-Id: I207a025503c032318ede707eed786ae83b60e658
2022-10-06 17:12:57 +08:00
Garfield Tan
16b78301e7 Merge "Put window decors at one place" into tm-qpr-dev 2022-10-06 00:03:33 +00:00
Garfield Tan
73166e71d0 Put window decors at one place
There are some juggling between task listeners and the transition
observer of window decors because they are hosts together with its
corresponding task states. This change can remove those juggling by
putting all of them at one place.

Bug: 250622579
Test: atest WMShellUnitTests
Change-Id: Ic1db1633a5e79e2bcea5885b8fc2f345fa05fb1e
2022-10-05 12:06:36 -07:00
TreeHugger Robot
96eae2359b Merge "Make startTransition one-way" into tm-qpr-dev 2022-10-05 12:52:45 +00:00
Massimo Carli
778001641a LetterboxEdu not visible when device is docked
If the device is docked the letterbox edu should not be visible.

Fix: 215098637
Test: Run `atest WMShellUnitTests:LetterboxEduWindowManagerTest WMShellUnitTests:CompatUIControllerTest`

Change-Id: I9ad5274654ed827fc31800d9d6dae5be1fc4baa1
2022-10-04 21:58:37 +00:00
Mateusz Cicheński
5e05a02c9c Merge "Refactor isAnimating to PipAnimationController, and update references." into tm-qpr-dev 2022-09-28 18:42:31 +00:00
Nick Chameyev
f45946c742 [Partial Screensharing] Implement loading of recent tasks, thumbnails and icons
Adds implementation of providers to get list of
recent tasks, recent task thumbnails and icons.

Adds a method to Shell's RecentTasks interface to
get a provider of recent tasks without using the IRecentTasks
binder object (which is used by Launcher) as we can
call it directly inside SystemUI.

Bug: 240924731
Test: atest com.android.wm.shell.recents.RecentTasksControllerTest
Test: atest com.android.systemui.mediaprojection.appselector.data.ShellRecentTaskListProviderTest
Change-Id: I89579fc8e4e07f6bf656d300ecdbb75bdcb91035
2022-09-27 19:08:28 +01:00
Riddle Hsu
7e2eeb1395 Make startTransition one-way
If shell is starting an existing transition, it doesn't need the
returned transition token so it can be an async call then it won't
block shell's thread to execute other operations.

If shell is starting a new transition, then use the new added 2-way
startNewTransition which is the same as the original path.

Bug: 248550757
Test: atest ShellTransitionTests
Test: CtsWindowManagerDeviceTestCases with shell transition
Change-Id: I5f64d19475d5b857a461775dd6f3002567e93ad8
2022-09-27 15:06:37 +08:00
Ats Jenk
df2bdd5135 Merge "Add support to show apps on desktop in sysui proxy" into tm-qpr-dev 2022-09-26 23:43:18 +00:00
Ats Jenk
d849498a69 Add support to show apps on desktop in sysui proxy
This enabled launcher to show all desktop apps when user clicks on the
desktop tile in recents.
This is only enabled when Desktop Mode feature flag is enabled.

Bug: 244348395
Test: atest DesktopModeControllerTest
Change-Id: I3c89ef01fd7d1f457a7afabda94b481711c0a350
2022-09-26 10:53:10 -07:00
Mady Mellor
3b9ef3fee1 Allow floating tasks to be shown as bubbles (behind a sysui flag)
Special "app bubble" that is ordered at the front of the list unless
something else was selected. This is guarded behind the flag to
enable floating tasks, and a new flag to allow floating tasks to be
bubbles.

Test: manual  - enable the flags and create a floating task
             => floating task appears in a bubble
Bug: 237678727
Change-Id: Ibf66e8bae07800b5f64598c9b50de7a7995d09e6
2022-09-22 12:11:28 -07:00
Mady Mellor
2b9353ffbc Merge "Support for a floating task window (behind a sysui flag)" into tm-qpr-dev 2022-09-22 14:58:12 +00:00
Chris Li
646b0c13e6 Merge "Skip ActivityEmbedding animation if it is behind an app starting window" into tm-qpr-dev 2022-09-22 08:14:08 +00:00
Chris Li
6a3dfb250a Skip ActivityEmbedding animation if it is behind an app starting window
Bug: 207070762
Test: atest WMShellUnitTests:ActivityEmbeddingAnimationRunnerTests
Test: atest WmTests:TransitionTests
Change-Id: I602201646040f3358a688dcb6ec779f8244953ac
2022-09-22 11:25:38 +08:00
Jerry Chang
f3e52f55a6 Merge "Fix not able to start a shortcut into split" into tm-qpr-dev 2022-09-22 01:34:59 +00:00
Jerry Chang
601373db16 Fix not able to start a shortcut into split
Add back flags to allow start background activities since besides
drag-and-drop, start a shortcut into split also need these permission.

Fix: 243101552
Test: atest StageCoordinatorTests
Test: long press on a shortcut to enter split
Change-Id: I9159734836183c811642dffe1a9faebb2ccc23a5
2022-09-21 12:54:06 +00:00
Mady Mellor
38edb219c0 Support for a floating task window (behind a sysui flag)
Creates a new package within shell for floating tasks along with a
basic controller and interfaces for sysui and launcher to use to
manage floating tasks.

A single floating task is allowed at a time and they can only be
created if a sysui flag is turned on.

The floating task is backed by a TaskView, floats above all other
content, and can be moved via a handle at the top of the view. The
view sticks along the left and right edges of the screen, can be
stashed (similar to PIP), and can be removed by dragging to a dismiss
target in the middle of the screen (similar to PIP & bubbles).

The tests included trigger the sysui flag on and off to ensure the
flag behavior (i.e. that you can't create one unless the flag is on).

Test: atest FloatingTaskControllerTest
Bug: 237678727
Change-Id: I490c44685825e14166869b2cf7c2994ee0e30ba7
2022-09-21 02:12:46 +00:00
HQ Liu
51afb38bda Merge "Use RootTaskDisplayAreaOrganizer to change windowing mode" into tm-qpr-dev 2022-09-20 19:43:33 +00:00
Mateusz Cicheński
434cd02867 Refactor isAnimating to PipAnimationController, and update references.
Test: n/a, refactoring existing code
Bug: 183746978
Change-Id: I81de02be9e1edc04fa31e3fc589fb92646b6cfe0
2022-09-20 17:14:38 +00:00
Ats Jenk
0a0969af1c Merge "Move active task tracking to a repository" into tm-qpr-dev 2022-09-17 00:16:33 +00:00
HQ Liu
e4ef661839 Use RootTaskDisplayAreaOrganizer to change windowing mode
In core, windowing mode is being set in TDA with ag/19902621. Thus, set
windowing mode with RooTaskDisplayAreaOrganizer instead of
RootDisplayAreaOrganizer.

Bug: b/241168290
Test: services/tests/wmtests
Change-Id: Ib7e6701839f83ab4125a9630d20203f8c5e415ba
2022-09-16 16:09:54 -07:00
Ats Jenk
8a3cf44c9a Move active task tracking to a repository
We were tracking active freeform tasks in the RecentTasksController.
This causes some issues when we want to share that information to other
controllers like DesktopModeController.
Move tracking of active tasks to a separate repository that controllers
can query and listen for updates.

Bug: 244348395
Test: atest DesktopModeTaskRepositoryTest RecentTasksControllerTest
Change-Id: I7a460020f6b2133225e292a04f29ae1dd27e964b
2022-09-16 13:51:42 -07:00
Evan Rosky
d6c6f5865f Merge "Use transition for desktop-mode switch when enabled" into tm-qpr-dev 2022-09-16 16:38:27 +00:00