Commit Graph

4682 Commits

Author SHA1 Message Date
Riddle Hsu
e1ea5db7d4 Merge "Crop windowing layer for shell rotation animation" into tm-qpr-dev 2022-08-18 14:54:08 +00:00
Riddle Hsu
b1a7a58601 Crop windowing layer for shell rotation animation
This aligns the behavior as legacy rotation animation in commit db7097e.
Note that the crop will be cleared in finishTransaction set from core's
Transition#buildFinishTransaction.

Also clean some fields a bit.

Bug: 242664636
Test: Enable launcher rotation. Set animation scale to 10x.
      Rotate display and observe that the wallpaper does not exceed
      the area of previous display size.
Change-Id: Ie2144f7c19663b573167de819dde01cc9eca7ad4
2022-08-17 21:53:47 +08:00
Mateusz Cicheński
b8c7133078 Merge "Always invoke show on the dismiss target for pip." into tm-qpr-dev 2022-08-17 03:47:14 +00:00
Mady Mellor
bef8a5be14 Merge "Set the linear layout direction based on initial config" into tm-qpr-dev 2022-08-16 22:44:07 +00:00
Mateusz Cicheński
9d460d8fe1 Always invoke show on the dismiss target for pip.
Previously, if the user moved pip, and then started moving it again
before the dismiss target hide animation finished, the dismiss target
would not show up again, since it was still VISIBLE.

Test: manually, open pip and move it around, dismiss target always shows up
Bug: 242616699

Change-Id: Iac288f5855f0d26075113e795dd2b88b6a152275
2022-08-16 17:33:35 +00:00
Hongwei Wang
9d16d9dacb Merge "Fix flicker at the end of content PiP animation" into tm-qpr-dev 2022-08-16 16:29:36 +00:00
Jeff Chang
5a54deb009 Merge "Remove the validation check when enter split" into tm-qpr-dev 2022-08-16 10:30:53 +00:00
Tiger Huang
3712433349 Introduce IWindowSession#relayoutAsync
IWindowSession#relayoutAsync is similar to IWindowSession#relayout, but
the former is an oneway method which just sends the layout attributes to
the server. Since the client can compute its own window frame, it just
needs to send attributes to the server without getting blocked for
receving the window frame.

In somes cases, the client still needs to obtain things from the server.
Such as:

- When view visibility is changed. The client maybe not be able to
  receive the latest insets state while it is INVISIBLE or GONE. In this
  case, the client needs to obtain the frame and the insets state. Also,
  the client need to obtain the surface control when it becomes VISIBLE.

- When the insets state is stale but the config is up-to-date. This can
  happen when WindowProcessController sends the new config to the client
  before WindowState does. In this case, the client needs to obtain the
  window frame from the server.

- When the position and the size of the frame are both changed. This
  will trigger a BLAST sync, and the client needs to obtain the sync seq
  ID.

For cases above, the client needs to call the original relayout method.

Bug: 161810301
Bug: 175861051
Test: Seamless rotation, fixed rotation, and regular rotation.
Merged-In: Ifb365789fa08103773fd3180e486ba1d92042fc5
Change-Id: Ifb365789fa08103773fd3180e486ba1d92042fc5
2022-08-16 12:49:31 +08:00
Kevin Huang
490acded90 Merge "Fix not able to indicate split position in command to enter split" into tm-qpr-dev 2022-08-16 01:17:13 +00:00
Hongwei Wang
87403bf20e Fix flicker at the end of content PiP animation
The work around we use seems to cause the flicker at the end of
entering content PiP animation and the underlying issue for that work
around is not found with the latest build.

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/hrZU8ebsxP3mEqdaF6BfwL
Bug: 242601499
Test: repeatedly enter content PiP, see video
Change-Id: I6d9d78e6cca519ed8251221a7ceab829cb22aae1
2022-08-15 14:47:24 -07:00
Mady Mellor
dc0b0fd918 Merge "Only update the cached state if the value changed" into tm-qpr-dev 2022-08-15 16:24:40 +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
Jerry Chang
f67598da9e Fix not able to indicate split position in command to enter split
Fix: 242149134
Test: command "splitscreen moveToSideStage <taskid> <pos>" works
Change-Id: Ifa366af13b92610dc27d711256cb55d323e021a4
2022-08-15 06:32:18 +00:00
TreeHugger Robot
5e268ecb76 Merge "Import translations. DO NOT MERGE ANYWHERE" into tm-qpr-dev 2022-08-14 20:53:24 +00:00
Mady Mellor
66b33cb5d1 Set the linear layout direction based on initial config
Bug: 230077443
Test: - enable feature on phone
      - drag a notification from the shade
      => observe that the drop zones match current orientation
      - repeat in opposite orientation
      - repeat on tablet
