Commit Graph

1182 Commits

Author SHA1 Message Date
Winson Chung
d69a267b95 Merge "Support running WMShellUnitTests from studio" into tm-qpr-dev 2022-07-09 02:36:24 +00:00
Winson Chung
b91392d3b4 Support running WMShellUnitTests from studio
- Remove unnecessary @Presubmit annotation
- Fix issue with test activity referencing wrong resources
- Disable protolog requirement for tests when running under studio
  (like we do for SysUI studio builds)
- Ensure all tests extend ShellTestCase

Test: Run tests from studio, and also from atest WMShellUnitTests
Bug: 238444377
Change-Id: I60a96dfcbbf119d6736e96193f5a7d41611e2fd1
2022-07-08 19:59:48 +00:00
Mateusz Cicheński
ae9ad2d4fa Merge "Mark the test as flaky, to unblock presubmit." into tm-qpr-dev 2022-07-08 16:57:59 +00:00
Winson Chung
7411c42f3d Merge "Don't copy null surface control and remove lingering references to leashes" into tm-qpr-dev 2022-07-08 16:17:05 +00:00
Mateusz Cicheński
d41b50df47 Mark the test as flaky, to unblock presubmit.
Turns out class inheritance doesn't work well with annotations, they are not being overriden.

Test: n/a, since it's annotations, but also: atest WMShellFlickerTests:AutoEnterPipOnGoToHomeTest
Bug: 238367575
Bug: 238255886
Change-Id: I337742b75643e633e4bc0e2815da1eab19c4441c
2022-07-07 23:52:38 +00:00
TreeHugger Robot
54300c5851 Merge "Stop assuming the existence of displays when tasks appear" into tm-qpr-dev 2022-07-07 17:46:38 +00:00
Jerry Chang
312e15b0f7 Merge "Support to launch multi-instance when long press to split on an app icon" into tm-qpr-dev 2022-07-07 08:53:39 +00:00
Winson Chung
c40e75b6d3 Don't copy null surface control and remove lingering references to leashes
- If a task that should otherwise be organized but does not yet have a
  surface when the task organizer is registered, then skip trying to
  return that task as we can not leash it.  Existing logic will send the
  task to the organizer once a surface control is set on it.
- In the entry points to the shell where leashes are given from WM core
  (ie. the organizers), ensure that we release them when we are notified
  that they are no longer organized

Bug: 235858985
Test: atest ShellTaskOrganizerTests
Test: atest WindowOrganizerTests
Change-Id: I16d29315b615b9756a78310d6a62fb6f21ba1184
2022-07-07 06:05:50 +00:00
Bidhya Sharma
d69caeeeda Merge "Revert "Don't copy null surface control and remove lingering references to leashes"" into tm-qpr-dev 2022-07-07 00:37:20 +00:00
Bidhya Sharma
ad41a1e805 Revert "Don't copy null surface control and remove lingering references to leashes"
This reverts commit c6ab8e8cc6.

Reason for revert: Breaking CtsWindowManagerDeviceTestCases

Change-Id: I4a4f3bf96061757acf4f68ced20ffa7351f60859
2022-07-07 00:27:12 +00:00
Mateusz Cicheński
c11694a358 Merge "Add a unit test for auto-enter PiP by navigating to home" into tm-qpr-dev 2022-07-06 21:55:35 +00:00
Winson Chung
9693a78322 Merge "Don't copy null surface control and remove lingering references to leashes" into tm-qpr-dev 2022-07-06 21:30:49 +00:00
Mateusz Cicheński
075f8b36ad Add a unit test for auto-enter PiP by navigating to home
Test: atest WMShellFlickerTests:AutoEnterPipOnGoToHomeTest
Bug: 234164339

Change-Id: Ifa4644264900da003b873b940743188e0310ff7d
2022-07-06 16:31:35 +00:00
Jerry Chang
5b6d53e8c5 Support to launch multi-instance when long press to split on an app icon
Fix: 233174334
Test: atest WMShellUnitTests
Test: manual check the behavior of long press to split
Change-Id: I779569a0781be613e3223cc473705d235cb48363
2022-07-05 01:32:31 +00:00
Mateusz Cicheński
62c8628d41 Remove the FlakyTest annotation from no-longer flaky test.
Effectively removing override, given that it always simply calls super method.

Test: atest WMShellFlickerTests
Bug: 206753786

Change-Id: I5b266b9aa46d3d5464dc8ad3b602b08df4a56799
2022-06-30 22:56:21 +00:00
Garfield Tan
053341fa89 Stop assuming the existence of displays when tasks appear
WM shell may not receive the display added notifications when it
receives tasks appearing, so we need to wait for the display to show up
when it doesn't exist.

