Commit Graph

4469 Commits

Author SHA1 Message Date
Evan Rosky
dfbcd379bb Merge "End transitions when receiving merge request" into tm-qpr-dev 2022-06-23 16:59:27 +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
Evan Rosky
f0ff75fd24 End transitions when receiving merge request
The default behavior (if nothing is done) for a merge request
is to let the animation continue and queue up the incoming animation
to start once the current one has finished.

This is maybe the "smoothest" default; however, it is not
responsive for the user. So, instead, go through and, where
appropriate, make animations "jump-to-end" when they receive
a merge request. This way the user will see the new animation
start immediately after they perform an action. There is
technically a "jump" in the animation, but it seems like the
responsiveness is preferable and the jumps aren't super
noticable anyways. This is also how legacy transitions works
so it's not a behavior change.

Bug: 236309064
Test: interrupt animations with other transitions and observe.
      Example: launch an app and then go "back" before it finishes
      animating.
Change-Id: I4a76e7efe2c610b22f3fe97b0bd3ab692a01be08
2022-06-21 15:19:52 -07:00
Shan Huang
1ab6263c4d Merge "Pass the values of the MotionEvent instead of the event instance itself to BackAnimation." into tm-qpr-dev 2022-06-21 15:54:21 +00: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
Tony Huang
a7ce4cadfb Merge "Implement double tap switch animation" into tm-qpr-dev 2022-06-20 09:15:51 +00:00
Bill Yi
e341973241 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I73ec996407ce92fe58774b86520ebe5f5cac1440
2022-06-19 00:18:55 -07: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
Tony Huang
c77c19c4c6 Implement double tap switch animation
Bug: 231496272
Test: manual
Test: pass existing tests
Change-Id: Ib228378b623e7895b1a9d643ea32facfcbe3e56b
2022-06-16 15:43:42 +08:00
Jeff Chang
7a499f6ca7 Merge "Update context object if split bounds changed" into tm-d1-dev am: bceb4a9e7d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18881887

Change-Id: I5a49f69e880c025b324e8afc37f0fe40294ee823
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-16 05:51:39 +00:00
Hongwei Wang
d6579ac1b7 Merge "Avoid conflict surface reset on auto-enter-pip" into tm-qpr-dev 2022-06-15 16:55:41 +00:00
Sergey Serokurov
86d2469d1e Merge "Do not update pointer postion when stack is going to collapse" into tm-qpr-dev 2022-06-15 16:51:46 +00:00
Jeff Chang
7a9206a080 Update context object if split bounds changed
The RRS(runtime resolution switching) feature which supports users to
change resolution directly. Split-screen did not update the Context
object during the runtime resolution switching. That results in the
split layout can not get the proper resource in time.

This CL updates the new Context object whose resources are adjusted to
match the new given Configuration when the split bound is different
from existing. That’make sure to get the updated resources objects
when calculating the divider snap target for this case.

Bug: 235044746
Test: atest MultiWindowTests
Change-Id: I94d1a95c6b4aeb3bf1b75aed2e0b3008f036c968
2022-06-15 13:56:24 +08: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
Mady Mellor
0334b06238 Merge "Fix an issue where tasks moving to front would collapse the stack." into tm-dev am: 13a28fff81 am: 668dddcd4f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18876919

Change-Id: I4e1075eb5a8e68621d43042382e8d82e97b9c954
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 16:52:52 +00:00
Winson Chung
7f371fabc8 Merge "Clear snapshot buffer preemptively if unused" into tm-dev am: 87b7e43b14 am: 1945aedc41
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18800614

Change-Id: Ic0e23837c7e560a3623ff108266bb7cb05f2b538
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 16:52:30 +00:00
Mady Mellor
668dddcd4f Merge "Fix an issue where tasks moving to front would collapse the stack." into tm-dev am: 13a28fff81
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18876919

Change-Id: I16c17f6e7faaab38dfc47d5157a5095a252879ae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 16:15:16 +00:00
Mady Mellor
13a28fff81 Merge "Fix an issue where tasks moving to front would collapse the stack." into tm-dev 2022-06-14 16:07:39 +00:00
Winson Chung
1945aedc41 Merge "Clear snapshot buffer preemptively if unused" into tm-dev am: 87b7e43b14
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18800614

Change-Id: I666cc9688530619fa8b5f71d2e4aa9e2e7c51aca
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 16:06:45 +00:00
Winson Chung
87b7e43b14 Merge "Clear snapshot buffer preemptively if unused" into tm-dev 2022-06-14 13:56:10 +00:00
Winson Chung
91800b7efb Clear snapshot buffer preemptively if unused
Bug: 235273016
Change-Id: Ib5105ee45905f0452ade47f90d0c090b0a4f9a84
2022-06-14 03:40:27 +00:00
Tony Huang
a41398efa7 Merge "Fix drag notification to split" into tm-qpr-dev 2022-06-14 02:49:09 +00:00
Jerry Chang
f416c3f945 Merge "Reduce jittering while dragging divider bar" into tm-dev am: 19885f1c74 am: 95c7363730
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18867591

Change-Id: Ice1e4602592fbebd0ab50ba8ee925d60c13b155a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 02:24:50 +00:00
Jerry Chang
95c7363730 Merge "Reduce jittering while dragging divider bar" into tm-dev am: 19885f1c74
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18867591

