Commit Graph

4275 Commits

Author SHA1 Message Date
Shan Huang
0f9637182a 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: I7583ee958c552707e23458d12621f61369cdff15
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-21 18:33:24 +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
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
Mady Mellor
f5e0e12d5d 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: I6c48b706e7284db54e67de1d4b78fdf173f27afe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 16:13:25 +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
4fd95f1b81 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: Id48d4d7fd226196f619f723d7dff2f8e160df2b8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 16:05:18 +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
Jerry Chang
161239688e 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: Id4286d9ba135bd2626379a7587600d51d2e1964d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 02:00:11 +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
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
Shan Huang
9f8e238be1 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: Iabf00aed54954b58495b37a3f0fc0ceea57a96ef
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-08 16:12:19 +00:00
Shan Huang
a671783048 Merge "Fix NPE from BackAnimationController#setBackToLauncherCallback." into tm-dev 2022-06-08 16:00:26 +00: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
Hongwei Wang
94e78c557f Merge "Remove conflict window crop" into tm-dev am: 3fa5b5332b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18717099

Change-Id: I9ed56f7234d7b93fd7cabec220ecc917f737aa7b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-03 03:14:16 +00:00
Hongwei Wang
6683426dbf Remove conflict window crop
We actually do not need to crop the snapshot re-parented to the leash
since it's bound to the Task's bounds.

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/eh7phISItWvnhSoZz8GKh8
Bug: 234642410
Test: Enter content-pip from content away from the top, see video
Change-Id: I43c1ed6088d1be15b87326fb4f0cf459956a7c00
2022-06-02 19:19:07 +00:00
TreeHugger Robot
0d76e95c65 Merge "Import translations. DO NOT MERGE ANYWHERE" into tm-dev 2022-06-02 06:41:59 +00:00
Chavi Weingarten
7f78ee5841 Merge "Release SC when RootTaskDA is no longer organized" into tm-dev am: d72491683d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18681872

Change-Id: I22af4dd9819b74452c327ef1aff73e3318fa662c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-01 15:16:28 +00:00
Chavi Weingarten
d72491683d Merge "Release SC when RootTaskDA is no longer organized" into tm-dev 2022-06-01 14:48:21 +00:00
chaviw
08a48506b0 Release SC when RootTaskDA is no longer organized
WM Shell receives a leash for the DA that it wants to organize. However,
it's not releasing the SC when it receives a vanished callback. This
causes the SC to leak every time a new RootTaskDA is organized and then
vanishes.

Test: Add and remove simulated displays. Ensure no leaks
Bug: 231752353
Change-Id: I181695f4bae65ccc0cd25e1b5480e33307e7834d
2022-05-31 16:48:31 -05:00
Bill Yi
e09c246286 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I90cc45d81a2f903bfe2b6e933ed47bd94a1b3aa4
2022-05-31 14:10:12 -07:00
Hongwei Wang
7afb10d48d Merge "Validate content overlay before removal" into tm-dev am: eb700c0090
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18656364

Change-Id: I8d84242efab45782b491579ea4fd94a9003f067f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-31 19:49:50 +00:00
Hongwei Wang
eb700c0090 Merge "Validate content overlay before removal" into tm-dev 2022-05-31 19:24:48 +00:00
Mady Mellor
533d85f39d Merge "Fix the pointer position when displayed in RTL" into tm-dev am: 91d28d1b21
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18620988

Change-Id: I37f0488d5478c379ee1fbc9a05fd52fe384a0db4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-31 15:14:53 +00:00
Mady Mellor
91d28d1b21 Merge "Fix the pointer position when displayed in RTL" into tm-dev 2022-05-31 15:10:09 +00:00
Hongwei Wang
4c4b7ef959 Validate content overlay before removal
Bug: 234158920
Test: atest --iteration 20 --no-bazel-mode \
        PinnedStackTests#testLaunchTaskByAffinityMatchSingleTask