It's fairly difficult to test the case in real life, but it's a good
case for a unit test. Therefore this CL also makes WindowDecoration unit
tests friendly.

Bug: 236215336
Test: Caption in shell looks OK.
Test: atest WMShellUnitTests:WindowDecorationTests
Test: atest WMShellUnitTests:PipTaskOrganizerTest
Test: atest WMShellUnitTests:PipAnimationControllerTest
Change-Id: Ife0f85fdbd59b84303fc50f4ec896c53a259cec6
2022-06-30 11:38:54 -07:00
Winson Chung
c6ab8e8cc6 Don't copy null surface control and remove lingering references to leashes
- If a task that should otherwise be organized but does not yet have a
  surface when the task organizer is registered, then skip trying to
  return that task as we can not leash it.  Existing logic will send the
  task to the organizer once a surface control is set on it.
- In the entry points to the shell where leashes are given from WM core
  (ie. the organizers), ensure that we release them when we are notified
  that they are no longer organized

Bug: 235858985
Test: atest ShellTaskOrganizerTests
Test: atest WindowOrganizerTests

Change-Id: I863ab057a4a566060a1efbe8a20f2dd854fa8c74
2022-06-30 18:30:18 +00:00
TreeHugger Robot
df74b6ddbc Merge "Add CUJ for dragging taskbar icon to split" into tm-qpr-dev 2022-06-30 05:28:08 +00:00
Tiger Huang
228988d5e7 Merge "Send the attached frame to the client" into tm-qpr-dev 2022-06-23 06:11:07 +00:00
Hongwei Wang
3d29930505 Merge "Get PiP state from Shell in EdgeBackGestureHandler" into tm-qpr-dev 2022-06-22 16:56:57 +00:00
Hongwei Wang
e9e4ca3ecd Get PiP state from Shell in EdgeBackGestureHandler
We use to rely on the onActivityPinned and onActivityUnpinned callbacks
from Window Manager in EdgeBackGestureHandler to determine the current
PiP state and it will always be reset to false when
EdgeBackGestureHandler is being re-created, for instance, as a result of
folded state change.

Deprecated also the Pip#setPinnedStackAnimationListener interface method
since it's not in use and it may cause confusions over
IPip#setPinnedStackAnimationListener.

Bug: 174702196
Bug: 198651351
Test: stash in unfolded state -> fold -> drag to unstash \
      stash in folded state -> unfold -> drag to unstash
Test: atest WMShellUnitTests:PipControllerTest
Change-Id: Id874056415011ee8a55dadcd4ec6af6e1b568092
2022-06-21 18:19:10 -07:00
Tiger Huang
157514510f Send the attached frame to the client
The attached frame is the frame of the parent window that its child
attaches to, as long as the child is not
TYPE_APPLICATION_ATTACHED_DIALOG. It is a factor while computing the
window frame.

Previously, we let the child obtain the attached frame from its parent
view root. However, if the parent and the child are not in the same
process, it can be tricky.

This CL sends the attached frame from the server to the client via
ClientWindowFrames. In this way, the child can compute its window frame
without having to accessing the parent view root.

Bug: 161810301
Bug: 175861127
Test: atest ActivityRecordTests WindowLayoutTests
Change-Id: Ia844a4c927027e305a56114216eaee2bf7933b1f
2022-06-20 21:09:40 +08:00
Shan Huang
f89eb1e5b5 Pass the values of the MotionEvent instead of the event instance itself
to BackAnimation.

The original MotionEvent instance may have been recycled by the time BackAnimation processes it, since BackAnimation runs in a different thread. This could cause crashes from both Java side and native side, as described in b/233163975#comment11.

We work around this by passing the numerical values that BackAnimation
need instead of the MotionEvent itself.

Test: Swipe back in various scenarios. Make sure back can be triggered.
Try cancel. Make sure back can be cancelled.
Test: atest BackAnimationControllerTest
Bug: 233163975

Change-Id: I4792debc705536b49d1caafcc43e5466941c1d43
2022-06-18 03:39:53 +00:00
Hongwei Wang
56dcce9893 Avoid conflict surface reset on auto-enter-pip
This fix was introduced in ag/16150706 and recently got overridden with
ag/18751998, UnfoldAnimationController#resetTask happens in between
RecentsAnimationController cleanup and PipTaskOrganizer#onTaskAppeared
may cause flicker at the end of auto-enter-pip transition.

Fix it by intentionally ignore resetSurface if the task's pinned.

