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
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
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
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
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
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
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
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
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)
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
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