Commit Graph

659 Commits

Author SHA1 Message Date
Wei Sheng Shih
b6d85cd980 Merge "Ensure the animation finish sequence by synchronize call." 2022-11-17 08:16:32 +00:00
An An Yu
85093f9854 Merge "Add WindowProvider support to WindowLayoutComponentImpl and allow WindowProviderService to broadcast configuration changes to listeners." into tm-qpr-dev am: 63cd60eeb2 am: 6e11d27d69
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20267030

Change-Id: Ib41335c7b1f1c62b566f7953cdba428f1e07eff1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 08:14:54 +00:00
An An Yu
6e11d27d69 Merge "Add WindowProvider support to WindowLayoutComponentImpl and allow WindowProviderService to broadcast configuration changes to listeners." into tm-qpr-dev am: 63cd60eeb2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20267030

Change-Id: I0c7257d9e85c335aa39ed344bf23a1324c36a5bc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 07:47:34 +00:00
An An Yu
63cd60eeb2 Merge "Add WindowProvider support to WindowLayoutComponentImpl and allow WindowProviderService to broadcast configuration changes to listeners." into tm-qpr-dev 2022-11-17 07:39:47 +00:00
Louis Chang
782fb1812d Merge "Fixes app crash when starts activity with FLAG_ACTIVITY_REORDER_TO_FRONT" into tm-qpr-dev am: d0767e2bc2 am: 3d4d9d8876
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20310351

Change-Id: I178f472772bf5318300bacdc4c5292580feafac5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 03:56:00 +00:00
Louis Chang
3d4d9d8876 Merge "Fixes app crash when starts activity with FLAG_ACTIVITY_REORDER_TO_FRONT" into tm-qpr-dev am: d0767e2bc2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20310351

Change-Id: Iffd5b72abe24f5f77839dadda8ac952a68440fd5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 03:29:58 +00:00
Louis Chang
d0767e2bc2 Merge "Fixes app crash when starts activity with FLAG_ACTIVITY_REORDER_TO_FRONT" into tm-qpr-dev 2022-11-17 02:56:54 +00:00
An An Yu
4a999424a3 Add WindowProvider support to WindowLayoutComponentImpl and allow
WindowProviderService to broadcast configuration changes to listeners.

This is needed to allow IME to listen to WindowLayoutInfo changes.

Bug: 237342281
Test: CTS InputMethodServiceTest
Change-Id: Id8ddce5889b52859172caf3b4f0763bb5010b5dc
2022-11-17 01:13:17 +00:00
Louis Chang
24920c208d Merge "Move the task to back while pressing back on the last activity" into tm-qpr-dev am: b73cda834c am: e20ffee9dd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20278150

Change-Id: Ia1193d7790c8dda3ab693027b905b60915de326e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 01:12:19 +00:00
Louis Chang
e20ffee9dd Merge "Move the task to back while pressing back on the last activity" into tm-qpr-dev am: b73cda834c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20278150

Change-Id: I2b133d0cd5ea3dcb8ce038f1972f778c30048006
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 00:45:22 +00:00
Louis Chang
b73cda834c Merge "Move the task to back while pressing back on the last activity" into tm-qpr-dev 2022-11-17 00:21:08 +00:00
Chavi Weingarten
64d5d93bd7 Merge "Remove onSyncComplete from SurfaceSyncGroup" 2022-11-16 14:02:51 +00:00
wilsonshih
5d54c1b6ea Ensure the animation finish sequence by synchronize call.
By making IBackAnimationFinishedCallback synchronize call, the client
app won't have chance to create a transition before core receives
onAnimationFinished, which could play the second close animation from
that transition.

Note: Shell side change can be found in ag/20459278.

Bug: 131727607
Test: monitor client won't create close transition before core handled
onAnimationFinished.

Change-Id: Iad3c70c14727d438633d804a573000f8b71b023e
2022-11-16 16:17:22 +08:00
Louis Chang
99b9449724 Move the task to back while pressing back on the last activity
... of the secondary (or the primary) container.

The primary container was removed along with the secondary container
while the last Activity in the secondary container was finished by
back event. Therefore, starting window will be shown if starting the
app again from Launcher.

However, the last Activity in the secondary container should be
considered as a relative task root if the Activity is displayed
adjacently or being a companion with the task root activity.
The task should be moved to back vs. finishes the Activities to
speed up the launch next time, like commit 2dec42fa does.

Bug: 240669850
Test: launch Settings
Test: atest WindowOrganizerTests
Change-Id: I13b33afb8602f63062f6b33742453c3e93fdfc20
2022-11-16 02:26:37 +00:00
Louis Chang
5dc3ec5115 Fixes app crash when starts activity with FLAG_ACTIVITY_REORDER_TO_FRONT
Application was crashed while starting an embedded Activity with
FLAG_ACTIVITY_REORDER_TO_FRONT, because the embedded Activity was
not the direct child of the Task.

