Commit Graph

598 Commits

Author SHA1 Message Date
Chavi Weingarten
9affe38fc5 Revert "Convert invalid crop to display bounds for captureDisplay"
This reverts commit d2caa1f0ac.

Reason for revert: 247801379

Change-Id: I6da853fdbf50cf67d5f4f2428571d668d63b7317
2022-09-21 21:51:04 +00:00
Chavi Weingarten
d2caa1f0ac Convert invalid crop to display bounds for captureDisplay
If the crop value passed in the args for captureDisplay is invalid, use
the display bounds instead.

Test: WindowManagerServiceTests#testCaptureDisplay
Bug: 242714168
Change-Id: Iebe42fd35c5f49b6e711699aa1b986a556a5a5f8
2022-09-20 19:31:10 +00:00
Chavi Weingarten
c184fd711a Add captureDisplay API in WMS.
Allow clients to request a display screen capture using a specified
displayId. The caller can pass in their own required arguments and they
will get the screenshot via an async callback directly from SF.

Test: ScreenshotTests
Bug: 242714168
Change-Id: I387f58d342f01ae71b85311fbf0634f0e7901f7d
2022-09-19 19:32:42 +00:00
Chris Li
d46a1bdc9c Merge "Only play ActivityEmbedding animation if there is AE split" into tm-qpr-dev am: 7eb3933a3e am: e4d6e029d0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19949790

Change-Id: I314af442724fe9d14801250b4979ba9879ba6c42
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-16 01:33:18 +00:00
Chris Li
8696c045ca Merge "Play ActivityEmbedding animation if all changes in Task with embedded" into tm-qpr-dev am: 941a2e72f6 am: a5c9cd1525
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19851630

Change-Id: I25a90caac1ccd33404094ce4b0b4203fe87bec5d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-16 01:29:37 +00:00
Chris Li
7eb3933a3e Merge "Only play ActivityEmbedding animation if there is AE split" into tm-qpr-dev 2022-09-15 23:31:24 +00:00
Chris Li
941a2e72f6 Merge "Play ActivityEmbedding animation if all changes in Task with embedded" into tm-qpr-dev 2022-09-15 23:31:09 +00:00
Chris Li
b74873a410 Only play ActivityEmbedding animation if there is AE split
Same as the legacy app transition, we want to play the app customized
animation if there is no AE split.

We don't support app customized animation when there is AE split yet to
make the animation consistant.

Bug: 207070762
Test: atest WMShellUnitTests:ActivityEmbeddingControllerTests
Test: atest WmTests:TransitionTests
Change-Id: I68348cd650b9dbc8c39ef8d22a171d128e196882
2022-09-15 06:31:01 +00:00
Chris Li
1efadcb97c Play ActivityEmbedding animation if all changes in Task with embedded
Same as the legacy app transition, we want to play AE animation if all
changes are in Task with embedded activity

Bug: 207070762
Test: atest WmTests:TransitionTests
Change-Id: I66c5c083a517b3254d647c7335264eba8837f0cd
2022-09-15 06:30:05 +00:00
Chavi Weingarten
2b7f2aee30 Migrate screen capture code to ScreenCapture file
Test: ScreenshotTests
Bug: 242714168
Change-Id: I8061f1717cc4e293ee07672d6d415c2c36010ccd
2022-09-14 15:35:46 +00:00
Chris Li
5ef4e81b20 Merge "Cleanup unused TestApi in TaskFragmentOrganizer" into tm-qpr-dev 2022-09-13 04:35:19 +00:00
Chris Li
3550fa269a Cleanup unused TestApi in TaskFragmentOrganizer
The callback handling is moved to SplitController#onTransactionReady, no
longer need those TestApi.

This is different from the merged-in cl for CTS compatibility in the
current release.

Bug: 240519866
Test: pass existing
Change-Id: I66ddd51c94003254001436ff0505dde3b26d0437
Merged-In: I66ddd51c94003254001436ff0505dde3b26d0437
2022-09-13 09:38:26 +08:00
Chris Li
46437e5c4e Merge "Cleanup unused TestApi in TaskFragmentOrganizer" 2022-09-09 12:32:22 +00:00
Riddle Hsu
48d11607a9 Merge "Apply override scale from entry points on client" 2022-09-08 03:35:48 +00:00
Chris Li
a24231d876 Cleanup unused TestApi in TaskFragmentOrganizer
The callback handling is moved to SplitController#onTransactionReady, no
longer need those TestApi.