Bug: 235737615
Test: auto enter pip repeatedly on foldable
Test: atest WMShellUnitTests:UnfoldAnimationControllerTest
Change-Id: I5de034f5c0d3f150dd77aadb97c0d2b3f9c64c15
2022-06-14 17:07:50 -07:00
Chilun Huang
9e2810930b Add CUJ for dragging taskbar icon to split
Add CUJ to enter split screen by dragging app icon from taskbar.

Bug: 231400119
Test: atest EnterSplitScreenByDragFromTaskbar
Change-Id: Ifb675112e761016799a565c90def2961b0a4a401
2022-06-13 10:17:39 +08:00
Mateusz Cicheński
8c21721c18 Use tapl instrumentation to go home.
This fixes an issue in gesture nav, when the swipe would not be properly recognized.

Test: atest WMShellFlickerTests:EnterPipOnUserLeaveHintTest
Bug: 234848637

Change-Id: I011cd3a83531f48939d4ac4d7686e0f142b2766b
2022-06-09 22:04:13 +00:00
TreeHugger Robot
83f09e945a Merge "Add CUJ for dragging notification icon to split" into tm-qpr-dev 2022-06-09 03:38:24 +00:00
Nick Chameyev
8033604552 Revert: Revert: Migrate unfold animation to Shell transitions [Part 3]
Adds real unfold animation for split-screen tasks when
doing the Shell unfold transition.
The approach is similar to full-screen tasks:
we animate the surfaces using shell transition
only when unfolding, when folding we are doing
it in the old way (by directly accessing
the surfaces from TaskOrganizer).

Refactored the previous fullscreen/splitscreen unfold
controllers flow to have one controller where we can
register diferrent 'animators'. This controller listens
to all task events in the shell task organizer.

Bug: 204925795
Test: folding/unfolding, rotating with a split layout
  when Shell transitions enabled/disabled,
  rotating display when folded/unfolded
Change-Id: Iff608bc8ab2390a57b01de8f07bad681c979be49
2022-06-08 13:37:25 +00:00
Chilun Huang
cc34ae620f Add CUJ for dragging notification icon to split
Add CUJ to enter split screen by dragging notification icon.

Bug: 231399941
Test: atest EnterSplitScreenByDragFromNotification
Change-Id: I5d9dc065346256ec7a5fbfd9a1fede3bdb91d8ba
2022-06-08 16:53:30 +08:00
Jerry Chang
5e5d3a1544 Merge "Fix not able to launch multi-instance with drag and drop gesture" into tm-qpr-dev 2022-06-08 01:37:16 +00:00
Vinit Nayak
422f1d8b4e Merge "Rename split classes/variables for consistency" into tm-qpr-dev 2022-06-07 22:36:47 +00:00
Luis Delgado De Mendoza Garcia
3b628d7c69 Merge "Revert "Migrate unfold animation to Shell transitions [Part 3]"" into tm-qpr-dev 2022-06-07 01:19:45 +00:00
Vinit Nayak
5fc5261a8e Rename split classes/variables for consistency
Fixes: 233006032
Change-Id: I7c1627b05b93999d08ee4a89c1498ac91021c5b0
2022-06-06 16:33:47 -07:00
Mady Mellor
9f5ed9f3e7 Merge "Fix an issue where the pointer could be invisible" into tm-qpr-dev 2022-06-06 23:21:32 +00:00
Luis Delgado De Mendoza Garcia
2a7f7b919a Revert "Migrate unfold animation to Shell transitions [Part 3]"
Revert "Update TaskListener constructors to match the upstream"

Revert submission 18628270-unfold-shell-p3

