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
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
- Also add setAlwaysOnTop API in WindowContainerTransaction.
Bug: 188102153
Test: atest DisplayAreaTest
Test: Tested manually by setting it on DisplayAreas
Change-Id: I683e3c6bdf1bb6a590829a197f5dbef2c171d7e9
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
AttachedSurfaceControl is a public API so hidden APIs need to be
implemented. Create a default implementation for a new hidden API to
ensure backwards compatibility.
Test: testRuntimeCompatibilityWithCurrentApi_android_net_ipsec_ike
Fixes: 240300753
Change-Id: I4aec403e4bc13e2db902a291f1e42d8fe3d8fdf3
There's no need for SurfaceSyncer to store the SyncSets and only return
a syncId. The callers can instead own the SyncGroups and call methods
directly on them. This makes the code more readable and cleans up Syncer
since you can directly call methods instead of piping through an outer
method.
Test: SurfaceSyncGroupContinuousTest
Test: SurfaceSyncGroupTest
Change-Id: I82976e26e10e20d2752e6be24a45069a6a64e849
Bug: 237804605
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.
Bug: 236668365
Bug: 233989810
Test: atest TaskFragmentTest
Test: atest TaskFragmentOrganizerControllerTest
Test: atest TaskFragmentOrganizerTest
Test: atest TaskFragmentOrganizerPolicyTest
Change-Id: Id328d037536d32b3acb9c424d36052b6dca8628a
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)
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
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