Commit Graph

4752 Commits

Author SHA1 Message Date
Hongwei Wang
e9326b73d0 Merge "Fix the animation position when launch into PiP" into tm-dev am: 83979ad7b7 am: bc6f5f1842
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18637060

Change-Id: I5f049dbd96a07a04da3affadf03cb0c7888c7cd5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-28 07:03:15 +00:00
Hongwei Wang
bc6f5f1842 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: I4773a2751725d4e554c84e9fd9ca26ff6e561e25
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-28 06:40:58 +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
TreeHugger Robot
70c1287127 Merge "Modify app expected position base on the drag behavior change" into tm-qpr-dev 2022-05-27 21:39:24 +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
Mateusz Cicheński
2542f63ded Merge "Add keep clear area avoidance algorithm for PiP" into tm-qpr-dev 2022-05-27 19:53:42 +00:00
Chilun Huang
31b85ddad7 Modify app expected position base on the drag behavior change
Because ag/18529596 change the drop position, the test need to modify
the expected position of the app.

Bug: 232878493
Test: atest EnterSplitScreenByDragFromAllApps
Change-Id: Ib4823a899aa42ab2c0b23f9e654cbf13becb02bd
2022-05-28 02:24:33 +08:00
Hongwei Wang
844ecd5d40 Merge "Ensure content-overlay is removed on app re-launch" into tm-dev am: 999a0666ac am: 0bbe1b88cf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18618656

Change-Id: I41c2d2aeb4fdb56730a756e4d573532974ff8107
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-27 17:09:43 +00:00
Hongwei Wang
0bbe1b88cf 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: If2792dc20f7c457998b9892918ad34fb1ddd48bb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-27 16:47:40 +00:00
TreeHugger Robot
e4f90a01f3 Merge "Import translations. DO NOT MERGE ANYWHERE" into tm-dev 2022-05-27 16:45:14 +00:00
Hongwei Wang
999a0666ac Merge "Ensure content-overlay is removed on app re-launch" into tm-dev 2022-05-27 16:28:08 +00:00
Chris Li
7c2912df8f Merge "Fix ConcurrentModificationException on finishing TaskFragment" into tm-dev am: 0d7ece81e8 am: 91b3e6b447
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18615113

Change-Id: I2e47be05d9862a8fb076e3430496707d1b249de6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-27 12:25:45 +00:00
Chris Li
91b3e6b447 Merge "Fix ConcurrentModificationException on finishing TaskFragment" into tm-dev am: 0d7ece81e8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18615113

Change-Id: Id15081e917190d0a93ae8870c4a9d623c95e5023
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-27 12:10:37 +00:00
Chris Li
4813b27d00 Fix ConcurrentModificationException on finishing TaskFragment
Fix: 228201646
Test: atest WMJetpackUnitTests:SplitControllerTest
Change-Id: I4569e48fa7e5c020f440f00f0027e560d33e647f
2022-05-27 11:17:50 +08: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
TreeHugger Robot
47a12740a2 Merge "Add pendingAppearedIntent to TaskFragmentContainer" into tm-dev am: 3f75b0485a am: 8fcee62b42
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18581805

Change-Id: Ibc0c69964a802f96e6982e5a5982d6a3a5032939
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-26 19:47:11 +00:00
TreeHugger Robot
8fcee62b42 Merge "Add pendingAppearedIntent to TaskFragmentContainer" into tm-dev am: 3f75b0485a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18581805

Change-Id: Iaeacacf3b5af79c651da9883e80944ed45d1bd2d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-26 19:27:10 +00:00
TreeHugger Robot
3f75b0485a Merge "Add pendingAppearedIntent to TaskFragmentContainer" into tm-dev 2022-05-26 19:06:54 +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
0958d65c45 Merge "Remove lingering content overlays in onTaskVanished" into tm-dev am: 442dbd14ff am: 156254df35
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18604863

Change-Id: Ia12ad140e07f3030f7c492441684de3ee2282924
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-26 15:44:48 +00:00
TreeHugger Robot
156254df35 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: I387ca7a633b72473aa7548eb20115404f9f9d2ac
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-26 15:09:02 +00:00
TreeHugger Robot
442dbd14ff Merge "Remove lingering content overlays in onTaskVanished" into tm-dev 2022-05-26 13:19:31 +00:00
Hongwei Wang
f2790fe724 Merge "Use snapshot in enter content-pip animation" into tm-dev am: a143492a2b am: b3643f53a1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18501932

Change-Id: Ifcff7a1de0dd9ecebf8476db1b95f35501a9ac1d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-26 07:57:00 +00:00
Jorge Gil
7f7d0c3354 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: Ib48fb2e5fb385b89fb672ab6b0566d401d843dfe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-26 07:37:33 +00:00
Hongwei Wang
b3643f53a1 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: Iaf6616d4873db8803bdf15246ef85e0553a0e5f0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-26 07:34:42 +00:00
Jorge Gil
15adfe3917 Merge "Allow overridding the exitPip destination bounds" into tm-dev 2022-05-26 06:47:25 +00:00
Chris Li
f7f106b437 Add pendingAppearedIntent to TaskFragmentContainer
1. When an activity is launched without specifying launch TaskFragment,
   it may be placed to the primary TaskFragment of a split if all
   activities in secondary split are finishing. In this case, we still
   want to check if activity should be splitted with the activity below.

   In order to do that, we need to know if it should be split with the
   secondary TaskFragment, which may still be empty, so store the
   pending appeared Intent until the TaskFragment becomes non-empty.

   i.  The secondary TaskFragment can be empty when the primary trys to
       start the secondary during #onCreated.
   ii. If the Intent never actually started, it will trigger
       #onTaskFragmentAppearEmptyTimeout to update the existing top
       container.