Bug: 240519866
Test: pass existing
Change-Id: I66ddd51c94003254001436ff0505dde3b26d0437
2022-09-08 09:07:01 +08:00
Evan Rosky
23b4592f6e Merge "Send core-created snapshots to transition player" into tm-qpr-dev am: da06944a7c am: a4c62e8860
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19786134

Change-Id: I669f63e5d9c6ee6243c1bffe3839c6eb4583372b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-07 17:41:20 +00:00
Evan Rosky
da06944a7c Merge "Send core-created snapshots to transition player" into tm-qpr-dev 2022-09-07 17:15:05 +00:00
Chris Li
e7e16b0e8b Merge "Add TaskFragmentOrganizer#applyTransaction with request transition" into tm-qpr-dev am: 2c9b75902e am: 85167f8475
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19714429

Change-Id: If235e557072cc4f295e14b0599c3199096bb019b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-01 07:55:31 +00:00
Chris Li
2c9b75902e Merge "Add TaskFragmentOrganizer#applyTransaction with request transition" into tm-qpr-dev 2022-09-01 06:59:10 +00:00
Chris Li
dc7cb3659d Add TaskFragmentOrganizer#applyTransaction with request transition
Instead of having WM Core to "guess" when to request transtiion, let the
organizer to tell whether or not it needs to be applied immediately.

With the shouldApplyIndependently parameter, we can make sure the future
runtime API to change split layout won't affect other ongoing
transition.

Bug: 207070762
Test: atest WmTests:TaskFragmentOrganizerControllerTest
Change-Id: I658b0ba1ae9decc741f09cb53bfff2c45ea076a0
2022-09-01 12:00:31 +08:00
Evan Rosky
c8b3fc0acc Send core-created snapshots to transition player
This way, the player doesn't have to take a second
screenshot for use during animation.

This also includes luma (only for rotation) since
that requires the actual buffer and we only want to
send the snapshot surface.

Bug: 242056267
Test: atest TransitionTests
Change-Id: Ib76bb821b4aa8c01c6db1827c26b9fb498aae878
2022-08-31 15:20:06 -07:00
Maryam Dehaini
dc56080d6e Merge "Move Task Close to WindowContainerTransaction" into tm-qpr-dev am: ef023c1411 am: 554bea8da6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19659464

Change-Id: I021a6bfd1eaf09a2c97c7614b0838bfde617ae81
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-31 22:01:51 +00:00
Maryam Dehaini
ef023c1411 Merge "Move Task Close to WindowContainerTransaction" into tm-qpr-dev 2022-08-31 20:39:37 +00:00
Riddle Hsu
a0530caa33 Apply override scale from entry points on client
This provides a sandbox-like scaled environment on client side.

- This prevents the metrics and config from being scaled multiple
  times because the entry points are only called from server side,
  there won't have reentrancy for applying the scale.
- App's configuration callback method can get scaled config.
- If override scale is enabled, the legacy compat mode will be
  skipped. That avoids mixing different approaches of scaling.
  - Legacy compat mode is to simulate a 320dp x 480dp screen
    size with density 160 (the surface scale and config scale
    are different).
  - Override scale is to downscale the app for better performance
    (the surface scale and config scale are the same).

Bug: 238416387
Bug: 240335717
Test: atest ActivityThreadTest#testOverrideScale
Test: atest CtsWindowManagerDeviceTestCases:CompatScaleTests
Test: am compat enable DOWNSCALED $pkg
      am compat enable DOWNSCALE_50 $pkg
Change-Id: I0ddf333996f229063511273f8aeb3867c9ba8bda
2022-08-31 17:49:24 +00:00
Maryam
193d515420 Move Task Close to WindowContainerTransaction
Added removeTask HierarchyOp so that CaptionWIndowDecorModel now uses WindowContainerTransaction to remove task rather than IActivityTaskManager#removeTask(int)

Bug: 242094334
Test: Manual testing using acloud and unit testing (atest WmTests:WindowContainerTransactionTests)

Change-Id: I9e2f1946a517bdba6a75b7049f00943d729045f0
2022-08-30 22:17:21 +00:00
Chris Li
6757ccaaeb Merge "Make WCT#requestFocusOnTaskFragment a TestApi" into tm-qpr-dev am: 69d314f23e am: 3d65738ac7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19745196