Change-Id: I1ed848fcd742443a23ecaa17ba6b4fb8cdb061e2
2022-05-31 10:40:53 +00:00
Hongwei Wang
21482ebd2c Merge "Fix the animation position when launch into PiP" into tm-dev am: 83979ad7b7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18637060

Change-Id: I8f5078e5e3607ba2c4a2abf605eb187c4e3de8f6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-28 06:39:33 +00:00
Hongwei Wang
83979ad7b7 Merge "Fix the animation position when launch into PiP" into tm-dev 2022-05-28 06:14:33 +00:00
Hongwei Wang
15d8ea3a9b Fix the animation position when launch into PiP
When attach the task snapshot to the leash of newly created Task, move
its position to the new Task's coordinates and apply the crop with scale
in mind (snapshot is scaled to its task size).

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/d72OCvyYh0G0Z6YrEwyXMp
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/eacts7tgSeN28R3BWpXAem
Bug: 232984253
Test: launch into PiP with source rect hint middle of screen, \
      see also the video
Change-Id: Ib79e75d7e6f6f667e50db197d5377b87cffc714d
2022-05-27 13:55:19 -07:00
Hongwei Wang
4951e22b48 Merge "Ensure content-overlay is removed on app re-launch" into tm-dev am: 999a0666ac
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18618656

Change-Id: Ifded05ab7e6b90705b60ee58c7089106a688fbc6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-27 16:47:00 +00:00
TreeHugger Robot
e4f90a01f3 Merge "Import translations. DO NOT MERGE ANYWHERE" into tm-dev 2022-05-27 16:45:14 +00:00
Bill Yi
fcea095afe Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Ic7aca29d4541865b6459ab3cbe2e4f9a0709b156
2022-05-26 20:04:30 -07:00
Mady Mellor
fed87296db Fix the pointer position when displayed in RTL
When displaying in RTL, the pointer translates from the opposite
side of the screen than the code assumes. This CL changes the math
for the pointer position when displaying in RTL.

Test: manual - test landscape / portrait on tablet / phone in LTR
               and RTL: have a couple of bubbles, expand the stack
               and select each bubble ensuring that the pointer is
               centered on the selection.
Bug: 230579507
Bug: 233950592
Change-Id: I71a6f64a43c1b7bb5e0a30773d4cc5ae55c63b6a
Merged-In: I71a6f64a43c1b7bb5e0a30773d4cc5ae55c63b6a
2022-05-27 00:43:58 +00:00
Hongwei Wang
aaf3915bfd Ensure content-overlay is removed on app re-launch
When app is re-launched, WM shell enters the exitPip process and within
which we should ensure any content-overlay attached to the on-going
animator is removed.

Bug: 232439933
Test: re-launch app immediately after app explictly calls enterPip
Change-Id: I17a204378c75d2442db588a1fa8cc2917f00b3f4
2022-05-26 10:53:38 -07:00
TreeHugger Robot
8debce0dcd Merge "Remove lingering content overlays in onTaskVanished" into tm-dev am: 442dbd14ff
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18604863

Change-Id: I86eed1bf9b8e9aac2937449dc4acf67e02c145ab
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-26 15:07:11 +00:00
TreeHugger Robot
442dbd14ff Merge "Remove lingering content overlays in onTaskVanished" into tm-dev 2022-05-26 13:19:31 +00:00
Jorge Gil
e9fb625068 Merge "Allow overridding the exitPip destination bounds" into tm-dev am: 15adfe3917
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18606671

Change-Id: If2e0f8cdea064978ab91ea384a6e5fe28e55dcd0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-26 07:35:01 +00:00
Hongwei Wang
2484a6a5e5 Merge "Use snapshot in enter content-pip animation" into tm-dev am: a143492a2b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18501932

