Commit Graph

4888 Commits

Author SHA1 Message Date
Issei Suzuki
d5fec58feb Merge "Pass keyguard occluded status in onAnimationCancelled." into tm-qpr-dev 2022-06-28 17:24:33 +00:00
Hongwei Wang
955ef1849f Merge "Polish enter PiP animation on back pressed" into tm-qpr-dev 2022-06-28 16:40:20 +00:00
Evan Rosky
513bde42a0 Fix issues with early-finish
There were a couple of situations where both cancel and finish
collided. In those cases make sure only one is called.

Somewhat related, launcher actually continues to use leashes
even after calling the finishCallback. Since we make leashes
for launcher anyways, just use launcher's existing leash
clean-up logic.

Bug: 235616350
Test: run/monitor wm presubmits.
      Try launching and closing apps in rapid succession.
Change-Id: I7553ba9f9bbad052632a4d8d5a7225ab6c3dbce5
2022-06-27 16:23:01 -07:00
Hongwei Wang
ab392150d4 Polish enter PiP animation on back pressed
The PipTransitionAnimation#ofBounds is used when entering PiP on back pressed.
- Adjust the scale based on current animation progress
- Alter the auto-enter-pip animation running in Launcher to use the same
  mechanism
- Update the ofBounds animation to ignore small source rect hint,
  similar to what's in auto-enter-pip animation running in Launcher

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/dv35ov6nK2Mrr98DGkLNaE
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/gm8Kl7N3NPIoWoDKyDfd5s
Bug: 235268241
Test: Verify enter PiP animation on back pressed with YouTube in \
      both folded and unfolded state. See also videos.
Change-Id: I6043cff31eed7b63087ea03b17ced7549c89e4fb
2022-06-27 15:47:56 -07:00
Evan Rosky
633202b4e1 Merge "Post view-drawing so that it happens after applying start transaction" into tm-qpr-dev 2022-06-27 14:58:14 +00:00
Galia Peycheva
34188c83d2 Merge "Remove SplashScreen animations on TV" into tm-dev am: 07943a5b9b am: d7f43c22b9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18601924

Change-Id: I1436e2e268efb7f0f17b5d9fd50ee57f6e63c606
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-27 12:50:26 +00:00
Galia Peycheva
d7f43c22b9 Merge "Remove SplashScreen animations on TV" into tm-dev am: 07943a5b9b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18601924

Change-Id: I5aeffda29e08f4dfa88ea7a27b5cb0a7b2755efa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-27 12:34:20 +00:00
Galia Peycheva
07943a5b9b Merge "Remove SplashScreen animations on TV" into tm-dev 2022-06-27 12:19:51 +00:00
Charles Chen
e53c8761b2 Merge "Fix exception in expandSplitContainerIfNeeded" into tm-dev am: 5a0f8768a7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18886475

Change-Id: I84e2988efbb4451023161badfe2203f2aff9ee71
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-27 03:48:05 +00:00
Charles Chen
5a0f8768a7 Merge "Fix exception in expandSplitContainerIfNeeded" into tm-dev 2022-06-27 03:28:09 +00:00
Charles Chen
09478bf50c Merge "Expand SplitContainer if min dimensions not satisfied" into tm-qpr-dev 2022-06-25 06:26:53 +00:00
Issei Suzuki
a60723b1c8 Pass keyguard occluded status in onAnimationCancelled.
Test: No visible changes yet. Pass existing tests.
Bug: 235463625
Change-Id: Iabee71bc76e19f20702f8a2739f565aa915f9b52
Merged-In: Iabee71bc76e19f20702f8a2739f565aa915f9b52
2022-06-25 01:36:07 +00:00
Evan Rosky
c80650936a Post view-drawing so that it happens after applying start transaction
These views were drawing before the transition startTransaction is
applied. This can cause deadlocks if there aren't enough buffers
and the view blocks the thread since applying the transaction is
what frees-up the buffers.

Bug: 233625646
Test: run tests and check for fewer ANRs
Change-Id: I7d592fe186695cdcde040d4ec315e656e05354e5
2022-06-24 10:40:57 -07:00
Charles Chen
bd2723cf6e Expand SplitContainer if min dimensions not satisfied
Before this CL, SplitController creates new SplitContainer if
min dimensions of new lauched Activity/Intent is not satisfied.
This CL changes to expand the existing SplitContainer

Bug: 232871351
Test: atest SplitPresenterTest
Change-Id: Id8d122f7d95d1c6a3574b02ddd2b6afbc548f853
2022-06-24 23:50:12 +08:00
Massimo Carli
8a1e0cf16e Merge "Updates SCM restart button tooltip" into tm-qpr-dev 2022-06-24 11:32:00 +00:00
Tiger Huang
cf1e9e2682 Merge "Revert "Introduce updateVisibility and updateLayout"" into tm-qpr-dev 2022-06-24 03:23:21 +00:00
Massimo Carli
b049859794 Updates SCM restart button tooltip
Test: Manual test
Fix: 235469084

Change-Id: I05079bfe1f7015020d21fca1d6978743a954169a
2022-06-23 17:30:30 +00:00
Evan Rosky
dfbcd379bb Merge "End transitions when receiving merge request" into tm-qpr-dev 2022-06-23 16:59:27 +00:00
Charles Chen
8bf77af1a7 Fix exception in expandSplitContainerIfNeeded
The exception is because the client side hasn't received
TaskFragmentInfo yet, so we don't have WindowContainerToken
to change the bounds of TaskFragments.
This CL verifies if we have TaskFragmentInfo before
calling expandTaskFragment. If there's no TaskFragmentInfo,
fallback to create new SplitContainer that fills the task
bounds.

Test: atest WMJetpackUnitTests
Test: manual: reproduce steps mentioned in bug
Bug: 232871351

Merged-In: Id8d122f7d95d1c6a3574b02ddd2b6afbc548f853
Change-Id: I83ee6ea32df485bf78db3b50dec8c92d80be8912
2022-06-23 15:23:43 +08: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
Tiger Huang
20eb3c91db Revert "Introduce updateVisibility and updateLayout"
This reverts commit:
db407ef12d, and
d8aa7f7882.

Reason for revert:
The surface size would be reduced by mTranslator unexpectedly.

Fix: 233017734
Test: Open a legacy app which has CompatibilityInfo.SCALING_REQUIRED
      and see if the app is cropped.
Change-Id: If830866328a5709cf6856fe840a804b304052003
2022-06-22 21:41:18 +08: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