Change-Id: I90fbb09d36bda7b66563dc4b4ac8fe1ec9d0cb31
2022-08-12 15:55:35 -07:00
Mady Mellor
f119f2712b Only update the cached state if the value changed
Test: atest BubblesTests
Bug: 242097561
Change-Id: Icaa37799741739121cc6d90da526bc9c9150c5ad
2022-08-12 13:49:56 -07:00
Maryam Dehaini
15f10cc98f Merge "Adding A Minimize Button" into tm-qpr-dev 2022-08-12 18:07:57 +00:00
TreeHugger Robot
5394471e3b Merge "Fix ShellTransitionTests on landscape devices" into tm-qpr-dev 2022-08-12 16:41:51 +00:00
Bill Yi
f22a13b848 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I716f4011b769017bc174c7816f6b695307719412
2022-08-11 22:15:08 -07:00
Maryam
6d80b7d676 Adding A Minimize Button
Added minimize button in the new WM shell to current caption and set its visibility to gone since Andoid UX is still debating on whether they will have it on by default in captions.

Bug: 242094334
Test: Used acloud to visualize and manually test changes
Change-Id: Iabeb0e94ae4adb2009dcfe7a365f9c8c9a7aa38f
2022-08-12 00:33:54 +00:00
Garfield Tan
4b1e9bc7e3 Fix ShellTransitionTests on landscape devices
ShellTransitionTests uses the real primary display and
DisplayController, and the upside down rotation is 90 degrees on some
landscape devices. This CL changes it to a mock so we have better
control on its behavior.

Bug: 242207533
Test: atest ShellTransitionTests
Change-Id: I4cacb79f5a9549f2ad62f42a92b4e01398879b5a
2022-08-11 13:06:23 -07:00
Garfield Tan
243c74b1b9 Add an observer class for transition lifecycles
This will be used to transfer window decorations over transitions,
regardless of the actual handler of these transitions.

Bug: 241975249
Test: atest ShellTransitionTests
Change-Id: I86486ec5af5057c8b22ccd7e4929627667672049
2022-08-11 11:03:49 -07:00
Riddle Hsu
7e7619803d Use seamless rotation if it is requested by display
Apart from making the display change has the highest priority to
decide whether to seamless rotation. Also Merge isRotationSeamless
and getRotationAnimation to one method so the animation hint can
be resolved in a single loop.


Fixes: 242179536
Test: ShellTransitionTests#testShouldRotateSeamlessly

Change-Id: I8ccf22e230fd4b6fab1e7aceb130fd876e9dc16c
2022-08-11 23:52:08 +08:00
Hongwei Wang
4a24c54245 Merge "[Re-land] Deprecate getSfInstance usage in PiP component" into tm-qpr-dev 2022-08-11 14:59:33 +00:00
Riddle Hsu
27e8872983 Merge "Set rotation layers as opaque initially" into tm-qpr-dev 2022-08-11 09:27:46 +00:00
Jerry Chang
9de781b8a4 Merge "Integrate split pair cold launch transition with shell transition" into tm-qpr-dev 2022-08-11 07:05:17 +00:00
TreeHugger Robot
9bb50c30a3 Merge "Clean divider-remote-animating flag when exit split" into tm-qpr-dev 2022-08-11 01:46:07 +00:00
Hongwei Wang
9fe333a07e [Re-land] Deprecate getSfInstance usage in PiP component
- Deprecated also the custom animation handler in PhysicsAnimator
- Ensures the transactions within PiP have VsyncId being set
- Still using getSfInstance in PipResizeGestureHandler since migrating
  to getInstance causes regression for resize-and-tap PiP window.

