Commit Graph

343 Commits

Author SHA1 Message Date
wilsonshih
bf666289d7 Public API set and get splashscreen style
Allow developer to control the splash screen style when the option is
used for cold or warm launch an activity.

Bug: 203497083
Test: atest SplashscreenTests#testLaunchFromLauncherWithEmptyIconOptions
Test: atest SplashscreenTests#testLaunchAppWithIconOptions

Change-Id: I9c4ccca2470df5dbac96da2d4a96b616b6670688
2022-01-03 20:44:01 +08:00
Pablo Gamito
3447e5cf43 Merge "Add support for WindowAnimationStyle theme attribute in shell" 2021-12-22 12:05:40 +00:00
Pablo Gamito
a4843175bf Add support for WindowAnimationStyle theme attribute in shell
Test: Make sure apps with custom animations set using WindowAnimationStyle actually use the custom animation when shell is enabled

Bug: 206960607
Change-Id: I1d982870837d67c74f76dd0a90aa5260d9441aba
2021-12-21 20:27:20 +01:00
Mariia Sandrikova
d77c92a3f1 Merge changes from topic "camera-compat" into sc-v2-dev am: 3486eacda3 am: 02a17e7b1f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16468379

Change-Id: Ic9916a3883eef0148a86c86149aa2e883fc56d1b
2021-12-18 22:19:12 +00:00
Mariia Sandrikova
3486eacda3 Merge changes from topic "camera-compat" into sc-v2-dev
* changes:
  [3/n] Camera Compat UI: Add a camera compat control.
  [2/n] Camera Compat UI: Add interfaces for client-server communication.
2021-12-18 21:39:13 +00:00
Mariia Sandrikova
24f4d8a952 [2/n] Camera Compat UI: Add interfaces for client-server communication.
Changes:
- Listens to changes from the client coming through IActivityClientController#requestCompatCameraControl to ActivityRecord#updateCameraCompatState
- ActivityRecord#updateCameraCompatState sends updated state via TaskInfo to WM Shell
- ITaskOrganizerController#updateCameraCompatControlState to dispatch the user interactions with the control from WM Shell triggers callback to ActivityRecord#updateCameraCompatStateFromUser
- ActivityRecord#updateCameraCompatStateFromUser remembers the user's choice and asks client to apply treatment through ICompatCameraControlCallback

Feature is guarded with config_isCameraCompatControlForStretchedIssuesEnabled

Test: atest WMShellUnitTests:ShellTaskOrganizerTests, atest WmTests:ActivityRecordTests
Bug: 206602997
Change-Id: I083aa6718bd67456bedd9444e9b78740c041f870
2021-12-17 00:18:57 +00:00
Evan Rosky
9af5b0896f Merge "Hook-up shell-transitions to DisplayChangeController rotation" 2021-12-14 23:51:54 +00:00
Chavi Weingarten
f9c21bbe90 Merge "Add displayInfo to Java WindowInfosListener." 2021-12-14 19:08:50 +00:00
Evan Rosky
c468b590f0 Hook-up shell-transitions to DisplayChangeController rotation
A direct display rotation goes through requestStartTransition
instead of "remote rotation". As a result, we need to hook-up
the handleRequest to shell's displayChangeController so that
other shell components (like task organizers) have a chance
to calculate new bounds for their organized windows.

Bug: 206872147
Test: via logging, ensure that shell DisplayChangingListener
      is fired during a display rotation.
Change-Id: I839ebd28d4947ed3ec41d48724702d035f726f11
2021-12-14 09:32:55 -08:00
chaviw
51db10d931 Add displayInfo to Java WindowInfosListener.
The displayInfo contains information about transform and display size.
This info was not being passed to the WindowInfosListener, making it
difficult to get coordinates on screen.

Send the displayInfo through JNI to the Java side listener

Test: WindowInfosListener gets displayInfo
Bug: 188792659
Change-Id: Ib4fdb6f0c27bd4276421c4a5235c5112514b32f3
2021-12-14 10:02:48 -06:00
Riddle Hsu
9c310ef902 Reduce cost of WindowTokenClient config change am: 778c95ce7c am: b6a1d36a9a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16439833

Change-Id: I419e9c42305f3ad271fcb3f774e12474cdf3baaf
2021-12-13 13:51:18 +00:00
Riddle Hsu
778c95ce7c Reduce cost of WindowTokenClient config change
The SizeConfigurationBuckets was used to avoid activity relaunch
by insignificant configuration change. Because WindowTokenClient
doesn't have relaunch operation, it is unnecessary to use it.
Especially Resources#getSizeConfigurations() is a heavy invocation,
which may create hundreds of temporal Configuration when calling it
in system server.

Also fix leakage of SystemUiContext if it is detached, e.g. the
associated display is removed.

Bug: 207620458
Test: atest WindowContextControllerTest
Change-Id: I8388a2ab25f3deed2e29eb5636c4b2130f4f1b87
2021-12-13 18:52:54 +08:00
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