Commit Graph

629 Commits

Author SHA1 Message Date
Tiger Huang
2f8c5fe063 Merge changes from topic "requestedVisibleTypes2"
* changes:
  Describe requested visibilities in public types (3/n: server side)
  Describe requested visibilities in public types (2/n: client-server)
  Describe requested visibilities in public types (1/n: client side)
2022-10-26 06:10:04 +00:00
Shan Huang
c6357f1cab Spring controlled back progress API
This CL introduces BackProgressAnimator which runs in app's main thread.
It receives target progress values from SysUI and drives the actual
progress value passed to the app with a high stiffness, no bounce
spring.

Bug: 238475284
Test: atest WindowOnBackDispatcherTest
Test: atest BackAnimationControllerTest
Test: atest TouchTrackerTest
Change-Id: I5183fc8e77ada4dfb985addd8d5193ef335a558a
2022-10-21 15:34:19 -07:00
Tiger
9c4be367a8 Describe requested visibilities in public types (2/n: client-server)
This CL makes the client send an integer (instead of InsetsVisibilities)
as the requested visible types to the server.

This CL also removes the usages of InsetsVisibilities from WM shell.

Bug: 253420890
Bug: 234093736
Test: atest ActivityRecordTests DisplayContentTests InsetsPolicyTest
      InsetsStateControllerTest WindowContainerInsetsSourceProviderTest
      WindowLayoutTests WindowManagerServiceTests WindowStateTests
      WindowAddRemovePerfTest StartingSurfaceDrawerTests
      TaskSnapshotWindowTest
Change-Id: I29d245e3c36a29f01bdd3347fe858727c3540ff8
2022-10-18 19:20:14 +08:00
Riddle Hsu
f1ce612b26 Merge "Do not change surface of system window token for transition" into tm-qpr-dev am: 8af9006eb3 am: d2a41ff4a0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20165443

Change-Id: I003f824b893a2e0e878ae3c9441864abbbd60b50
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-13 17:43:52 +00:00
Riddle Hsu
1689d780d3 Do not change surface of system window token for transition
The collected WindowToken's (e.g. status bar, navigation bar)
isVisibleRequested may be changed according to its WindowState's
visibility policy or the visibility of who is controlling the insets.
They are not aware of the WindowToken surface visibility, so keep
them untouched unless shell transition supports general window
animation or even insets animation.

Bug: 251214841
Test: atest FlickerTests:CloseImeAutoOpenWindowToAppTest
Test: Launch an activity that requests to hide system bars.
      And use shell command to change display size at the same time.
      After the launch transition is finished, the system bars
      can still be visible when swiping from bottom or top.
Change-Id: I2403e2dcbc6684774c9c3b74768a32c7b7a3b8ae
2022-10-13 17:24:43 +08:00
Chris Li
b033b5a431 Polish ActivityEmbedding enter/exit PiP (1/n)
1. When moveActivityToPinnedRootTask with creating a new Task for PiP,
   make sure the Task's initial bounds is the same as the activity
   parent TaskFragment so the animation starts from the correct bounds.
2. When exit PiP to previous Task, make sure we are animating the
   correct window surface. For the previous implementation. there can
   also be TRANSIT_CHANGE change for entering ActivityEmbedding split
   (from PiP) in the same transition.

Bug: 207070762
Test: atest WmTests:RootWindowContainerTests
Test: atest WmTests:TransitionTests
Change-Id: Ifba090ad9ac9fb7033d343eab1c87c1a67bb9c11
2022-10-13 09:06:40 +08:00
Chris Li
84ec824a33 Polish ActivityEmbedding enter/exit PiP (1/n)
1. When moveActivityToPinnedRootTask with creating a new Task for PiP,
   make sure the Task's initial bounds is the same as the activity
   parent TaskFragment so the animation starts from the correct bounds.
2. When exit PiP to previous Task, make sure we are animating the
   correct window surface. For the previous implementation. there can
   also be TRANSIT_CHANGE change for entering ActivityEmbedding split
   (from PiP) in the same transition.

Bug: 207070762
Test: atest WmTests:RootWindowContainerTests
Test: atest WmTests:TransitionTests
Merged-In: Ifba090ad9ac9fb7033d343eab1c87c1a67bb9c11
Change-Id: Ifba090ad9ac9fb7033d343eab1c87c1a67bb9c11
2022-10-13 09:02:27 +08:00
Charles Chen
1c1ef813ad Merge "Fix SplitContainer not updated when folded." into tm-qpr-dev am: c0ee7bde68 am: d6faddae03
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20064106