Change-Id: Ieac08be96474c2685605f9a5667c91a4f46ff206
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-29 17:36:21 +00:00
Chris Li
69d314f23e Merge "Make WCT#requestFocusOnTaskFragment a TestApi" into tm-qpr-dev 2022-08-29 16:34:35 +00:00
Chris Li
cd9be246fd Merge "Handle TaskFragmentOrganizer#onTransactionReady in sync" into tm-qpr-dev am: e102950286 am: adfd2deb74
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19691944

Change-Id: I1bf446bc582b8f9012917a51f88c68f7b3f2b0e5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-27 10:48:04 +00:00
Chris Li
513a9ffcbb Handle TaskFragmentOrganizer#onTransactionReady in sync
Refactor TaskFragmentOrganizer#onTransactionReady to
SplitController#onTransactionReady to make sure that the
transaction is handled in one sync block.

Bug: 240519866
Test: pass existing for refactor
Change-Id: I9e7191e2b71ba262e1a3f8c947f9354698382972
2022-08-27 07:38:50 +08:00
Chris Li
da64f9599f Make WCT#requestFocusOnTaskFragment a TestApi
So that we can verify the API in CTS.

Bug: 232476698
Test: CtsWindowManagerDeviceTestCases:TaskFragmentOrganizerPolicyTest
Change-Id: I0e064f8cae48cc0281a0b462b8d072baceeeca9f
2022-08-26 10:19:37 +08:00
Wei Sheng Shih
4ec0b52029 Merge "[RESTRICT AUTOMERGE]BackGestureAnimation: a lightweight recents animation controller" into tm-qpr-dev 2022-08-25 14:04:21 +00:00
Ming-Shin Lu
91d1d949bd Merge "Fix no cross-profile thumbnail animation" into tm-qpr-dev am: 95264856d1 am: fcbea80252
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19574870

Change-Id: I264dc31357dcb36ce7ee78266d022311ae9b4fe5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-25 06:09:55 +00:00
Ming-Shin Lu
95264856d1 Merge "Fix no cross-profile thumbnail animation" into tm-qpr-dev 2022-08-25 04:41:36 +00:00
Ming-Shin Lu
389ef0bb5e Fix no cross-profile thumbnail animation
As the task of the launching activity requests attaching cross-profile
thumbnail animation but in Transication#onTransitionReady didn't be
promoted into change list, so it ends up no-op since attaching thumbnail
for cross-task requires the animating target is the task.

Fix the issue by
1) Add {FLAG_CROSS_PROFILE_OWNER_THUMBNAIL,
   FLAG_CROSS_PROFILE_WORK_THUMBNAIL} in TransitionInfo.Change for shell
   to know which thumbnail icon should load, according to the userId of
   launching activity.
2) Remove isTask and add 1)'s change flag check in
   attachCrossProfileThumbnailAnimation to make the thumbnail animation
   can be played and attached on the activity-level.

Fix: 239798040
Test: as issue steps
 1) Use Gmail app
 2) Tap the account icon
 3) Select "Switch to personal profile" (or "Switch to work profile")
 4) Expect the dimmed background thumbnail icon with
    task opening transition are animated in parallel
Change-Id: I90eecf4e8ba104c7234a39d1b2638295820d2ac7
2022-08-24 23:58:15 +08:00
Chris Li
ca4cd1a963 Merge "Wait for TaskFragmentOrganizer to finish handling transaction" into tm-qpr-dev am: 3294ef42e4 am: 570d249c9c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19564031

Change-Id: I860a58b9810dff8f844e1116c812ef95eea01516
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-24 05:56:05 +00:00
wilsonshih
c9c9a757a8 [RESTRICT AUTOMERGE]BackGestureAnimation: a lightweight recents
animation controller

Copy most of code from RecentsAnimationController to back gesture
animation controller(BackNaviAnimationController), the infrastructure
can be reused for either back-to-home/back-to-task/back-to-activity
animations if needed. Since the infrasturcture of legacy recents
animation controller should be stable already, we don't need to
worry about issues like leak leashes/flickers/fixed rotation.

BackAnimationAdaptor is a temporary class to help migrate to shell
transition, the target is to replace it by RemoteTransition.

Next step: Migrate to shell transition, decouple animation info from
BackNavigationInfo.
Test: manually play back to home animation to verify no flicker/black
background/leak surface. Also test that there can play back to home
animation even when quick swipe.
Test: atest BackNavigationTest
Test: atest BackNavigationControllerTests BackAnimationControllerTest
Bug: 237642535

