Commit Graph

1288 Commits

Author SHA1 Message Date
HQ Liu
51afb38bda Merge "Use RootTaskDisplayAreaOrganizer to change windowing mode" into tm-qpr-dev 2022-09-20 19:43:33 +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
Jerry Chang
b48c123b67 Merge "Fix timeout when dismissing split screen to two pane mode" into tm-qpr-dev 2022-09-16 00:51:43 +00:00
Evan Rosky
6a1363adc8 Use transition for desktop-mode switch when enabled
WHen using shell-transitions, use a transition instead of
regular applyTransaction

Bug: 236047261
Test: use desktop-mode switch w/ shell-transit. observe an actual
      transition.
Change-Id: I81f37d278420383f8b2b0f37cca8a398313705cb
2022-09-16 00:26:59 +00:00
Chris Li
7eb3933a3e Merge "Only play ActivityEmbedding animation if there is AE split" into tm-qpr-dev 2022-09-15 23:31:24 +00:00
Chris Li
941a2e72f6 Merge "Play ActivityEmbedding animation if all changes in Task with embedded" into tm-qpr-dev 2022-09-15 23:31:09 +00:00
Chris Li
b74873a410 Only play ActivityEmbedding animation if there is AE split
Same as the legacy app transition, we want to play the app customized
animation if there is no AE split.

We don't support app customized animation when there is AE split yet to
make the animation consistant.

Bug: 207070762
Test: atest WMShellUnitTests:ActivityEmbeddingControllerTests
Test: atest WmTests:TransitionTests
Change-Id: I68348cd650b9dbc8c39ef8d22a171d128e196882
2022-09-15 06:31:01 +00:00
Chris Li
1efadcb97c Play ActivityEmbedding animation if all changes in Task with embedded
Same as the legacy app transition, we want to play AE animation if all
changes are in Task with embedded activity

Bug: 207070762
Test: atest WmTests:TransitionTests
Change-Id: I66c5c083a517b3254d647c7335264eba8837f0cd
2022-09-15 06:30:05 +00:00
Jerry Chang
d65119ec02 Fix timeout when dismissing split screen to two pane mode
After I1a0c4d17, the expanding task will first be resized to fullscreen
then reparent to TDA after the divider bar fling animation finished. If
the expanding app is expanding to two pane mode, the resuming of the
second activity might be skpped due to the task in another side of the
split is already empty and invisible.

Update the drag-to-dismiss flow to reorder the expanding task on the top
of dismissing task. So the content in the dismissing side won't flicker
during the dismissing transition and the activity resume won't be
skipped in the expanding side.

Fix: 243368173
Test: atest WMShellFlickerTests
Test: atest WMShellUnitTests
Test: put Settings and Chrome in split screen,
      drag divider bar to dismiss Chrome,
      verified the expanding transition won't timeout
Change-Id: Id16c1d9b4849d5f600de9524ffebb91aba73a721
2022-09-15 03:24:17 +00:00
Ikram Gabiyev
2dc6275e3a Allow pip screen size to toggle on double tap
Make sure pip screen size animates to normal
or maximum size depending on the current width
when a double tap occurs

Test: manually reproduced steps in the bug listed
Test: atest WMShellUnitTests:PipDoubleTapHelperTest
Test: atest WMShellFlickerTests:ExpandPipOnDoubleClickTest

Bug: 232173973
Change-Id: Ia8ec8696fddd236f992803451f44457e974069ac
2022-09-13 20:16:46 +00:00
Hongwei Wang
f121693b9d Merge "Update PiP movement bounds on TaskBar inset change" into tm-qpr-dev 2022-09-12 18:02:43 +00:00
Hongwei Wang
f6fda1770a Update PiP movement bounds on TaskBar inset change
The DisplayLayout#stableInsets was set according to navigation bar
height and not get updated when TaskBar becomes visible.

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/dPuTSbBuAgjfyKiliwzo2Q
Bug: 198644965
Test: Open another app with PiP present and move it around, see Video
Test: atest WMShellUnitTests:PipControllerTest
Change-Id: I4db1446de0cb257e26d34985d294908cfe692967
2022-09-09 14:31:50 -07:00
Ats Jenk
39e0f9f958 Merge "Add unit test for GroupedRecentTaskInfo" into tm-qpr-dev 2022-09-09 18:30:53 +00:00
Ivan Makarov
bd8d6fc437 Merge "Move SplitscreenEventLogger to StageCoordinator" into tm-qpr-dev 2022-09-09 11:36:05 +00:00
Ivan Makarov
8ac0ae76e0 Move SplitscreenEventLogger to StageCoordinator
Currently, the SplitscreenEventLogger is declared as private final and
initialized in constructor of the SplitScreenController and not used
anywhere else in the SplitScreenController. Moved the initialization to
the StageCoordinator and removed the field from SplitScreenController.