Reason for revert: b/235090315
Reverted Changes:
Ibe684471a:Migrate unfold animation to Shell transitions [Par...
I7bd398c96:Update TaskListener constructors to match the upst...
I7bd398c96:Migrate unfold animation to Shell transitions [Par...

Bug: 235090315
Change-Id: I8639d618131c09f7a5f0c776fb02c426b78b1fdd
2022-06-06 21:13:07 +00:00
Mady Mellor
25fdf10ad1 Fix an issue where the pointer could be invisible
Add setBackgroundAlpha and use that to change the alpha of the
expanded view background and pointer.

Test: manual - have a bunch of bubbles, expand them, dismiss the
               selected one
               => verify that the arrow is visible for the next bubble
	     - turn on home animation, swipe up to collapse a bubble
               => verify pointer looks fine
Bug: 234739591
Change-Id: If5823840d148e2031312c54eba9c0132b8aa3a4c
2022-06-06 12:20:27 -07:00
Nick Chameyev
cd6eac332c Merge "Migrate unfold animation to Shell transitions [Part 3]" into tm-qpr-dev 2022-06-06 09:33:10 +00:00
Mateusz Cicheński
e86b8edc91 Merge "Add a flicker test for entering PiP via navigation to Home" into tm-qpr-dev 2022-06-02 20:40:28 +00:00
Mateusz Cicheński
25cfccaaa0 Add a flicker test for entering PiP via navigation to Home
Bug: 216577639
Test: atest WMShellFlickerTests:EnterPipOnUserLeaveHintTest

Change-Id: I59448191a22c31e4591346de58695ff653e3687f
2022-06-01 17:27:20 +00:00
Jerry Chang
f62fecc458 Fix not able to launch multi-instance with drag and drop gesture
There are apps using alias activity name, result to wm-shell not able to
determine whether it's launching the same component or not. Update to
check the component name in the intent that created the task instead to
prevent affected by alias component name.

Fix: 224901460
Fix: 234304765
Fix: 233922245
Fix: 233174334
Fix: 232034346
Test: atest WMShellUnitTests
Test: manual check drag to launch multi-instance or drag to switch
      split position with reported apps work
Change-Id: I924120134bb3ce6abe582251e3afdc7a0825a6a5
2022-06-01 08:32:50 +00:00
TreeHugger Robot
70c1287127 Merge "Modify app expected position base on the drag behavior change" into tm-qpr-dev 2022-05-27 21:39:24 +00:00
Mateusz Cicheński
2542f63ded Merge "Add keep clear area avoidance algorithm for PiP" into tm-qpr-dev 2022-05-27 19:53:42 +00:00
Chilun Huang
31b85ddad7 Modify app expected position base on the drag behavior change
Because ag/18529596 change the drop position, the test need to modify
the expected position of the app.

Bug: 232878493
Test: atest EnterSplitScreenByDragFromAllApps
Change-Id: Ib4823a899aa42ab2c0b23f9e654cbf13becb02bd
2022-05-28 02:24:33 +08:00
Nick Chameyev
181024c157 Migrate unfold animation to Shell transitions [Part 3]
Adds real unfold animation for split-screen tasks when
doing the Shell unfold transition.
The approach is similar to full-screen tasks:
we animate the surfaces using shell transition
only when unfolding, when folding we are doing
it in the old way (by directly accessing
the surfaces from TaskOrganizer).

Refactored the previous fullscreen/splitscreen unfold
controllers flow to have one controller where we can
register diferrent 'animators'. This controller listens
to all task events in the shell task organizer.

Bug: 204925795
Test: folding/unfolding, rotating with a split layout
  when Shell transitions enabled/disabled,
  rotating display when folded/unfolded
Change-Id: I7bd398c963125ceb7c8f8e3786a274853366feb3
2022-05-27 13:54:00 +00:00
TreeHugger Robot
e4d77e2522 Merge "Add assertions for layers become visible" into tm-qpr-dev 2022-05-26 05:56:07 +00:00
Mateusz Cicheński
407ea1ad4f Add keep clear area avoidance algorithm for PiP
The algorithm computes a new position for PiP based on the registered
keep clear areas within the system. If no occlusion happens the original
position is being returned. Otherwise, the bounds are moved in one of the
available directions so that none of the keep clear areas are occluded
while keeping PiP within the display bounds.

Test: atest PipKeepClearAlgorithmTest
Bug: 183746978
Change-Id: Ic2d11861329a46e2da0448f90283f67f6e7125d7
2022-05-25 23:01:54 +00:00
Chilun Huang
6384389786 Add assertions for layers become visible
Add more assertions for layers become visible.

Bug: 232878493
Test: atest EnterSplitScreenByDragFromAllApps

Change-Id: Ida948525b618b800915813cf2927523600e23724
2022-05-25 15:07:28 +08:00
Vadim Caen
21421cd776 DO NOT MERGE Only rely on developer option for back animation am: ab58191c7f am: 1d83999ad0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18310267

Change-Id: I59cdc9e93cce4e8b7cbeaea5f0816d5a78a7d7de
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-23 19:34:50 +00:00
Vadim Caen
1d83999ad0 DO NOT MERGE Only rely on developer option for back animation am: ab58191c7f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18310267

Change-Id: I150be6a4fae771ffe6e841806772aa2218ae871b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-23 19:32:00 +00:00
Vadim Caen
ab58191c7f DO NOT MERGE Only rely on developer option for back animation
BackNavigationController was still relying on a debug setting. Now the
animation request is handled via a boolean parameter passed by sysui,
which has access to the developer option.

Test: Existing test modified
Bug: 231502692
Change-Id: Icda4692e05396407d961610de0ce709492adadc1
Merged-In: Icda4692e05396407d961610de0ce709492adadc1
2022-05-23 10:43:04 +00:00