Trace: https://ui.perfetto.dev/#!/?s=8a3a073ce2f9ad84c7e377e6ba866657076adf0525444c0261e65b2e66f24a
Bug: 222697646
Test: Record perfetto trace while moving PiP, see the Trace
Test: verify PiP functionalities still work
Change-Id: I93f8bf2392425d72829600d0bbed0b3c58ec08d0
2022-08-10 13:31:09 -07:00
TreeHugger Robot
ff95cd095c Merge "Relax strictness of mocks in DisplayLayoutTests" into tm-qpr-dev 2022-08-10 17:31:51 +00:00
TreeHugger Robot
f1318aa342 Merge "6/ Removing unused code from previous cleanup" into tm-qpr-dev 2022-08-10 17:03:50 +00:00
Shan Huang
a33be48b49 Merge "Fix back to home animation restarts on a second swipe." into tm-qpr-dev 2022-08-10 15:05:52 +00:00
Riddle Hsu
73d7468fe6 Set rotation layers as opaque initially
The layers should cover the window behind during rotation animation.
So it can be opaque initially to avoid blended composition for one
intermediate frame.

After the animation starts and changes the alpha < 1 to the rotation
layer for fading animation, it can still switch from opaque composition
to blended composition automatically.

Bug: 240568519
Test: atest ChangeAppRotationTest

Change-Id: Ic4173d33c15c35e252315f9cf53127c759e56ece
2022-08-10 20:55:45 +08:00
Jeff Chang
874d1c03e9 Remove the validation check when enter split
Remove the validation checking first before we fix the PiP-to-Split
case. The validation checking is to prevent entering the unexpected
state in split when launched by adb with activity_adjacent flag.
2369dfab4f, e9c7b90a38, already fixed it from wm-core.
We can do the validation checking from split after.

Bug: 240652871
Test: 1. Launch app from recent app.
      2. Drag app to split from task bar.
Change-Id: Ia61f91dd2d505cc8b0d4f8194798b16222253ce4
2022-08-10 18:46:12 +08:00
Jeff Chang
032fc54d6e Clean divider-remote-animating flag when exit split
The flag is used to control divider bar animation. We should also
clean the flag while exit split-screen to prevent split can not
update the divider bar visibility. Currently, the flag is clean
from remote animation finished or canceled. It’might be have the
possibility of not cleaning the flag if launch aborted.

Bug: 241861895
Test: manual
Test: pass existing tests
Change-Id: I07d1888957496dab8d5886eb7d9b21cc133b4214
2022-08-10 17:43:11 +08:00
Winson Chung
179aa5a2c4 6/ Removing unused code from previous cleanup
- No module overrides DisplayImeController now
- ShellController injects ShellInit & ShellCommandHandler now

Bug: 238217847
Test: atest WMShellUnitTests
Change-Id: I09ca0aa50e83fa9c4bfe203a0e17cb750d4a5a82
2022-08-10 05:41:12 +00:00
Winson Chung
9b1f03dc73 Relax strictness of mocks in DisplayLayoutTests
- The mocking of the resources includes resource values that
  aren't currently tested, but should be mocked to be consistent
  with the other values.  We should treat these as warnings and
  not a test blocker (might be a difference in the version of
  mockito used in studio dev)

Bug: 239892577
Test: Run WMShellUnitTests from sysui studio
Change-Id: I03594b6fb0889f29124882a1f61d7b94b4f90b55
2022-08-10 05:31:40 +00:00
Hongwei Wang
1a51c35170 Merge "Ensure PiP window visible after fold/unfold device" into tm-qpr-dev 2022-08-10 02:16:30 +00:00
Winson Chung
be8ad35238 Merge changes from topic "shell_command_handler" into tm-qpr-dev
* changes:
  5/ Fix inverted dependency for ShellCommandHandler
  4/ Separate construction and initializing in a few more controllers