Change-Id: I160e6c570123a3ee9709a1661b4b6d6c9accae1a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-07 13:59:09 +00:00
Charles Chen
c0ee7bde68 Merge "Fix SplitContainer not updated when folded." into tm-qpr-dev 2022-10-07 09:19:39 +00:00
Wei Sheng Shih
96bbb46f86 Merge "[Shell Transition] Schedule another transition to update visibility." into tm-qpr-dev am: 925181d781 am: b5d7a02fc1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19975767

Change-Id: I1c6cf150d96c4236c4b3d136403c3161960d531b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-06 09:14:25 +00:00
Charles Chen
6e0b27a126 Fix SplitContainer not updated when folded.
The root cause is that TaskFragmentParentInfo wasn't be dispatched
when there's a display or visibility change because we didn't
implement getTaskFragment() in TaskFragment and it led to
the TskFragment can't return itself if the predicate function
returns true.

This CL fixes WC#getTaskFragment and changes to dispatch
Task#shouldBeVisible instead of Task#isVisibleRequested.
The reason is that the visibleRequested change is not early enough for
the scenario that device is folded from unfolded state, and lead to
Settings flickering.

Test: manual - open Settings and fold the device
Test: atest TaskTests#testGetTaskFragment
Test: atest TaskFragmentOrganizerControllerTest ActivityRecordTests
fixes: 249055633
Change-Id: Ie1c56758697d14b426c9ed713da84e49c9f880d8
2022-10-06 17:08:42 +08:00
Wei Sheng Shih
925181d781 Merge "[Shell Transition] Schedule another transition to update visibility." into tm-qpr-dev 2022-10-06 08:34:09 +00:00
TreeHugger Robot
e77843dcc4 Merge "Make startTransition one-way" into tm-qpr-dev am: 96eae2359b am: e471197fcb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20034031

Change-Id: I37a9152993f26c5efd718a95be32826a065d51f2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-05 17:22:17 +00:00
wilsonshih
66e601fb13 [Shell Transition] Schedule another transition to update visibility.
Activity could call setTranslucent during a transition playing, if the
task of an activity was in transition and that activity should become
invisible, it would be defer until transition finish.
However, since the activity wasn't participant the running transition,
there won't do commitVisibility for it after transition finish.
To correct the visibility status, trigger another transition so the
activities which visibility changed can be collect and commit.

Bug: 246518648
Test: atest testConvertTranslucentOnTranslucentActivity
Test: atest testConvertTranslucentOnNonTopTranslucentActivity
Change-Id: Ic1cda79da37162cca2a1a3fbc73311cc325b3874
2022-09-29 09:20:49 +00:00
Arthur Hung
5c85e5b6c0 Migrate back animation to shell transition
When back animation finished, it will invoke the real back callback and
cause a new transition started.

In this CL, we introduce the back transition handler to consume the
incoming transition request and takeover the whole transition if the
transition info contians same departing window token.

This also seperated the behaviors of enabled/disabled shell
transition.

Bug: 238475694
Test: Enabled shell transition, atest BackNavigationControllerTests
      BackAnimationControllerTest
Change-Id: I57e7c89ce6cb7a99ab3af403704b9dd948f26151
2022-09-29 01:54:55 +00:00
Arthur Hung
8fcc92bb34 Refactor back navigation animtion (1/2)
In previous design, it would create all necessary leashes when starting
back navigation, and they would be carried by `BackNavigationInfo` and
`BackEvent` and would finally deliver to the shell and animator side.

In this CL, we will use the adapter that wraps a back animation runner
to deliver all leashes in next surface placement after back navigation
has started.

In shell side, every animator should be registered by type, so the
adapter could deliver leashes via IRemoteAnimationRunner to the
target animator, and invoke callback when it finished.

This also eliminated all unecessary fields from `BackNavigationInfo` and
`BackEvent`.

Bug: 241808055
Test: atest BackNavigationControllerTests BackAnimationControllerTest
      BackNavigationTest
Change-Id: I8bbec0d8d9631110c3d2788d958b50ae487520a7
2022-09-29 01:21:37 +00:00
Chavi Weingarten
b093895369 Merge "Add captureDisplay API in WMS." 2022-09-28 23:01:40 +00:00
Riddle Hsu
7e2eeb1395 Make startTransition one-way
If shell is starting an existing transition, it doesn't need the
returned transition token so it can be an async call then it won't
block shell's thread to execute other operations.

If shell is starting a new transition, then use the new added 2-way
startNewTransition which is the same as the original path.