Bug: 245650570
Test: atest SplitTransitionTests
Test: atest SplitScreenControllerTests
Test: atest StageCoordinatorTests

Change-Id: Iedc8893982f3bc4ba4c41f6a394f5fdf39098a99
Merged-In: Iedc8893982f3bc4ba4c41f6a394f5fdf39098a99
2022-09-09 09:51:09 +00:00
Ats Jenk
c3e38f4ae4 Add unit test for GroupedRecentTaskInfo
Add unit tests for creating GroupedRecentTaskInfo objects and the
parcelling logic.

Bug: 244348395
Test: atest GroupedRecentTaskInfoTest
Change-Id: I10c97e91f164a45c3ed17935a820c5ed168e8305
2022-09-08 20:48:52 +00:00
Ats Jenk
b092c78a7a Track active freeform tasks
Track active freeform tasks and filter them from recent tasks in overview if
desktop mode is active.
A task is considered an active freeform task if it meets the following criteria:
- task is running
- task has been visible at least once when desktop mode was on

Bug: 244348395
Test: atest RecentTasksControllerTest
Change-Id: I10854b467615fc5bb257c1719d3887643d28fd52
2022-09-07 15:24:57 -07:00
Ats Jenk
70a463df5c Merge "Only clear bounds and windowing mode for standard" into tm-qpr-dev 2022-09-06 16:06:54 +00:00
Vali Calinescu
f6b0a6487f Merge "Fix typo in EnterPipToOtherOrientationTest" into tm-qpr-dev 2022-09-05 14:18:05 +00:00
Ats Jenk
0de70a4160 Merge "Move check for 'desktop mode active' to helper" into tm-qpr-dev 2022-09-02 19:05:37 +00:00
Ats Jenk
aa39e03993 Only clear bounds and windowing mode for standard
When we switch between desktop and focused modes, we clear bounds and
reset windowing mode for all tasks.
Make sure this affects only tasks that have activity type set to
ACTIVITY_TYPE_STANDARD. This ensures we don't clear bounds or reset
windowing mode for launcher or split screen stages etc.

Bug: 244348395
Test: atest ShellTaskOrganizerTests
Change-Id: Iaf84cb2733a6ffa93c267cb8c716e7c0eb7ca13f
2022-09-02 11:16:21 -07:00
Vali Calinescu
994b3bf56d Fix typo in EnterPipToOtherOrientationTest
Fix: 244734796
Test: N/A
Change-Id: I9ec3baa6de3b96cab9189529ced4d48f0ab1f54e
2022-09-02 16:10:20 +00:00
Ats Jenk
fe50d13c04 Move check for 'desktop mode active' to helper
Test: build wmshell
Bug: 244348395
Change-Id: I7157c977200d70f54767f4587010e1872f03616d
2022-09-02 09:00:26 -07:00
TreeHugger Robot
2d4204a3b0 Merge "Remove decoration layers from hierarchy on release" into tm-qpr-dev 2022-09-02 14:21:58 +00:00
Mateusz Cicheński
abcf028aa9 Merge "Move PiP in response to keep clear areas changed events." into tm-qpr-dev 2022-09-02 05:19:12 +00:00
Mateusz Cicheński
835dd73120 Move PiP in response to keep clear areas changed events.
PiP window will gravitate towards bottom of the screen if it's in the bottom half of it.
PiP window will gravitate towards left/right edge of screen, whichever is closer.
PiP window will avoid occluding any reported keep clear areas.

Test: manually, existing tests pass
Bug: 183746978

