Commit Graph

331 Commits

Author SHA1 Message Date
Hongwei Wang
827556ca5a Merge "Fix the transition from Split to PiP" into sc-v2-dev am: 54fed092f8 am: df3e2e6be8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16418705

Change-Id: I3f1abb78032b7edae240827ae456722a41bb3479
2021-12-10 09:01:08 +00:00
Hongwei Wang
d4848611d2 Fix the transition from Split to PiP
- Do not bring split to top on entering PiP
  When swiping up to home (or other cases) triggers one of the
  split-screen children enters PiP, do not try to bring the other task
  to top since the pair should be considered invisible.
- When entering PiP from split screen or non-auto PiP case, use the
  alpha information in PictureInPictureSurfaceTransaction to hide the
  task which would later be turned back on to avoid flicker.

Bug: 190855091
Bug: 205894095
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/42RWtayanp2qG0mHSf4Q5
Test: manual, enter PiP from split-screen, see Video
Change-Id: I1559748cd583c20d79ee458822d66e7801733d3a
2021-12-09 21:07:45 -08:00
Evan Rosky
95cd24e26e Add support for launching a shortcut in WindowContainerTransaction
Some shell actions require the ability to launch a shortcut either
in a transaction and/or with other window operations (eg. Bubbles
and Split-screen).

This required changes to LauncherAppsService to support forwarding
the caller information internally from systemserver.

Bug: 209073176
Test: existing LauncherAppsService tests still pass
Change-Id: I11893abca24cab0b899c3385af0ca46932bcc9e3
2021-12-09 13:09:54 -08:00
TreeHugger Robot
02751aec1c Merge "Allow checking if an activity is organized" into sc-v2-dev am: 2176d951d0 am: 732d80927d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16186763

Change-Id: Ia7c9abe2ee40f3ddaa0d078148bb8d3a32297d3e
2021-12-08 15:25:34 +00:00
TreeHugger Robot
2176d951d0 Merge "Allow checking if an activity is organized" into sc-v2-dev 2021-12-08 15:18:29 +00:00
Andrii Kulian
bf54c4ad74 Allow checking if an activity is organized
Adds an interal method to check if an activity is being organized
by any process. This can be used by WM Jetpack Extensions APIs to
inform apps about their activities being embedded.

Bug: 204399167
Test: Manual, using demo app
Change-Id: I3a0ad021ad43c97bf9b92df05e9858aae143f62b
2021-12-08 17:29:34 +08:00
Wei Sheng Shih
611d320a39 Merge "Provide default splash screen style for Launcher and SystemUI." into sc-v2-dev 2021-12-08 03:55:35 +00:00
TreeHugger Robot
c70c6a1770 Merge "Move adjacent tasks forward together to ensure occluding state" into sc-v2-dev am: 642ead3a05 am: 46be27b4eb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16220664

Change-Id: Ie9bf6943cfc218a2c7845ce13241eaf854e07301
2021-12-02 09:04:57 +00:00
Jerry Chang
99702662ed Move adjacent tasks forward together to ensure occluding state
In multi-window split, if one of the adjacent task are moved to front,
we need to move another one forward to ensure all the other tasks will
be occluded by these adjacent tasks as expectedly. Add a flag to
distinguish whether to move the adjacent tasks together when setting
adjacent tasks.

Fix: 204130085
Test: atest TaskTests
Test: atest WMShellUnitTests
Change-Id: I34ccd2633b23425a978bd3df4acc50f17323de21
2021-12-02 11:25:22 +08:00
TreeHugger Robot
60e51c5c22 Merge "Adding system window flag in DWPC" 2021-12-01 03:51:25 +00:00
wilsonshih
44f5e52d53 Provide default splash screen style for Launcher and SystemUI.
Previous the splash screen style can either be EMPTY or ICON, and need
to be set by new hidden API #setSplashscreenStyle, so the flag will
always be "EMPTY" for those 3rd party Launcher Apps which may have not
upgrade to targetSDK 31.
To correct the default behaivor for Launcher Apps, create a new
UNDEFINED style as default value for splashScreenStyle, and if the
value is UNDEFINED, determine the style by checking the launch source.