Change-Id: I2f32f16f3cceff5e86d19cadc779e5207f8363cb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 02:02:04 +00:00
Jerry Chang
19885f1c74 Merge "Reduce jittering while dragging divider bar" into tm-dev 2022-06-14 01:53:35 +00:00
Mady Mellor
b967adf753 Fix an issue where tasks moving to front would collapse the stack.
ag/18759417 introduced a new call to onTaskMovedToFront which impacted
some bubbles behavior, basically while switching bubbles the
"background" app now appears to move to the front for a moment which
causes bubbles to be collapsed. The fix is to flip the flag for
bubbles switching a bit sooner than we already do.

Test: manual - have some bubbles, visit each of them once (i.e. have
               the activity launched), then visit them all again
             => verify all the bubbles can be visited both times and
               the stack doesn't collapse.
Bug: 235781358
Change-Id: Id0674cafd92d5aeb802a0da77a679996e7041b74
2022-06-13 16:16:46 -07:00
Sergey Serokurov
bccc4c2cac Do not update pointer postion when stack is going to collapse
Bug: 232293580
Test: atest SystemUITests
Test: video at https://drive.google.com/file/d/1Yjs7AzTeI_Zp764CPF9d6e7zI-XRvYX4/view?usp=sharing
Change-Id: I3131a8f32e088573e8e4e8401b6cc279e73bef87
2022-06-13 09:45:40 -07:00
Jerry Chang
81d0e61a04 Reduce jittering while dragging divider bar
Set vsync id to transactions moving divider bar surface, so those
transactions won't be committed together and result to empty frame while
dragging the divider bar.

Bug: 230050092
Test: manual dump and verified with perfetto trace
Change-Id: Id570e80a908a07113b8e4bd77f38c05e3eee1d0c
2022-06-13 11:21:25 +00:00
Bill Yi
098855cd68 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I1c159a9ba275baff6e70fcdeb93914915bcbc989
2022-06-11 03:47:26 -07:00
Garfield Tan
8aaccc88e5 Merge "Fix a bug in maximize buttons in legacy captions" into tm-qpr-dev 2022-06-10 21:53:56 +00: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
Garfield Tan
6be9f83cb0 Fix a bug in maximize buttons in legacy captions
The bug was introduced in 939b27cb50 which
effectively removed the bounds resolution for fullscreen tasks.
Therefore we need to remove the bounds manually.

Also hide caption on shell behind the flag. Note we still let WM shell
handle freeform resizing so that we don't have to reintroduce an
exception for freeform windows to WM core.

Bug: 165794636
Test: Maximize buttons in legacy captions work.
Test: Caption in WM shell isn't shown when the feature is disabled and
shown when it's enabled.

Change-Id: I51d15556dabdc6713f31d7515c574dfb0db49b7a
2022-06-09 13:27:17 -07: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
Ats Jenk
9719278535 Merge "Update scrim when dragging bubble expanded view" into tm-qpr-dev 2022-06-08 23:29:44 +00:00
Shan Huang
39b033229e Merge "Fix NPE from BackAnimationController#setBackToLauncherCallback." into tm-dev am: a671783048 am: 12e973c5ab
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18785512

Change-Id: I171055c37e2ffe7ab08470a567dfb33c53722f37
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-08 16:35:01 +00:00
Shan Huang
12e973c5ab Merge "Fix NPE from BackAnimationController#setBackToLauncherCallback." into tm-dev am: a671783048
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18785512

Change-Id: I400ff9c0baa2fb8bd438faa03accca69e135d9f4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-08 16:14:17 +00:00
Shan Huang
a671783048 Merge "Fix NPE from BackAnimationController#setBackToLauncherCallback." into tm-dev 2022-06-08 16:00:26 +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
Tony Huang
6484eb9ab5 Fix drag notification to split
On drag notification to split case, the pending intent calling Uid
should be app's Uid and lead to this start failed due to not system
and app didn't visible.
Put allow background activity flag on split side to ensure it could
start successful and active split screen.

Fix: 234406935
Test: manual
Test: pass existing tests
Change-Id: Ib52023f6d79d166b2b01948f2481350280a094f3
2022-06-08 15:20:19 +08:00
Shan Huang
9c0996d3c1 Fix NPE from BackAnimationController#setBackToLauncherCallback.
Bug: 235198537
Test: atest BackAnimationControllerTest
Change-Id: Ibb0e85ab3cb62cc4d1ab1a2da5e6f4b2a5d9e90f
2022-06-07 19:07:47 -07: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
Ats Jenk
78a4f07ca2 Update scrim when dragging bubble expanded view
Adjust background scrim alpha when dragging expanded view up.

Test: dragged view up, observed scrim becomes lighter
Test: dragged view up and down, observed scrim back to normal
Bug: 170163464
Change-Id: I45db3fc35135ddb694c3f912747bc7761f3fedd3
2022-06-07 14:53:24 -07:00
Garfield Tan
f5751858b3 Support moving and resizing freeform windows
Instead of an InputMonitor for the entire display, we use window
decoration surface to monitor window resizing gestures. This allows us
to consolidate hit test to InputFlinger.

There is an issue that gesture monitor for gesture nav steals touches
from the resize window while resizing if user moves pointers too fast.

Bug: 165794880
Test: Drag resize works.
Change-Id: I2685e074dd02af55928d20a93f7c0690cc498fc5
2022-06-06 18:51:52 -07:00
Garfield Tan
2d3382a8b4 Render window decoration in WM shell
There are still several things missing in this CL:

1. Still need to wire up freeform resizing. This is done in a separate
   CL.
2. Check if a11y works as intended.
3. Wire up fullscreen and window decorations for freeform displays.
4. Immersive mode work.

Bug: 165794880
Bug: 165794636
Test: Caption shows up.
Change-Id: I7c0e1d55d6c9d03332a58d31ade88aef06a84048
2022-06-06 18:51:52 -07: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