Commit Graph

4373 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
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
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
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
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
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
Mady Mellor
772f09fe07 Merge changes I282ed7eb,I4e9ca9ed into tm-dev
* changes:
  Fix a padding issue for bubble user education in RTL
  Fix position of bubble education views on large screen in RTL
2022-05-24 15:14:43 +00:00
Tony Huang
2641f715ce Fix NPE if draging again while animating
The animator cancel calling might cause surfaces released by our
implementation. Moving the cancel call before we make sure surface
is not null.

Fix: 230686609
Fix: 233159027
Test: Open animation scale setting and try drop then drag again
      divider quickly
Test: pass exising tests
Change-Id: I2e94f3ece3f211ceb15f380e4ee9322b8c27f8ac
Merged-In: I2e94f3ece3f211ceb15f380e4ee9322b8c27f8ac
(cherry picked from commit 99866c56ad)
2022-05-24 08:08:53 +00:00
Shawn Lin
7c604236cc Merge "Replace DisplayManager.getStableDisplaySize with max Display.Mode" into tm-dev am: 15cb562bcd am: 02c07a76ba
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18485561

Change-Id: Ifab44e33ac17ab673954019236b74f1fe4bfa4e4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 04:11:22 +00:00
Shawn Lin
02c07a76ba Merge "Replace DisplayManager.getStableDisplaySize with max Display.Mode" into tm-dev am: 15cb562bcd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18485561

Change-Id: Ic3858acd6fa4b2f686a124685d977bb3bc1b06e0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 02:50:03 +00:00
Shawn Lin
15cb562bcd Merge "Replace DisplayManager.getStableDisplaySize with max Display.Mode" into tm-dev 2022-05-24 02:30:28 +00:00
Mady Mellor
95f1bd32a2 Merge "Fix an issue where the start position of the stack is wrong in RTL" into tm-dev am: 68559c1680 am: da8eb75f67
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18528569

Change-Id: Ifa7b1610322cfcf9422e1f72535ebc720f430047
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 01:22:23 +00:00
Mady Mellor
da8eb75f67 Merge "Fix an issue where the start position of the stack is wrong in RTL" into tm-dev am: 68559c1680
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18528569

Change-Id: I6aa8cba4e3bde6952f69e76bfc1ea641011d1886
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 00:58:47 +00:00
Mady Mellor
68559c1680 Merge "Fix an issue where the start position of the stack is wrong in RTL" into tm-dev 2022-05-24 00:29:34 +00:00
Mady Mellor
3b27222780 Fix a padding issue for bubble user education in RTL
The education view is placed on the right hand side of the screen
so the padding calculation to align the manage button in the education
view with the real manage button is slightly different.

Bug: 230579507
Test: manual - force education for bubbles to show, set RTL language,
               open up stack and look at manage button education
Change-Id: I282ed7eb2014d5d1a6d2b428572e495ce0d77c78
2022-05-23 20:01:27 +00:00
Mady Mellor
d3f19bcb77 Fix position of bubble education views on large screen in RTL
In large screen or landscape, the width of the education view is not
full width, so we need to position it on the edge of the screen
when in RTL. It naturally does this in LTR.

Bug: 233408508
Test: force user education to show for bubbles, check how it appears
     in RTL & LTR on: large screen portrait & landscape, and portait
     and landscape on phone.
Change-Id: I4e9ca9ed3d59ecaab3d6522961acf190f6a54850
2022-05-23 20:01:18 +00:00
Vadim Caen
21421cd776 DO NOT MERGE Only rely on developer option for back animation am: ab58191c7f am: 1d83999ad0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18310267

Change-Id: I59cdc9e93cce4e8b7cbeaea5f0816d5a78a7d7de
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-23 19:34:50 +00:00
Vadim Caen
1d83999ad0 DO NOT MERGE Only rely on developer option for back animation am: ab58191c7f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18310267

Change-Id: I150be6a4fae771ffe6e841806772aa2218ae871b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-23 19:32:00 +00:00