In this CL, the embedded activity is now moved to the top-most
position of the Task and dismissed from being embedded in order
to honer FLAG_ACTIVITY_REORDER_TO_FRONT.

Bug: 255701223
Test: locally verified with app
Test: atest TaskTests
Change-Id: I491139e5e1d712993f1fef9aebbd75e9ccfc539e
2022-11-16 01:34:24 +00:00
Cole Faust
e4abcbec1d [conflict] Merge "Fix errorprone warnings that should be errors" am: 677d6cd780 am: f9df26ae3c am: d3c499dabc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2256563

Change-Id: I84d67fdfcc99f9f6fca218d4264ab8e0bc1f1653
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 19:47:41 +00:00
Cole Faust
d3c499dabc Merge "Fix errorprone warnings that should be errors" am: 677d6cd780 am: f9df26ae3c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2256563

Change-Id: I8090e254f06a3b5fc7e9b23fdae6c5bd3db230c5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 19:37:15 +00:00
Cole Faust
f9df26ae3c Merge "Fix errorprone warnings that should be errors" am: 677d6cd780
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2256563

Change-Id: I0e9c5077610407a117ee34ff688b40b52e161a03
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 19:11:55 +00:00
Cole Faust
7da659bb6c Fix errorprone warnings that should be errors
This commit is part of a large scale change to fix errorprone
errors that have been downgraded to warnings in the android
source tree, so that they can be promoted to errors again.
The full list of changes include the following, but not all
will be present in any one individual commit:

BadAnnotationImplementation
BadShiftAmount
BanJNDI
BoxedPrimitiveEquality
ComparableType
ComplexBooleanConstant
CollectionToArraySafeParameter
ConditionalExpressionNumericPromotion
DangerousLiteralNull
DoubleBraceInitialization
DurationFrom
DurationTemporalUnit
EmptyTopLevelDeclaration
EqualsNull
EqualsReference
FormatString
FromTemporalAccessor
GetClassOnAnnotation
GetClassOnClass
HashtableContains
IdentityBinaryExpression
IdentityHashMapBoxing
InstantTemporalUnit
InvalidTimeZoneID
InvalidZoneId
IsInstanceIncompatibleType
JUnitParameterMethodNotFound
LockOnBoxedPrimitive
MathRoundIntLong
MislabeledAndroidString
MisusedDayOfYear
MissingSuperCall
MisusedWeekYear
ModifyingCollectionWithItself
NoCanIgnoreReturnValueOnClasses
NonRuntimeAnnotation
NullableOnContainingClass
NullTernary
OverridesJavaxInjectableMethod
ParcelableCreator
PeriodFrom
PreconditionsInvalidPlaceholder
ProtoBuilderReturnValueIgnored
ProtoFieldNullComparison
RandomModInteger
RectIntersectReturnValueIgnored
ReturnValueIgnored
SelfAssignment
SelfComparison
SelfEquals
SizeGreaterThanOrEqualsZero
StringBuilderInitWithChar
TreeToString
TryFailThrowable
UnnecessaryCheckNotNull
UnusedCollectionModifiedInPlace
XorPower

See https://errorprone.info/bugpatterns for more
information on the checks.

Bug: 253827323
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I8446f9076a45ebf7e7ffa06cb0d4ddb1001b6c00
2022-11-14 17:57:30 -08:00
Jorge Gil
bc425d503d Merge "Add WCT#setDragResizing to optimize fluid resizing" into tm-qpr-dev am: 1f17bf7eba am: f28339c869
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20378671

Change-Id: I3cdea614c657c696c551d31672b215cb80eeb789
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-14 22:24:21 +00:00
Iris Yang
ff0748833b Merge "Show a warning toast when PiP is blocked in the streamed display" 2022-11-14 09:09:16 +00:00
Tiger
bcbd60c45c Refine the naming about compatible scale
There can be 2 reasons that we need to apply compatible scale to a
window:

1. The app doesn't support large screen. We would layout the window as
   if it is on a small display. And then we need to scale its window up
   to match the display.

2. We put a running app into a container that the size doesn't fit. We
   need to down-scale the app so that it can fit the container.

The scaling of case 2 is also known as size-compat-scale which is fully
controlled at the server side. The client shouldn't know about it. And
this CL refines the naming.

Fix: 258393096
Bug: 254187021
Test: presubmit
Change-Id: Ifbd2ca725bed231d9e6dd8190df3dc773d4402b7
2022-11-11 11:19:06 +00:00
wilsonshih
da90308633 Generalize back animation and transition sequence...
for both shell and legacy transition system.

The general sequence will be:
1. Create animation leash in core, pass to remote animation runner.
2. Remote animation finish, collect finish transaction before
transition happen. Apply finish transaction here if back event won't
trigger.
3. Check whether next transition is triggered from back gesture via
checking the open/close targets.