Test: Verify no change when default home is NexusLauncher.
Test: Set 3rd-party Launcher as default home, verify the splash screen
style should be ICON when launch app from Launcher.
Test: atest SplashscreenTests
Bug: 206746601

Change-Id: I105e2fcfc7a6ee8de7f442931cbeb4b6e517850d
Merged-In: I105e2fcfc7a6ee8de7f442931cbeb4b6e517850d
2021-12-01 01:40:11 +00:00
Chilun
997c321dcd Adding system window flag in DWPC
Since there are some system flags we care about, add mSystemWindowFlag
for DWPC determination.

Bug: 201712607
Test: manual
Change-Id: I7dd75e612cacfe91d340324083705e80ce9bd112
2021-11-29 17:25:31 +08:00
wilsonshih
a19270f278 Provide default splash screen style for Launcher and SystemUI.
Previous the splash screen style can either be EMPTY or ICON, and need
to be set by new hidden API #setSplashscreenStyle, so the flag will
always be "EMPTY" for those 3rd party Launcher Apps which may have not
upgrade to targetSDK 31.
To correct the default behaivor for Launcher Apps, create a new
UNDEFINED style as default value for splashScreenStyle, and if the
value is UNDEFINED, determine the style by checking the launch source.

Test: Verify no change when default home is NexusLauncher.
Test: Set 3rd-party Launcher as default home, verify the splash screen
style should be ICON style when launch app from Launcher.
Test: atest SplashscreenTests
Bug: 206746601

Change-Id: I105e2fcfc7a6ee8de7f442931cbeb4b6e517850d
2021-11-29 11:15:09 +08:00
Charles Chen
8fccb13a1f Merge "Associate SystemUiContext with DisplayContent" 2021-11-25 07:14:37 +00:00
Charles Chen
46ffd51d07 Associate SystemUiContext with DisplayContent
Before this CL, SystemUiContexts were fixed to the Display metrics
when the SystemUiContexts were created. It is the same mechanism
as DisplayContext but applies to SystemUiContexts unexpectedly.
This CL makes SystemUiContexts associate with DisplayContent with
the corresponding display ID. In this way, SystemUiContext would
receive updates when there is a Display property change.

Bug: 194262507
Bug: 191064581
Bug: 205859784
Test: atest InputMethodMenuControllerTest WindowContextControllerTest
Test: atest NexusLauncherTests

Change-Id: I64a1614f32d097785915f6105b1813a929e0fe32
2021-11-23 13:10:01 +00:00
Chris Li
df9253425c Merge "Remove TaskFragmentAppearedInfo" into sc-v2-dev am: 552551dd3d am: bea0c7d5fc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16303819

Change-Id: I247d75636a06a229f211318559cd6c230e6f0d22
2021-11-23 03:27:03 +00:00
Chris Li
552551dd3d Merge "Remove TaskFragmentAppearedInfo" into sc-v2-dev 2021-11-23 03:09:49 +00:00
Chilun Huang
ace875a951 Merge "Introduce DisplayWindowPolicyController for display across devices" 2021-11-23 02:55:13 +00:00
Chilun
f068982d86 Introduce DisplayWindowPolicyController for display across devices
A controller to control the policies of the windows that can be
displayed on the virtual display.

Also migrate task event callbacks.

Bug: 201712607
Test: manual
Change-Id: I4accd76beda6829cd1b33ad50c0860405ae10678
2021-11-22 15:11:03 +08:00
Chris Li
d45dba76ac Remove TaskFragmentAppearedInfo
We don't really have any use case to manipulate TaskFragment leash, and
removing it can reduce chance for related security issue.

