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
So that we can verify the API in CTS.
Bug: 232476698
Test: CtsWindowManagerDeviceTestCases:TaskFragmentOrganizerPolicyTest
Change-Id: I0e064f8cae48cc0281a0b462b8d072baceeeca9f
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
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
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
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
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
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
Predictive back infra respect the enforce flag everywhere else (e.g. for
compat / default callback registrations), so we follow the same pattern
here.
This flag is a development only flag, so this CL should not affect
droidfood or public builds.
Test: `adb shell setprop persist.wm.debug.predictive_back_always_enforce
1`. Restart. Check apps can register callbacks without opting in (e.g.
can swipe back to LS from bouncer)
Change-Id: I7d5a85b37b50b11f6e4be28d022dd0e528a7d4fd
Add this api for split screen improve enter transition.
When we start intent on side stage task, the top split root task
will go to top and current top one task will be set as invisible
then cause black screen due to split root task is full screen.
Solve this by use new wct api setForceTranslucent to make split
root task as translucent when split inactive. We need to reset
it when split active otherwise it cause flicker when back to home.
Bug: 223325631
Bug: 235029020
Test: atest WmTests
Change-Id: I28df2879345718b726af9fdb7ea54644c77ab925
- Also add setAlwaysOnTop API in WindowContainerTransaction.
Bug: 188102153
Test: atest DisplayAreaTest
Test: Tested manually by setting it on DisplayAreas
Change-Id: I683e3c6bdf1bb6a590829a197f5dbef2c171d7e9
Merged-In: I683e3c6bdf1bb6a590829a197f5dbef2c171d7e9
Before, we passed Task configuration changed for every embedded
TaskFragment. Now, we only passed one Task configuration changed for the
whole Task. The organizer will then update TaskFragments in the Task
accordingly.
Bug: 240519866
Test: atest WmTests:TaskFragmentOrganizerControllerTest
Change-Id: I755c11a1bcee0dd0305a090b229e867b79eee46d
Before, we have several different callbacks, such as
onTaskFragmentAppeared, onTaskFragmentInfoChanged, etc. As migrating to
Shell transition, we need a new model to better sync between app
process, WM Core and Shell.
The flow will be:
1. WM Shell startTransition with a WindowContainerTransaction
2. After apply the WCT, notify TaskFragmentOrganizerController
3. TFOrganizerController pack the TF related events into one transaction
4. TFOrganizerController call deferTransitionReady and send the
transaction to the TFOrganizer in app process
5. TFOrganizer update TFs based on the transaction and apply a WCT
6. When TFOrganizerController get that WCT, call continueTransitionReady
Bug: 240519866
Test: pass existing
Change-Id: I110953f7b73f565a2b1299ef5c3827eaa39e84b8
If user applied a back gesture but core cannot find a focus window,
inject back key event, so that event can dispatch to client once it
gain focus window. And since the gesture was happened, treat it as
onBackPressed.
And if device is playing recents animation but the focus window is
point to live tile, we can also inject back key because Home/Recents
activity shall not have the same behavior as normal app.
Bug: 237629607
Test: cross test that back gesture can finish recents with legacy/shell
transition on Nexus/3rd launcher.
Test: test on BackTestApp for both 3btn mode and gesture mode.
Test: atest AnrTests BackNavigationLegacyGestureTest
Test: atest OnBackInvokedDispatcherTest KeyboardVisibilityControlTest
BackInvokedOnWidgetTest BackNavigationTests BackNavigationControllerTests
Change-Id: If754e66ea7c1c4ec313c45d17d7f6c10bfc2c465
..used for signaling the launcher to crop the
remote animation target bounds when task animating on the taskbar.
If the task will show IME on the top means the animation taget would not
need to be cropped according to the taskBar insets, since visually the
taskbar is hidden when IME is visible.
Bug: 219981732
Test: manual as steps
0) enable taskbar with Settings > Developer options > Smallest width
as 600dp.
1) launch an app from all apps and show the IME by tapping the editor.
2) swipe out to home and launch it again by pressing the shortcut.
3) Verify the animating task preview with IME shown without being
cropped.
Change-Id: Iab526e78614c68626bd5424e0e3219044f671f4d
This reverts commit 0099ca8fab and provide
new mechanism.
The back invoke target could lost focus during back navigation gesture.
To prevent the non-focused window could still trigger back action cause
some unexpected behavior, this CL will listen the focus change of
current focused window and cancel back gesture when its focus has lost.
Bug: 238050065
Bug: 239792909
Test: atest BackNavigationControllerTests
Test: atest BackNavigationLegacyGestureTest BackNavigationLegacyTest
Test: atest BackNavigationTests
Test: atest WindowOnBackInvokedDispatcherTest BackNavigationTest
Test: atset BackAnimationControllerTest
Change-Id: I65eb19371020ce39977eeb2a2a80c7f08600aaec
So, the TaskFragmentOrganizer can know what exact operation was
failed and perform error handles if needed.
Removes the pending appeared activities when starting/reparenting
activity into a TaskFragment was failed.
Deprecating the #onTaskFragmentError method with another overloaded
version, but still making sure the deprecated one is called in order
to make it compatible with Android T CTS.
Bug: 236668365
Bug: 233989810
Test: atest TaskFragmentTest
Test: atest TaskFragmentOrganizerControllerTest
Test: atest TaskFragmentOrganizerTest
Test: atest TaskFragmentOrganizerPolicyTest
Change-Id: Id328d037536d32b3acb9c424d36052b6dca8628a
Merged-In: Id328d037536d32b3acb9c424d36052b6dca8628a
The client computes the window frame on its own in ViewRootImpl#setView.
However, the bounds obtained from WindowConfiguration is not size-
compatible, which makes legacy apps produce wrong frames. The frame is
larger than expected, so when computing WindowInsets with size-
compatible InsetsState, the window cannot receive insets.
Although the client will receive the correct window frame from relayout,
but the first WindowInsets has been dispatched before that.
This CL sends the size-compat scale to the client, so the client can use
the correct WindowConfiguration to compute frames.
This is also a step to enable the client to perform local window layout.
Bug: 237749017
Bug: 161810301
Bug: 175861127
Test: atest StartingSurfaceDrawerTests WindowAddRemovePerfTest
ActivityRecordTests WindowManagerServiceTests
Change-Id: I6b23901f4b1f009444c04da7e078ea971a386ad7
The back invoke target could lost focus during back navigation.
To prevent the non-focused window could still trigger back action cause
some unexpected behavior, this CL will listen focus changed and skip the
back invoke call.
Test: launch a trampoline activity and trigger back before next activity
shown.
Test: atest WindowOnBackInvokedDispatcherTest
Bug: 238050065
Change-Id: Ifd345b2283c5d07628e2884db6e4e13f3ec31e83
Exit the split-screen in case users put the uncontrolled task into
split-screen. This CL do below change to support handling this task.
1. If no controlling activity appeared, dismiss the split screen
and show a toast to inform users.
2. Reparent all tasks out of split root when dismissing instead of
just reparent controlling tasks.
3. Disable the split-item from launcher for tasks that are
uncontrolled.
Bug: 230461945
Bug: 208646963
Bug: 238032411
Test: atest MultiWindowTests
atest WMShellUnitTests
Change-Id: Iab59561e9d532b10dab8f5063047c4b68b73eb87
The attached frame is the frame of the parent window that its child
attaches to, as long as the child is not
TYPE_APPLICATION_ATTACHED_DIALOG. It is a factor while computing the
window frame.
Previously, we let the child obtain the attached frame from its parent
view root. However, if the parent and the child are not in the same
process, it can be tricky.
This CL sends the attached frame from the server to the client via
ClientWindowFrames. In this way, the child can compute its window frame
without having to accessing the parent view root.
Bug: 161810301
Bug: 175861127
Test: atest ActivityRecordTests WindowLayoutTests
Change-Id: Ia844a4c927027e305a56114216eaee2bf7933b1f
When the enableOnBackInvokedCallback is set to false (or not set),
registering an OnBackInvokedCallback should be a no-op to avoid
overriding the default compat callback.
Test: Manual testing registering a callback on an app with the flag
disabled and doing a back gesture. Currently we don't have test
executing a back gesture so automated tests are not possible
Bug: 235206960
Change-Id: I54d843f11130a78ed5a68cbe4722e601a2086ee1
Merged-In: I54d843f11130a78ed5a68cbe4722e601a2086ee1
(cherry picked from commit aa48dc3c2d)
Before this CL, minimum dimensions of Activity wasn't respected,
that said, an Activity could be embedded in a TaskFragment of which
bounds are smaller its minimum dimensions.
This CL add the minimum dimensions on several places:
WM core:
1. Verify minimum dimension requirement before adding an Activity to
a TaskFragment. It'll be early return if the requirement is not
satisfied.
2. Propagate the minimum dimensions to the client side through
TaskFragmentInfo to notify the requirement.
3. If TaskFragmentOrganizer tries to shrink a TaskFragment to
the bounds that smaller than minimum dimensions of its children
Activity, switch to match the parent bounds.
AndroidX Window extensions:
1. Early return if TaskFragment is resized to the bounds that smaller
than minimum dimensions which dispatched from the server side.
2. When organizer tries to show Activities side-by-side, verify if
minimum dimensions requirement of the primary Activiy. If the
requirement is not satisfied, show Activities in fullscreen
instead.
TODO: Add an API to check if an Activity intent is allowed to embed
in a TaskFragment.
Bug: 232871351
Test: atest TaskFragmentOrganizerControllerTest
Test: atest TaskFragmentOrganizerTest TaskFragmentOrganizerPolicyTest
Test: atest SplitActivityLifecycleTest
Test: atest CtsWindowManagerJetpackTestCases
Test: atest WmJetpackUnitTests
Merged-In: Ib46c2cec2a0735b9e3f3420f2cb94754801b86b9
Change-Id: Ib46c2cec2a0735b9e3f3420f2cb94754801b86b9
Otherwise, the activity may not be relaunched in the right
configuration.
Bug: 235449822
Bug: 235774601
Test: start Settings
Test: atest SizeConfigurationBucketsTest
Change-Id: I3c1d63114b570e1f740408a4381888b0697c2c94
Within the PictureInPictureSurfaceTransaction class, one can explicitly
express the intention to call Task#setCanAffectSystemUiFlags(false) and
it is typically used if an Activity is entering PiP.
Video: http://recall/-/b1EZhgUkQcpML5OwZekLBN/dlG6qSf9pT2f4YlIe2Klb3
Video: http://recall/-/b1EZhgUkQcpML5OwZekLBN/cfXwlpol5vi2AER32rKu2x
Bug: 213598210
Test: 1. follow the reproduce steps in the bug. \
2. make sure PiP from split-screen has no regressions. \
see also the videos.
Change-Id: I7c4624a89ff812f874270fe0092617328b557393
VRI is not currently waiting for SV to draw since SV may start its draw
before VRI opened the SyncSet. If that happens, VRI will not include SV
in its SyncSet and report draw finished even if SV is not complete.
This fix has SV create its own SyncSet when redrawNeeded. Then if VRI
creates a sync, SV will merge its own SyncSet into that one. If SV
already finished drawing, then nothing will get merged, but it means SV
is ready already. If SV is not finished, VRI will now also wait for SV's
draw to finish before calling finishDraw.
Test: Long delay in surfaceRedrawNeededAsync
Test: SurfaceSyncerTest
Bug: 230998394
Change-Id: I44331b8f54951e6dc633a4845bbf690abde0f95e
We refactor setAdjacentRoots function on tm-qpr but cts suite is
still using tm branch and it lead to it cannot found previous
function. Add a temp function params same as old one on tm-qpr only
for pass tests.
Fix: 235169332
Test: atest MultiWindowTests on tm-dev codebase
Change-Id: I3eaea698089cec78ef7fcef17817317c55a7bfe6
Before this CL, minimum dimensions of Activity wasn't respected,
that said, an Activity could be embedded in a TaskFragment of which
bounds are smaller its minimum dimensions.
This CL add the minimum dimensions on several places:
WM core:
1. Verify minimum dimension requirement before adding an Activity to
a TaskFragment. It'll be early return if the requirement is not
satisfied.
2. Propagate the minimum dimensions to the client side through
TaskFragmentInfo to notify the requirement.
3. If TaskFragmentOrganizer tries to shrink a TaskFragment to
the bounds that smaller than minimum dimensions of its children
Activity, switch to match the parent bounds.
AndroidX Window extensions:
1. Early return if TaskFragment is resized to the bounds that smaller
than minimum dimensions which dispatched from the server side.
2. When organizer tries to show Activities side-by-side, verify if
minimum dimensions requirement of the primary Activiy. If the
requirement is not satisfied, show Activities in fullscreen
instead.
TODO: Add an API to check if an Activity intent is allowed to embed
in a TaskFragment.
Bug: 232871351
Test: atest TaskFragmentOrganizerControllerTest
Test: atest TaskFragmentOrganizerTest TaskFragmentOrganizerPolicyTest
Test: atest SplitActivityLifecycleTest
Test: atest CtsWindowManagerJetpackTestCases
Test: atest WmJetpackUnitTests
Change-Id: Ib46c2cec2a0735b9e3f3420f2cb94754801b86b9