The 3rd step introduce another change, which to let the back transition
happen. Instead of consume next transition, we should try to find out
whether the participant was the animation target, because we cannot
assume what the opening target will do in resume stage. For example,
the opening activity could finish itself, or start another activity at
onResume, so in either case, the opening activity will become closing
activity. We can only ensure that activity will participant in next
transition.
So the more robust way should be, find out those targets which were
animated. For shell transition, and add a flag to the corresponding
change, then the transition handler can determine what to do based on
the targets. For legacy transition, ignore those targets when estimate
the transition type in AppTransitionController#getTransitCompatType.

Bug: 238474994
Bug: 131727607
Test: varify transition can be handled for some unexpected scenario:
  1. launch new activity when close app.
  2. launch singleInstance activity when close app.
Test: do back gesture on both shell/legacy transiton system, verify
no flicker happen whenever the back is triggered.

Change-Id: I9364be25c608f7b5797577d26b57bc7d6f2dde9c
2022-11-11 03:11:22 +00:00
Jorge Gil
5a95db047e Add WCT#setDragResizing to optimize fluid resizing
Allows WM Shell to indicate the start/end of drag resizing, which
core can use as a signal to reuse a single (larger) surface size
for the entire drag resize operation to avoid continuous buffer
allocations after each size change.

Bug: 249808500
Test: drag resize a freeform window, verify WindowLayout requests
a fullscreen sized surface; atest TaskPositionerTest

Change-Id: I27e2b44270d7ea4f701fa8037f93b20dc691284b
2022-11-11 00:48:49 +00:00
Chavi Weingarten
e1e26f5c40 Remove onSyncComplete from SurfaceSyncGroup
There was already a way to register for an entire SurfaceSyncGroup
completing. There just wasn't a way to tell what SurfaceSyncGroup
something was added to in order to register in VRI. Therefore, add the
addedToSync argument in the readyToSync callback, allowing VRI to
register a complete callback instead of exposing a new API.

Also renamed onReadyToSync to onAddedToSyncGroup to reflect what is
happening. Renamed SyncBufferCallback to TransactionReadyCallback since
there isn't a guarantee the transaction contains a buffer.

Test: SurfaceSyncGroupTest
Test: NotificationShade Sync
Bug: 237804605
Change-Id: Ib58735cd86593a976e3f4559997316275bd82cd9
2022-11-07 20:38:43 +00:00
Evan Rosky
9071563b83 Share apply token between WMCore and WMShell
This means WMShell/Core/Launcher are using the same
apply token.

Barring alternatives, this is necessary to make sure
that transitions work properly (since surface operations
span multiple process). Otherwise, even if transactions
are received by SF in the correct order, they can be
applied in a different order.

Bug: 256046837
Test: atest PipRotationTest_ShellTransit and check for leaked
      tasks in surface dump.
Change-Id: I0424e66ed347576718f62b1e598ae116720aa70d
2022-11-02 21:58:57 +00:00
Riddle Hsu
9cb19408f8 Merge "Exclude unnecessary animations of shell transition" into tm-qpr-dev am: 171ade50ca am: 4fd124140d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20270814

Change-Id: I287144621dcd58fff370a7be3eea16e58cbf49d5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-01 08:40:40 +00:00
Riddle Hsu
e65d74270d Exclude unnecessary animations of shell transition
There may have multiple transitions when launching a task with
embedded activities. In the last transition info, it may contain
activities occluded by starting window and a closing wallpaper.
By default, all of them will be animated with edge extension,
that looks like showing some noise.

Because the animation of embedded activities under a task level
starting window is not visible, it can be skipped. But for
non-embedded activity, the activity level starting window can be
changed or closed with the host activity, so the case should not
be skipped.

Besides by default, wallpaper is no animation, especially it
shouldn't apply any task/activity style animation.

Also make sure the leash of starting window is always on top of
the task with embedded activities. This just makes the surface
hierarchy consistent.

Bug: 255269113
Test: No flickering when cold launch Settings on a large screen
      device with support of activity embedded.
Change-Id: I8fd1137e806aeb4060a83a71dc5aa02acdc42429
2022-10-28 17:50:56 +08:00
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
Shan Huang
188dee2b3b DO NOT MERGE 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: Ib0d3ebe43929c405b10681000fb4e7ef8bccce34
2022-10-21 22:12:53 +00: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
Iris Yang
b4c299fa34 Show a warning toast when PiP is blocked in the streamed display
Add an API in DWPC to monitor the Pip is allowed in the streamed display
by policy controller. If not allowed, pop up a warning toast for user.

Bug: 229837382
Test: manually, atest WmTests:ActivityRecordTests
Change-Id: Id1f39e8b54cd9c388c49b3886b9e798144ba5bf1
2022-10-04 12:12:17 +08: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