Change-Id: I436a3dcf5011c56c08d131b40168f19128cc8723
2022-08-24 02:35:46 +00:00
Chris Li
4e9c5b44b1 Wait for TaskFragmentOrganizer to finish handling transaction
When a TaskFragmentTransaction is sent to the organizer during a
transition, have the transition wait for the organizer to finish
handling the transaction.

Bug: 207070762
Test: atest WmTests:TaskFragmentOrganizerControllerTest
Change-Id: I4b7955171cd8ce386686ff2cd64b7c04a6436ddf
2022-08-23 09:46:05 +08:00
Chris Li
f215542792 Merge "Apply TaskFragmentOrganizer changes in one WCT (2/2)" into tm-qpr-dev 2022-08-21 02:07:04 +00:00
Chris Li
660101fdc7 Apply TaskFragmentOrganizer changes in one WCT (2/2)
Before, when receive TaskFragment transaction, we apply changes in
multiple WindowContainerTransactions. Now, update to apply all changes
in one WCT for the whole TaskFragment transaction.

Bug: 240519866
Test: pass existing
Change-Id: I943d6232ff226ed6f67367fa9b7f73e1f861de64
Merged-In: I943d6232ff226ed6f67367fa9b7f73e1f861de64
2022-08-20 20:19:57 +08:00
Chris Li
87cc485c6a Apply TaskFragmentOrganizer changes in one WCT (2/2)
Before, when receive TaskFragment transaction, we apply changes in
multiple WindowContainerTransactions. Now, update to apply all changes
in one WCT for the whole TaskFragment transaction.

Bug: 240519866
Test: pass existing
Change-Id: I943d6232ff226ed6f67367fa9b7f73e1f861de64
2022-08-20 17:38:36 +08:00
Chris Li
45c117ef7d Merge "Apply TaskFragmentOrganizer changes in one WCT (1/2)" into tm-qpr-dev am: 2224d4712a am: 364b73aa31
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19588352

Change-Id: I863c89d6dbce617f9014bb385734e33b9aad4a43
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 17:11:55 +00:00
Chris Li
c8587817c4 Merge "Address TaskFragmentOrganizer style comments" into tm-qpr-dev am: 153bf507fd am: 5003636f7a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19590596

Change-Id: I2cb6c3c432e33aeaf432679728edca39c7e1944a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 17:05:23 +00:00
Chris Li
2224d4712a Merge "Apply TaskFragmentOrganizer changes in one WCT (1/2)" into tm-qpr-dev 2022-08-19 08:56:42 +00:00
Chris Li
153bf507fd Merge "Address TaskFragmentOrganizer style comments" into tm-qpr-dev 2022-08-19 03:30:11 +00:00
Chris Li
e9a1037439 Apply TaskFragmentOrganizer changes in one WCT (1/2)
Before, when receive TaskFragment transaction, we apply changes in
multiple WindowContainerTransactions. Now, update to apply all changes
in one WCT for the whole TaskFragment transaction.

Will update the TestAPI in the followup cl.

Bug: 240519866
Test: pass existing
Change-Id: I2e15b187bee95193874d76bc6963d3e01eba3910
2022-08-17 08:51:03 +08:00
Chris Li
99da16cdc8 Address TaskFragmentOrganizer style comments
1. Rename onActivityReparentToTask to onActivityReparentedToTask
2. Annotate @NonNull and @Nullable for the Extensions methods that are
   not yet annotated.

Bug: 240519866
Test: Refactor and add annotation. Pass existing tests.
Change-Id: I85c5927e6e7261cae3bce715b1955523d430e1e2
2022-08-17 08:46:28 +08:00
Gaurav Bhola
15a8232e38 Merge "Handle alwaysOnTop in DisplayAreas." into tm-qpr-dev 2022-08-12 03:23:30 +00:00
Tony Huang
f05ddf7262 Merge "Add setForceTranslucent API" into tm-qpr-dev am: 103a3b441f am: 6d4e72cb4d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19534875

Change-Id: I28265c978ad074f0b2e11870836e4b2c3da301f3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-11 07:53:43 +00:00
Tony Huang
103a3b441f Merge "Add setForceTranslucent API" into tm-qpr-dev 2022-08-11 06:51:28 +00:00
Shan Huang
0be76567fe Merge "Respect the enforce flag for callback registration." into tm-qpr-dev am: a2c8daf7d1 am: fa21ec758e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19563307

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