2022-08-09 23:23:59 +00:00
Hongwei Wang
4f3138bea7 Ensure PiP window visible after fold/unfold device
We used to do only PipTaskOrganizer#scheduleResizePip without commiting
PipTaskOrganizer#scheduleFinishResizePip upon display change.

Bug: 241961056
Test: Enter PiP in unfolded state then fold the device
Test: atest WMShellUnitTests:PipControllerTest
Change-Id: I1c72c5e6016cd19017b43a8df583e730f15619a1
2022-08-09 16:00:57 -07:00
Shan Huang
8698cfbae4 Fix back to home animation restarts on a second swipe.
If a second swipe starts before a back to home animation finishes, it's
possible for subsequent MOVE events to start another back animation.
The fix is to only start back animation when the swipe's DOWN event is not
rejected.

Bug: 240109403
Fixes: 240109403
Test: Follow repro steps in 240109403#10 and make sure a second
animation cannot be started.
Test: BackAnimationControllerTest

Change-Id: Id2a5fb00f632fb9be175ef10cad7fea511d09ae0
2022-08-09 22:30:49 +00:00
Mateusz Cicheński
6bd105d566 Merge "Update the min/max allowed pip size on aspect ratio change." into tm-qpr-dev 2022-08-09 17:53:55 +00:00
Chilun Huang
3d3bf180c4 Merge "Prevent new instance if drop on split-screen with the same app" into tm-qpr-dev 2022-08-09 12:06:03 +00:00
Jeff Chang
e4b7302acc Merge "Exit split-screen if one of the splits is empty" into tm-qpr-dev 2022-08-09 04:50:29 +00:00
TreeHugger Robot
7e8d76adf0 Merge "Show task background surface" into tm-qpr-dev 2022-08-09 03:16:13 +00:00
Mateusz Cicheński
2c0fb89e1d Update the min/max allowed pip size on aspect ratio change.
Test: manually, open YT app, play video go to pip and expand with double tap, close pip
then go to Maps app, start nagivating, enter pip and epand with double tap - no stretching
Bug: 241400465

Change-Id: Ie061be5ed15611b3b6917d084a13f5ee1eba7e3c
2022-08-08 20:09:25 +00:00
Mady Mellor
7e347d7e82 Merge changes from topic "mm-bubble-updates" into tm-qpr-dev
* changes:
  If the update is non-interruptive don't re-bubble it
  Don't bubble things when we shouldn't
  Ignore updates to bubbles that aren't from the system
2022-08-08 17:36:27 +00:00
Jerry Chang
e7b58c4754 Merge "Fix no action menu for split pairs in overview panel" into tm-qpr-dev 2022-08-08 14:38:13 +00:00
Jerry Chang
3d8e5f7e5a Merge "Prevent updating invlid child task surfaces in the sync queue" into tm-qpr-dev 2022-08-08 12:59:42 +00:00
Jeff Chang
9236649034 Exit split-screen if one of the splits is empty
Unusual use cases result in the split being empty.The case happens if
the intent is the same app but not support multi-instance, we should
exit split and expand that app as full screen.

Moreover, apply the same evicts logic from startShortCut to startTask
on this CL.

Bug: 235193477
Test: Launch Google calendar and drag the app to split screen
Change-Id: I1081aaa8303a551f140668c953cd2fd7c4dd3c54
2022-08-08 18:08:39 +08:00
Jerry Chang
31fa86cdb3 Fix no action menu for split pairs in overview panel
The splitting tasks will be reparented to RecentAnimationSplitTasks
overlay layer in order to animate them together. However, the other
animating apps should also be placed to the same overlay layer so all of
them can be layered properly during the transition.

Fix: 239630217
Test: action menu shows above split pairs in overview panel
Change-Id: Idf4038fe575e37cdf9db16ba672208df45160ec1
2022-08-08 09:38:57 +00:00