Bug: 248550757
Test: atest ShellTransitionTests
Test: CtsWindowManagerDeviceTestCases with shell transition
Change-Id: I5f64d19475d5b857a461775dd6f3002567e93ad8
2022-09-27 15:06:37 +08:00
Chris Li
3a3cd42282 Merge "Allow ActivityEmbedding to finish Activity through WCT" into tm-qpr-dev am: c1735a1f7b am: 351dc0f57e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19992921

Change-Id: I3c680b06f549eabf6aa26b25871c95e6a45358c1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-24 03:51:07 +00:00
Chris Li
840218d5df Allow ActivityEmbedding to finish Activity through WCT
Before, we call Activity#finish() to finish activities when removing
TaskFragment. This may start a CLOSE transition before the organizer has
a chance to request the actual transition type.

Now, we allow the organizer to finish activities through WCT so that the
operation is atomic and the organizer can request the correct transition
type.

Bug: 240519866
Test: atest WmTests:TaskFragmentOrganizerControllerTest
Test: atest CtsWindowManagerDeviceTestCases:TaskFragmentOrganizerTest
Change-Id: I54671fb2dd34dca952468305429a90d89953de69
2022-09-23 21:23:03 +08:00
Chavi Weingarten
ddd124e8b0 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
Test: WindowManagerServiceTests#testCaptureDisplay
Bug: 242714168
Change-Id: If56bdf7aae07120e94cdb11bc6620302a886e585
2022-09-22 17:53:00 +00:00
Chavi Weingarten
51847be272 Merge changes from topic "revert_capture_display"
* changes:
  Revert "Add captureDisplay API in WMS."
  Revert "Convert invalid crop to display bounds for captureDisplay"
2022-09-22 14:10:37 +00:00
Chris Li
a8efe11bcf Merge "Skip ActivityEmbedding animation if it is behind an app starting window" into tm-qpr-dev am: 646b0c13e6 am: 35c994e6a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19874691

Change-Id: If7eff682950020ef27ddeddb51d12781599ff6bd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-22 10:08:24 +00:00
Chris Li
6a3dfb250a Skip ActivityEmbedding animation if it is behind an app starting window
Bug: 207070762
Test: atest WMShellUnitTests:ActivityEmbeddingAnimationRunnerTests
Test: atest WmTests:TransitionTests
Change-Id: I602201646040f3358a688dcb6ec779f8244953ac
2022-09-22 11:25:38 +08:00
Charles Chen
6262cd3f6b Merge "Send TaskFragmentParentInfo for visibility changes" into tm-qpr-dev am: 501b654ce3 am: 9719510a41
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19928852

Change-Id: I9f0463304716ea88458e5cb841fca1e2c44b86c3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-21 22:43:43 +00:00
Charles Chen
8fcf79a549 Merge "Add TaskFragmentParentInfo" into tm-qpr-dev am: 2e95b5f6fe am: 72b8dffcc1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19928850

Change-Id: Ia48e2556ed7ea8dc15135e1f3b21b8ab6593a143
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-21 22:39:29 +00:00
Chavi Weingarten
0fff17bdd5 Revert "Add captureDisplay API in WMS."
This reverts commit c184fd711a.

Reason for revert: 247801379

Change-Id: I20ac6772656d116ca03bc12d60a0c331f7079df2
2022-09-21 21:52:05 +00:00
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
Charles Chen
501b654ce3 Merge "Send TaskFragmentParentInfo for visibility changes" into tm-qpr-dev 2022-09-21 11:45:05 +00:00
Charles Chen
2e95b5f6fe Merge "Add TaskFragmentParentInfo" into tm-qpr-dev 2022-09-21 11:43:45 +00:00
Charles Chen
6012e9b748 Send TaskFragmentParentInfo for visibility changes
This CL propagates visibility from Activity to Task, and dispatch
 #onTaskFragmentParentInfoChanged is there's a task visiblity
update. This CL also send the callback when the associated Display
of Task changes.

Test: atest TaskFragmentOrganizerControllerTest
fixes: 243609832

Change-Id: I3b0198cfd11a3ec4917f92d0a1e540cf16827d08
2022-09-21 08:33:47 +00:00
Charles Chen
3589fb907f Add TaskFragmentParentInfo
This CL adds a TaskFragmentParentInfo class and extends
onTaskFragmentParentInfoChanged to dispatch display ID and
visibility of the parent Task.
It makes SplitController able to track visibility and display
changes and used to update SplitContainers if there's a folding
state change.

Test: atest SplitControllerTest TaskFragmentOrganizerControllerTest
Bug: 243609832
Bug: 207494880

Change-Id: If3d5db621b20d4005ce0b60e46ac98e1d1e962e3
2022-09-21 08:30:51 +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