Fix: 207061678
Test: pass existing
Change-Id: I24617228991f030335ba74ce7c2ee48b9c33b9d6
2021-11-19 12:42:37 +08:00
Charles Chen
082403816a [RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent
Before this CL, SystemUiContexts were fixed to the Display metrics
when the SystemUiContexts were created. It is the same mechanism
as DisplayContext but applies to SystemUiContexts unexpectedly.
This CL makes SystemUiContexts associate with DisplayContent with
the corresponding display ID. In this way, SystemUiContext would
receive updates when there is a Display property change.

Bug: 194262507
Bug: 191064581
Bug: 205859784
Test: atest InputMethodMenuControllerTest WindowContextControllerTest
Test: atest NexusLauncherTests

Change-Id: I64a1614f32d097785915f6105b1813a929e0fe32
2021-11-18 22:44:59 +08:00
Romica Iordan
f68fbed311 Enable vendors to organize ImeContainer
Add FEATURE_IME as unique id for ImeContainer to organize it from
WmShell.
Disable automatic ImeContainer surface and container reparenting when
it is organized.

These changes enable vendors to control where the IMEs are positioned
and implement custom UX rules (e.g. for foldable devices - place the
IME on the bottom screen while the focused app is on the top one).

Manual test:
Organize FEATURE_IME from WmShell.
Set its bounds, appBounds, screenSizeDp and setSmallestScreenWidthDp.
Outcome:
* The IME receives onConfigurationChanges.
* The IME is updated on the screen.
* The IME is not reparented from its default parent.

Test: atest WmTests:WindowProcessControllerTests
Test: atest WmTests:DisplayContentTests
Test: atest WmTests:WindowContainerTests
Test: atest WmTests:DisplayAreaTest
Test: atest WmTests:DualDisplayAreaGroupPolicyTest
Bug: 188038793

Change-Id: I438253e9647ceab5b7847b8db66db8399271723f
2021-11-18 03:53:40 +00:00
Alex Chau
442ba5476d Merge "Add letterboxInsets to TaskSnapshot" into sc-v2-dev 2021-11-16 18:40:31 +00:00
TreeHugger Robot
60422ba05a Merge "Revert "[RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent"" into sc-v2-dev 2021-11-11 14:13:01 +00:00
Alex Chau
930739c45a Revert "[RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent"
This reverts commit 71b2172abc.

Reason for revert: See b/205859784, breaks launcher tests
Bug: 205859784
Bug: 194262507
Bug: 191064581

Change-Id: Iaac32bd4142c0539300725dc2f6e4255fefc8b2f
2021-11-11 10:09:10 +00:00
TreeHugger Robot
5b210b31f0 Merge "[RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent" into sc-v2-dev 2021-11-10 07:47:53 +00:00
Charles Chen
71b2172abc [RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent
Before this CL, SystemUiContexts were fixed to the Display metrics
when the SystemUiContexts were created. It is the same mechanism
as DisplayContext but applies to SystemUiContexts unexpectedly.
This CL makes SystemUiContexts associate with DisplayContent with
the corresponding display ID. In this way, SystemUiContext would
receive updates when there is a Display property change.

Bug: 194262507
Bug: 191064581
Test: atest InputMethodMenuControllerTest WindowContextControllerTest

Change-Id: Idd74da965c18bdbf8912bd45e89be21f652dcf93
2021-11-10 14:19:53 +08:00
Shivam Agrawal
993f30872f Update toString methods for various Embedding... am: d6cf8c85ac am: 3c32c63356
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16133687

Change-Id: Ia42bbf2880d42cbaae2cac02e8cf203cbf20e766
2021-11-10 03:55:14 +00:00
Shivam Agrawal
d6cf8c85ac Update toString methods for various Embedding...
...Reference Implementation classes

Bug: b/204193051
Test: manual
Change-Id: I79e94feb002dadc2219ccc7604843a3c61b91057
2021-11-09 09:38:45 -08:00
Alex Chau
2dcd8f56c1 Add letterboxInsets to TaskSnapshot
Bug: 199743725
Test: manual
Change-Id: I7daa01d7e6d2df2bc1b85d12004e7927d61d0e03
Merged-In: I7daa01d7e6d2df2bc1b85d12004e7927d61d0e03
2021-11-09 11:03:32 +00:00
Alex Chau
d46b321e5f Add letterboxInsets to TaskSnapshot
Bug: 199743725
Test: manual
Change-Id: I7daa01d7e6d2df2bc1b85d12004e7927d61d0e03
2021-11-08 18:40:10 +00:00
Vadim Caen
9b578bf0db Merge "Add details about theme stability" into sc-dev am: 9aff8397c8 am: a35809b1a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16176790

Change-Id: Ibab630d4d88207bdd0ead70916525e49a6c8cd47
2021-11-05 12:26:50 +00:00
Vadim Caen
e37c9cb7ac Merge "Add details about theme stability" into sc-dev am: 9aff8397c8 am: 6814291fde
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16176790

Change-Id: Iba0b6e951ddcb66e0b07014fef389f0ab04c1453
2021-11-05 12:25:36 +00:00
Vadim Caen
a35809b1a4 Merge "Add details about theme stability" into sc-dev am: 9aff8397c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16176790

Change-Id: If6793004914e2c8345a1e2e7048675c7e98b4e78
2021-11-05 12:13:55 +00:00
Evan Rosky
7122b1ee6c Merge "Boost remote-transition animator processes during animation" into sc-v2-dev am: 62924f1213 am: be5ed6365b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15632613

Change-Id: Ie2ca96fd1a670f749a131d43f5177a7ec6412f0b
2021-11-03 21:12:04 +00:00
Evan Rosky
62924f1213 Merge "Boost remote-transition animator processes during animation" into sc-v2-dev 2021-11-03 20:59:07 +00:00
Vadim Caen
180d2613e1 Add details about theme stability
Fixes: 186611969

Change-Id: Ie537eb3b73f5b440aa3da507a769e4ba26ea1cd0
2021-11-03 10:21:35 +00:00
Wu Ahan
807047352c Merge "Instrument jank of splash screen AVD and exit animation" into sc-v2-dev am: 43f59bb11b am: d9dd71a4d7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16084829

Change-Id: I04e420e50cb9895f9f8ca181cc5ecbc2750bb2fd
2021-11-03 03:08:35 +00:00
Evan Rosky
7ba314d658 Boost remote-transition animator processes during animation
This basically ties applicationthread binder token to remote
transitions. Shell is first boosted (to run the shell transition
logic) and if it then delegates to a remotetransition, it will
then request that process also be boosted.

Bug: 183993977
Test: add logging in WPC.setRunningRemoteAnimation and verify calls
      during transitions
Change-Id: I94babc327e935ea81271942287a83b948dd11f8b
2021-11-01 16:54:26 -07:00
Wu Ahan
61cd0b63c4 Instrument jank of splash screen AVD and exit animation
Add jank instrument support for splash screen avd and exit animation.

Bug: 195736656
Test: see trace in comment
Change-Id: I1fdb9e14145bcf519eea99e440de74238e3c765c
2021-10-25 03:56:42 +00:00
TreeHugger Robot
7a2a03904b Merge "Migrate screen rotation latency tracker with shell transition" into sc-v2-dev am: a18b8a827e am: 672bcfb0dd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16017068

Change-Id: I93ebd8401de45b3cacf19d301dff50782982d421
2021-10-20 02:39:31 +00:00
Riddle Hsu
9cb2c66248 Migrate screen rotation latency tracker with shell transition
It was done by WMS#startFreezingDisplay~stopFreezingDisplayLocked.
The duration is measured from rotation change to start animation.

Add a remote callback to know when the rotation animation is started.
So WM core can have the paired begin/end of trace that matches the
latency exactly.

The added ITransitionMetricsReporter is available for any processes.
So in the future it can also report the metrics from remote animator.
This change focuses on the rotation animation handled by shell.

Bug: 199836343
Test: adb shell setprop persist.debug.shell_transit 1; reboot
      Rotate display and check trace "L<ACTION_ROTATE_SCREEN>".
Change-Id: I180d2fe1a77e98b6427ba831a2db2593739376bd
2021-10-19 19:02:38 +08:00
Tony Huang
ab233079f5 Merge "Make split screen only reparent top task" into sc-v2-dev am: be0c2bdc92 am: 93083fa0a7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15937026

Change-Id: I0375cd74189783fcd9b94d526c42ee69b55dde7e
2021-10-15 09:48:17 +00:00
Josh Yang
a70e769e93 Merge "Draw splash window during app switch if the top activity is not drawn." 2021-10-14 17:37:58 +00:00
Tony Huang
62c6c83f57 Make split screen only reparent top task
Follow latest split screen UX model, it should only reparent
the top task to split for app-pair model.

Fix: 201480664
Bug: 202740040
Test: manual
Test: pass existing tests
Change-Id: I4b360a31ce8e7366a77216a94b5f1b19bba848e9
2021-10-14 15:37:00 +08:00
Josh Yang
f2142d0f21 Draw splash window during app switch if the top activity is not drawn.
In Wear OS, when the device enters ambient mode, we will switch the front activity to the background. When device exits ambient mode, the previous activity will be moved back to the front. If the activity hasn't been drawn yet when the device enters ambient mode, we want to show the splash window when it's brought back to the front.

Bug: 176837715
Bug: 199552234
Fix: 199552234
Test: manual test
Change-Id: I8275db9cb51575b61f5a4f04316b77e3f53ba220
(cherry picked from commit 3dc923bafc4454490935fd9e6b4b6602a91febaf)
2021-10-08 18:23:59 +00:00
Wei Sheng Shih
9287d3cb2a Merge "Fix snapshot starting window stuck if the task never gain focus" into sc-v2-dev am: e921c7a282 am: 749c45ee1d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15937040

Change-Id: I1a46bdf3cc9aa3734d1f6346f58544b2af0fe382
2021-10-06 05:34:52 +00:00
wilsonshih
379994b4f8 Fixes the flicker when transfer splash screen view to client
Use applyTransactionOnDraw to ensure all transaction happen
during the same frame, including
- hide the starting window.
- reparent the remote SurfaceView to client.

Bug: 198593932
Test: continues launch test app several times then verify with winscope
to ensure there is no flicker anymore.

Merged-In: I03c600afdc477ca0c8064b215f2b361468db9f3c
Change-Id: I03c600afdc477ca0c8064b215f2b361468db9f3c
2021-10-06 11:14:11 +08:00
wilsonshih
9987513af6 Fix snapshot starting window stuck if the task never gain focus
The tasksnapshot starting window could stuck on task if the task never
gain focus, this could happen when launch multiple tasks to front, e.g.
split screen, or add snapshot starting window to a pip task.

As using task focus to judge the task snapshot removal may error-prone.
(i.e. unexpected window focus in/lost, non-focusable task window..)

To ensure the tasksnapshot removal works stable, extanding
MAX_DELAY_REMOVAL_TIME_IME_VISIBLE timeout from 450ms to 600ms and also
reference mayImeShowOnLaunchingActivity to know whether IME showing on
this activity.

Bug: 199377815
Bug: 201264769
Bug: 200778734
Test: atest ActivityRecordTests StartingSurfaceDrawerTests
SplashscreenTests
Test: manual launch apps with IME from Recents.
Test: enter pip, power on/off, verify starting window is removed.
Test: manual enter split screen, verify starting window is removed.

Change-Id: I81b048a655124923a5f19e7f236511502bbf4c91
(cherry picked from commit a4f760bee7)
2021-10-05 20:43:35 +08:00
wilsonshih
74f1d7ba8f Fixes the flicker when transfer splash screen view to client
Use applyTransactionOnDraw to ensure all transaction happen
during the same frame, including
- hide the starting window.
- reparent the remote SurfaceView to client.

Bug: 198593932
Test: continues launch test app several times then verify with winscope
to ensure there is no flicker anymore.

Change-Id: I03c600afdc477ca0c8064b215f2b361468db9f3c
2021-10-05 18:26:51 +08:00