2. When we are finishing a TaskFragment, we used to finish all
   activities in it as well. We should not do that for activity that is
   requested to be reparented (as pending appeared).

Fix: 233684054
Test: atest WMJetpackUnitTests:TaskFragmentContainerTest
Test: atest WMJetpackUnitTests:SplitControllerTest
Change-Id: I47329b23709da7e069a6a0c84124a3d7d08aae12
2022-05-26 06:31:44 +00:00
Hongwei Wang
a143492a2b Merge "Use snapshot in enter content-pip animation" into tm-dev 2022-05-26 06:26:34 +00:00
TreeHugger Robot
e4d77e2522 Merge "Add assertions for layers become visible" into tm-qpr-dev 2022-05-26 05:56:07 +00:00
Mateusz Cicheński
407ea1ad4f Add keep clear area avoidance algorithm for PiP
The algorithm computes a new position for PiP based on the registered
keep clear areas within the system. If no occlusion happens the original
position is being returned. Otherwise, the bounds are moved in one of the
available directions so that none of the keep clear areas are occluded
while keeping PiP within the display bounds.

Test: atest PipKeepClearAlgorithmTest
Bug: 183746978
Change-Id: Ic2d11861329a46e2da0448f90283f67f6e7125d7
2022-05-25 23:01:54 +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
Andrii Kulian
0eea298a34 Merge "Synchronize SplitController" into tm-dev am: d4d0fee814 am: a15c08cb85
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18418602

Change-Id: I251c1d1e2ee68cf2fff3e56a0c5db5b24b9b61d8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 18:42:26 +00:00
Andrii Kulian
a15c08cb85 Merge "Synchronize SplitController" into tm-dev am: d4d0fee814
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18418602

Change-Id: I8580f43a7225000ad124c790a2a3351cef42f6c5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 18:15:50 +00:00
Andrii Kulian
d4d0fee814 Merge "Synchronize SplitController" into tm-dev 2022-05-25 17:48:24 +00:00
Mateusz Cicheński
83f04c01a3 Merge "Check for null mLeash before setting alpha." into tm-dev am: 1f9afd727a am: b2cd9af9c5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18585595

Change-Id: I424d59ee7348654fef4884cb8b481cd84095ca1c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 17:29:44 +00:00
Mateusz Cicheński
b2cd9af9c5 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: I5dcb324bbdd9028b7fe4cf56c0d43383b4fb567a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 17:02:57 +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
d155710371 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: I50e7b59f716fb979f96bce9ab63b5f99ceee5363
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 07:10:48 +00:00
Chilun Huang
6384389786 Add assertions for layers become visible
Add more assertions for layers become visible.

Bug: 232878493
Test: atest EnterSplitScreenByDragFromAllApps

Change-Id: Ida948525b618b800915813cf2927523600e23724
2022-05-25 15:07:28 +08:00
Tony Huang
a876e7b2d0 Merge "Fix NPE if draging again while animating" into tm-dev 2022-05-25 06:53:54 +00:00
Andrii Kulian
40a67faae4 Synchronize SplitController
Adding synchronization to the public methods in SplitController,
as they might be called on different threads and cause a
ConcurrentModificationException.

Bug: 228201646
Test: atest CtsWindowManagerJetpackTestCases --iterations 100
Change-Id: I2db9ccb5e9829487eae7aa85eff5f6153721cc04
2022-05-25 03:32:54 +00:00
Tony Huang
4f8c3f0841 Merge "Remove the special logic of the divider bar z-ordering" into tm-qpr-dev 2022-05-25 02:01:26 +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
Jorge Gil
67fb0d155a Merge "Allow overridding the exitPip destination bounds" into tm-qpr-dev 2022-05-24 22:16:39 +00:00
Mateusz Cicheński
52fe8ddf2e Check for null mLeash before setting alpha.
There were few reports in the bug for this to not always be set.
Based on the stack trace it is related to Keyguard showing/hiding,
but I was unable to repro locally the issue.

Adding a safety check to prevent this from occuring with proto log if it happens.

Bug: 233129957
Test: n/a, unable to repro, fix based on the stack trace
Change-Id: Ie45e557601fe52da6003790446b18aad2db681e5
2022-05-24 19:33:40 +00:00
Mady Mellor
ca16c386a0 Merge changes I282ed7eb,I4e9ca9ed into tm-dev am: 772f09fe07 am: 2c8a9755ef
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18563479

Change-Id: I5d29552e2976c15d05e5b1a384990e7cb0644485
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 16:11:15 +00:00
Mady Mellor
2c8a9755ef Merge changes I282ed7eb,I4e9ca9ed into tm-dev am: 772f09fe07
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18563479

Change-Id: I8e79133e9fb82e08b999c074189266ac419325bb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 15:38:37 +00:00