Commit Graph

4868 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
Louis Chang
966a4e4e81 Merge "Do nothing when a finishing Activity configuration changed" into tm-dev am: 725d1534ad am: 3ff8feac5a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19008927

Change-Id: I88bad53e137f2fe321928ba8b833f0f8b2ecea22
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-23 01:07:10 +00:00
Louis Chang
3ff8feac5a Merge "Do nothing when a finishing Activity configuration changed" into tm-dev am: 725d1534ad
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19008927

Change-Id: I8d671b66969befd1ce37ad4e8b9984603213e805
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-23 00:49:18 +00:00
Louis Chang
725d1534ad Merge "Do nothing when a finishing Activity configuration changed" into tm-dev 2022-06-23 00:30:19 +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
Andrii Kulian
253f3e886e Merge "Check Task windowing mode when reporting display features" into tm-dev am: cfe0279f69
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18972307

Change-Id: I0d627b6276108f6801ce36aee60a1820844f879c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-22 05:39:42 +00:00
Andrii Kulian
cfe0279f69 Merge "Check Task windowing mode when reporting display features" into tm-dev 2022-06-22 05:19:15 +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
Andrii Kulian
44ca54f15e Merge "Check Task windowing mode when reporting display features" into tm-qpr-dev 2022-06-21 21:45:30 +00:00
Shan Huang
a79aed78d5 Merge "Pass the values of the MotionEvent instead of the event instance itself to BackAnimation." into tm-dev am: 1deb1af4a7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18963576

Change-Id: I24f8b034e3bfdc15493c8f2a2716985fddc4deab
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-21 18:34:51 +00:00
Shan Huang
1deb1af4a7 Merge "Pass the values of the MotionEvent instead of the event instance itself to BackAnimation." into tm-dev 2022-06-21 18:13:38 +00: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
Louis Chang
b6297b6a46 Do nothing when a finishing Activity configuration changed
Primary Activity and secondary Activity were both finished
while starting another Activity with FLAG_ACTIVITY_CLEAR_TASK
flag. The secondary container was then removed and the primary
container was resized to fullscreen while the organizer gets
the secondary TaskFragment info-changed event. And the primary
container was removed by primary TaskFragment info-changed event
afterward.

Since the primary Activity was resized before completely being
destroyed. The organizer got an onActivityConfigurationChanged c
allback and resulted in another placeholder activity being launched.

Bug: 236272623
Test: making Duo calls
Change-Id: I851828f739a4937725510d99cbdfae9ed212a023
2022-06-21 09:19:05 +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
Shan Huang
db78c194d8 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
Merged-In: I4792debc705536b49d1caafcc43e5466941c1d43
2022-06-17 21:18:55 +00:00
Andrii Kulian
fad7f25eeb Check Task windowing mode when reporting display features
If an application uses ActivityEmbedding it would not be able to
observe display features (like folds or hinges) because they are
filtered out for activities in multi-window mode. One of the reasons
is because the client won't always know the correct position of the
window on screen in multi-window, and the position of the hinge could
be translated incorrectly to the task coordinate space.

However, it would still be OK to report the display features
when activities are in multi-window due to ActivityEmbedding as
long as the task is not in multi-window.

Bug: 236295340
Test: Sample app with embedding and display features.
Merged-In: I00f62574124df6df61f121228bd91ff9bc751c2a
Change-Id: I00f62574124df6df61f121228bd91ff9bc751c2a
2022-06-17 17:15:18 +00:00
Andrii Kulian
2eae3a52a7 Check Task windowing mode when reporting display features
If an application uses ActivityEmbedding it would not be able to
observe display features (like folds or hinges) because they are
filtered out for activities in multi-window mode. One of the reasons
is because the client won't always know the correct position of the
window on screen in multi-window, and the position of the hinge could
be translated incorrectly to the task coordinate space.

However, it would still be OK to report the display features
when activities are in multi-window due to ActivityEmbedding as
long as the task is not in multi-window.

Bug: 236295340
Test: Sample app with embedding and display features.
Change-Id: I00f62574124df6df61f121228bd91ff9bc751c2a
2022-06-17 06:46:40 +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
Jeff Chang
bceb4a9e7d Merge "Update context object if split bounds changed" into tm-d1-dev 2022-06-16 05:25:24 +00:00
An An Yu
37b3f06461 Merge "Setup T style clear top transition animation for ActivityEmbedding." into tm-qpr-dev 2022-06-15 21:21:21 +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
Charles Chen
8671151aee Merge "Respect minimum dimensions for embedded Activities" into tm-dev am: eb86759eec
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18482931

Change-Id: Ie71cac684b4e1c6ea0190432c9ef8ad38646a2ec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-15 03:50:46 +00:00
Charles Chen
eb86759eec Merge "Respect minimum dimensions for embedded Activities" into tm-dev 2022-06-15 03:32:04 +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
An An Yu
588e1f94d2 Setup T style clear top transition animation for ActivityEmbedding.
This registers system default clear-top xmls and propagate the
showBackdrop flag.
Test: atest RemoteAnimationsControllerTest
Bug: 221048002

Change-Id: I664f7edd181fd7d625b7010a77cd1f7b58fc3113
2022-06-14 13:36:57 -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
Charles Chen
fa3f9ca94c Respect minimum dimensions for embedded Activities
Before this CL, minimum dimensions of Activity wasn't respected,
that said, an Activity could be embedded in a TaskFragment of which
bounds are smaller its minimum dimensions.
This CL add the minimum dimensions on several places:

WM core:
1. Verify minimum dimension requirement before adding an Activity to
   a TaskFragment. It'll be early return if the requirement is not
   satisfied.
2. Propagate the minimum dimensions to the client side through
   TaskFragmentInfo to notify the requirement.
3. If TaskFragmentOrganizer tries to shrink a TaskFragment to
   the bounds that smaller than minimum dimensions of its children
   Activity, switch to match the parent bounds.
AndroidX Window extensions:
1. Early return if TaskFragment is resized to the bounds that smaller
   than minimum dimensions which dispatched from the server side.
2. When organizer tries to show Activities side-by-side, verify if
   minimum dimensions requirement of the primary Activiy. If the
   requirement is not satisfied, show Activities in fullscreen
   instead.
TODO: Add an API to check if an Activity intent is allowed to embed
   in a TaskFragment.

Bug: 232871351
Test: atest TaskFragmentOrganizerControllerTest
Test: atest TaskFragmentOrganizerTest TaskFragmentOrganizerPolicyTest
Test: atest SplitActivityLifecycleTest
Test: atest CtsWindowManagerJetpackTestCases
Test: atest WmJetpackUnitTests

Merged-In: Ib46c2cec2a0735b9e3f3420f2cb94754801b86b9
Change-Id: Ib46c2cec2a0735b9e3f3420f2cb94754801b86b9
2022-06-15 00:32:34 +08: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