Change-Id: I5ba1c038807bd8d61ebeec36e98084bc8937e8ea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-26 07:33:29 +00:00
Jorge Gil
15adfe3917 Merge "Allow overridding the exitPip destination bounds" into tm-dev 2022-05-26 06:47:25 +00:00
Hongwei Wang
a143492a2b Merge "Use snapshot in enter content-pip animation" into tm-dev 2022-05-26 06:26:34 +00:00
jorgegil@google.com
27e49907f9 Allow overridding the exitPip destination bounds
Allows vendors to choose to restore to bounds other than the display
bounds on exit PIP. This is specially useful in freeform enabled
desktops where the previous windowing mode was freeform and PIP should
return to its original freeform bounds.

Bug: 225294296
Test: atest PinnedStackTests
Merged-In: Id25906c4b11e5f3c8351ba96cff80c63a6a5cf4e
Change-Id: Id25906c4b11e5f3c8351ba96cff80c63a6a5cf4e
(cherry picked from commit 2a68fc0b1a)
2022-05-25 22:53:43 +00:00
jorgegil@google.com
8a35943e5f Remove lingering content overlays in onTaskVanished
onTaskVanished already attempted to do some last resort overlay
cleanup, but because onExitPipFinished was called right above it, and
it internally set the state=UNDEFINED, the overlay removal in
onTaskVanished was always a no-op.
This change changes the order of onExitPipFinished and the animator
cancelling/overlay removal so that there is always an attempt to do
the removal in on vanish.
There should be no risk with this change that the removal is done twice
since even if the overlay is removed by an animator in onAnimationEnd,
the removal in onTaskVanished first checks that an animator exists and
that a content overlay exists, and one or both of those should cause
it to no-op if someone else removed the content overlay earlier.

Bug: 230561935
Test: enter MS teams call, swipe edge to go back, verify there's no
fullscreen overlay lingering.
Test: atest --iteration 5 \
      ActivityThreadTest#testHandlePictureInPictureRequested_overriddenToEnter \
      ScreenshotTests#testScreenshotSecureLayers \
      TaskStackChangedListenerTest#testTaskChangeCallBacks

Change-Id: If8639ce78148c5ba1b247bb8afeee76e20863dc5
2022-05-25 15:15:00 -07:00
Hongwei Wang
fe5078f026 Use snapshot in enter content-pip animation
When entering content-pip
- We take a snapshot for the host task within the
  ActivityStarter#startActivityInner function, this is to make sure that
  the snapshot is taken before an app switches to the placeholder content
- We retrieve the snapshot in WM Shell when animating the newly created
  content-pip task, and use that snapshot during the animation
- This works similar to the solid color content overlay when app enters
  PiP without specifying a valid source rect hint. Therefore, we
  abstract the functionality to a dedicated PipContentOverlay class

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/dRSTf7prHc0krPhTKZ0kXx
Bug: 220191201
Test: enter content-pip from ApiDemos app, see also Video
Change-Id: I2420402341a910b44bd8f64e3ad518ebef41bc19
2022-05-25 14:35:25 -07:00
Bill Yi
112906ba38 Merge "Import translations. DO NOT MERGE ANYWHERE" into tm-dev 2022-05-25 18:43:37 +00:00
Mateusz Cicheński
05edfc28a1 Merge "Check for null mLeash before setting alpha." into tm-dev am: 1f9afd727a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18585595

Change-Id: Ie845699d41684ef08a0c3cc3677d2a2b5217419c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 17:01:20 +00:00
Mateusz Cicheński
1f9afd727a Merge "Check for null mLeash before setting alpha." into tm-dev 2022-05-25 16:35:38 +00:00
Tony Huang
225f54892a Merge "Fix NPE if draging again while animating" into tm-dev am: a876e7b2d0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18570244

Change-Id: Id96f7a42ee860487749c10ee36b5a157217fcdb4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 07:09:45 +00:00
Tony Huang
a876e7b2d0 Merge "Fix NPE if draging again while animating" into tm-dev 2022-05-25 06:53:54 +00:00
Bill Yi
24b4bb88a2 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I610113ca759dd1aad53e80caef580e110460b5df
2022-05-24 15:38:44 -07:00