Change-Id: Idb481fee7ead67734c5de0d833b281ca2a2aaaa8
2022-09-02 00:23:34 +00:00
Garfield Tan
c6a2b7e299 Remove decoration layers from hierarchy on release
Bug: 244586478
Bug: 243977698
Test: Decor layers aren't in the hierarchy after release.
Test: Old task backgrounds don't remain.
Change-Id: I28b31409069fd482bbf235ed39a16681e5b7c250
2022-09-01 15:14:39 -07:00
Garfield Tan
9678d36dc5 Move caption under DecorationContainerSurface
Therefore caption can be put at the same layer as other window
decorations. It adds CaptionContainerSurface to host the caption so that
WindowDecoration can put the caption at the same position as the task
surface.

Bug: 241598994
Test: atest WindowDecorationTests
Test: Caption is shown in front of embedded activities.

Change-Id: I9ec571859680f622449f4c3b5cea27222ec4c788
2022-08-31 16:06:45 -07:00
Tony Huang
5b09708ef6 [Re-land]Improve enter split transition
Improve enter split transition by two part changes.
1. Enter split with resizing animation:
   We directly show split but no animation before, it might looks
   bad to user because UI change too many things in few frames.

2. Fix flicker cause by black screen when split active:
   When we start intent on side stage task, the top split root task
   will go to top and current top one task will be set as invisible
   then cause black screen due to split root task is full screen.
   Solve this by use new wct api setForceTranslucent to make split
   root task as translucent when split inactive. We need to reset
   it when split active otherwise it cause flicker when back to home.

   Except above change, we also need to set side stage bounds to
   area outside of screen otherwise it still cause flicker because it
   will show a flash of shadow when launch intent on side stage.

   This solution should be removed after shell transition fully
   landing because in shell transition we could make those transitions
   be done in one transition.

3. Fix b/243634747 caused by the previous CL. We should ensure split top
   root is non-translucnet after split active by any flow.

4. Fix b/243735702 which occured on the previous CL. Because sync
   transcation might apply after the animation, we could remove apply
   when split active but only apply by the animator.

Fix: 223325631
Fix: 243634747
Fix: 243735702
Test: manual
Test: pass existing tests
Change-Id: Id8822aafe9eb0d6d5b0282cea256db622b9730d0
2022-08-30 07:09:27 +00:00
Garfield Tan
94cdc7ba95 Merge "Split window decor lifecycle to a TransitionObserver" into tm-qpr-dev 2022-08-27 00:43:47 +00:00
Garfield Tan
5959b4cd96 Split window decor lifecycle to a TransitionObserver
There are several transitions involving window decorations that are
handled by Launcher, but we still need to tie window decorations to the
lifecycle of such transitions to release window decorations at the right
time. Thus we move this part of logic into a new class.

Bug: 241975249
Test: atest FreeformTaskTransitionObserverTest
Change-Id: Iff14be6f1fcb0b8ee7f634d5d41567348fff5c06
2022-08-26 08:48:59 -07:00
Neha Jain
9e6b8ad640 Merge "Revert "Improve enter split transition"" into tm-qpr-dev 2022-08-26 02:31:38 +00:00
Neha Jain
af51b4d8a1 Revert "Improve enter split transition"
This reverts commit 288d5550cc.

Reason for revert: b/243634747

Change-Id: I3413f82999c068bb58aba8f7a7e40d95991f18c3
2022-08-25 20:36:27 +00:00
Wei Sheng Shih
4ec0b52029 Merge "[RESTRICT AUTOMERGE]BackGestureAnimation: a lightweight recents animation controller" into tm-qpr-dev 2022-08-25 14:04:21 +00:00
Chris Li
27ac388574 Merge "Animate ActivityEmbedding transition with Shell Transition" into tm-qpr-dev 2022-08-24 05:31:02 +00:00
wilsonshih
c9c9a757a8 [RESTRICT AUTOMERGE]BackGestureAnimation: a lightweight recents
animation controller

Copy most of code from RecentsAnimationController to back gesture
animation controller(BackNaviAnimationController), the infrastructure
can be reused for either back-to-home/back-to-task/back-to-activity
animations if needed. Since the infrasturcture of legacy recents
animation controller should be stable already, we don't need to
worry about issues like leak leashes/flickers/fixed rotation.

BackAnimationAdaptor is a temporary class to help migrate to shell
transition, the target is to replace it by RemoteTransition.

Next step: Migrate to shell transition, decouple animation info from
BackNavigationInfo.
Test: manually play back to home animation to verify no flicker/black
background/leak surface. Also test that there can play back to home
animation even when quick swipe.
Test: atest BackNavigationTest
Test: atest BackNavigationControllerTests BackAnimationControllerTest
Bug: 237642535

