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
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.
Bug: 240519866
Test: pass existing
Change-Id: 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
- 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