Change-Id: I436a3dcf5011c56c08d131b40168f19128cc8723
2022-08-24 02:35:46 +00:00
Chris Li
bdfb18ab73 Animate ActivityEmbedding transition with Shell Transition
Make a copy of TaskFragmentAnimation* to ActivityEmbeddingAnimation*
to fit into Shell transition model.

Bug: 207070762
Test: atest WMShellUnitTests:ActivityEmbeddingControllerTests
Test: atest WMShellUnitTests:ActivityEmbeddingAnimationRunnerTests
Change-Id: I44118e1415f85bcd49fa77bff10c67094ec9cad5
2022-08-24 10:04:00 +08:00
Winson Chung
fea416b8d4 Merge changes I63c90f71,I0f016aab into tm-qpr-dev
* changes:
  Minor cleanup
  Pipe user changed events to the Shell
2022-08-23 17:39:24 +00:00
Gaurav Bhola
39276b1fdf Merge "Add notifyInitialized(), notifyReleased() & isInitialized() methods in TaskView." into tm-qpr-dev 2022-08-23 13:35:30 +00:00
Tony Huang
9ab7dedcdd Merge "Improve enter split transition" into tm-qpr-dev 2022-08-23 02:11:54 +00:00
Ats Jenk
4c8cb70261 Merge changes from topic "desktop-windowing-hide" into tm-qpr-dev
* changes:
  Hide some options when desktop mode is available
  Handle desktop mode setting change
2022-08-20 00:37:53 +00:00
Hongwei Wang
5238c74d09 Merge "[Re-land] Remove getSfInstance usage from ViewRootImpl" into tm-qpr-dev 2022-08-19 22:03:03 +00:00
Winson Chung
c1dc8c8755 Pipe user changed events to the Shell
- Move PipController and OneHandedController to use this call internally
  instead of exposing it to SysUI

Bug: 238217847
Test: atest WMShellUnitTests
Test: atest PinnedStackTests
Test: Test switching users with PIP & One handed mode
Test: enable WM_SHELL_SYSUI_EVENTS protologs and verify
Change-Id: I0f016aabb945eb8ce80ee4d4203122659d668b8f
2022-08-19 17:22:06 +00:00
Tony Huang
288d5550cc Improve enter split transition
Improve enter split transition by two part changes.
1. Enter split with resizing animation:
   We directly show split but no animation before, it might looks
   bad to user because UI change too many things in few frames.

2. Fix flicker cause by black screen when split active:
   When we start intent on side stage task, the top split root task
   will go to top and current top one task will be set as invisible
   then cause black screen due to split root task is full screen.
   Solve this by use new wct api setForceTranslucent to make split
   root task as translucent when split inactive. We need to reset
   it when split active otherwise it cause flicker when back to home.

   Except above change, we also need to set side stage bounds to
   area outside of screen otherwise it still cause flicker because it
   will show a flash of shadow when launch intent on side stage.

   This solution should be removed after shell transition fully
   landing because in shell transition we could make those transitions
   be done in one transition.

Bug: 223325631
Test: manual
Test: pass existing tests
Change-Id: Iabc6ad708df021895783003d6267a7ed5dbc6d38
2022-08-18 07:25:16 +00:00
Ats Jenk
3fc369ff1a Handle desktop mode setting change
Listen to system setting change for desktop mode.
When it changes, update root display area windowing mode to either
freeform or fullscreen.

Bug: 241944030
Test: atest DesktopModeControllerTest ShellTaskOrganizerTests
Change-Id: I7962deab1f287f7cb177f9673e88409b4273276e
2022-08-17 14:35:46 -07:00
Gaurav Bhola
d058fe2142 Add notifyInitialized(), notifyReleased() & isInitialized() methods in TaskView.
- These will be helpful in carrying out initialization and clean-up logic in sub-classes.

Bug: 235151420
Test: atest TaskViewTest
Change-Id: I5d357ff742597f3b02150364404e3f3a7c2d49b0
(cherry picked from commit a72e61eb52)
2022-08-17 18:02:58 +00:00
Riddle Hsu
42e5e08382 Merge "Use seamless rotation if it is requested by display" into tm-qpr-dev 2022-08-15 10:33:36 +00:00