Commit Graph

362 Commits

Author SHA1 Message Date
Wei Sheng Shih
e8e313d496 Merge "Allow app to receive onSplashscreenExit even for empty splash screen." 2022-01-26 01:33:58 +00:00
Charles Chen
19e1e118e1 Merge "Override (un)registerComponentCallbacks for ContextWrapper" 2022-01-25 14:18:58 +00:00
wilsonshih
946a4063f7 Allow app to receive onSplashscreenExit even for empty splash screen.
Allow developers to customize the exit animation for empty style splash
screen, there is a target sdk version check to prevents apps from
crash if the app didn't do null pointer check for #getIconView.

Bug: 205907456
Test: atest SplashscreenTests
Change-Id: I235f25fdf42b7177a6e195d3ffc07b92690e6f79
2022-01-25 20:40:23 +08:00
Charles Chen
a4059c2f19 Override (un)registerComponentCallbacks for ContextWrapper
Bug: 193247900
Test: WindowContextTest
Test: ContextWrapperTest

Change-Id: Ia070b12eea5631d70a96d6e41d03ab08f6b44caa
2022-01-25 12:30:47 +08:00
Shan Huang
54b9c9d66e Implement OnBackInvokedDispatcher
Bug:209867448
Test: mp core services sysuig. atest FrameworksCoreTests:WindowOnBackInvokedDispatcherTest

Change-Id: Ib74250e93926854f07ebba6b9f680040aa98f9a4
2022-01-23 23:30:37 +00:00
Peiyong Lin
4f8f656dca Merge "Raise SurfaceControlFpsListener to System API." 2022-01-21 20:30:59 +00:00
Vadim Caen
e0b59d46ce Merge changes Ifc2ed99b,Ibd7fc78e
* changes:
  Integration of back gesture animation on Sysui (BackNav 2/n)
  Server infrastructure for back nav animation (BackNav 1/n)
2022-01-21 13:36:58 +00:00
Peiyong Lin
399e06d648 Raise SurfaceControlFpsListener to System API.
Previously the SurfaceControlFpsListener is a hidden API which only
allows platform code access. This patch renames it to follow the
callback convention and raises it to be a system API in order to allow
system applications to access the FPS count of a task and its children.
The FPS count access is guarded by a permission ACCESS_FPS_COUNTER.

To follow the API convention and properly check the permission, the
register/unregister callback APIs are moved to WindowManager and
permission check is done in the System Server.

Minor: Rename to SurfaceControlFpsCallback to TaskFpsCallback in order
to follow the API naming convention.

Bug: b/199920468
CTS-Coverage-Bug: b/199920468
Test: atest TaskFpsCallbackTest
Change-Id: I6b0a0ad6500278b3da09059e9c2ede28d9a743aa
2022-01-21 09:18:08 +00:00
Shan Huang
5b44dd8b79 Merge changes from topic "shanh-back-api"
* changes:
  Provide OnBackInvokedDispatcher from Activity, View and Dialog
  Introduce IOnBackInvokedCallback and OnBackInvokedDispatcher
2022-01-20 07:20:51 +00:00
Shan Huang
c0999600ee Provide OnBackInvokedDispatcher from Activity, View and Dialog
Test: mp core sysuig services
Bug: 195946584

Change-Id: Ia882ec621154ea1daa780c8976b900e4c8f44a7d
2022-01-20 01:33:56 +00:00
Vadim Caen
a4ca5286d2 Server infrastructure for back nav animation (BackNav 1/n)
This CL introduces the BackNavigationController that gathers the
required data to be passed to WMShell to create the back animation

These data are passed via the BackNavigationInfo Parcelable.

The CL also containes a basic screenshoting mechanism as a temporary
solution until a proper screenshoting infrastructure is created
(b/207481538).

Test: atest BackNavigationControllerTests
Bug: 131727607
Change-Id: Ibd7fc78e590794daf35f7718ddfa53e7f439813b
2022-01-18 10:42:21 +01:00
Pablo Gamito
157738c8a0 Support backgrounds during animations in shell
This is required for the go/t-activity-transitions where we want to allow apps to fade to a clear background color and fade back in from the background to another activity

Test: atest FlickerTests
Bug: 202844659
Change-Id: Iea18a8e7d32a63da55ab3430c47f903da5cff807
2022-01-17 13:26:59 +01:00
TreeHugger Robot
c945d14020 Merge "Ask the policy controller for launching activities" 2022-01-15 15:45:14 +00:00
TreeHugger Robot
ea85bfc929 Merge "Fix IME shrunk by WindowTokenClient mis-detach" into sc-v2-dev am: ff6577fd10 am: 4b30a3ee91
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16598426

Change-Id: I7c73497ab7770240e8aadc96c3ef64e5c219cf75
2022-01-15 04:57:51 +00:00
TreeHugger Robot
ff6577fd10 Merge "Fix IME shrunk by WindowTokenClient mis-detach" into sc-v2-dev 2022-01-15 04:27:54 +00:00
Ming-Shin Lu
29de30597b Fix IME shrunk by WindowTokenClient mis-detach
As CL[1] introduced WindowTokenClient for WindowProviderService (aka the
parent class of InputMethodService starts from CL[2]) as a token that
IME context can associate with the windowContainer of
the InputMethod window in server side. Like the activity context,
IME context can adopt configuration/resources update when the IME
window changed by display/window changes.

And, the IME context caller can also create another type of context
with wrapping IME context (i.e. calling createDisplayContext to create
a display context), that makes this context can be mixed the window
token of WindowProviderService since it's the base context.

However, the finalization of the context mixed WindowTokenClient
will detach the token when the attached context type is non-window
context, this action will mis-detach the token when it managed by
WindowProviderService.

So like SoftKeyboard previously using
createDisplayContext in CL[3] to workaround context resources issues,
will in-directly expose this mis-detach token issue as the above.

Beside, the handling of WindowTokenClient#{onConfigurationChange,
onWindowTokenRemoved} does not thread-safe since this is called from
IPC.

As the result, the fix is to ignore the check in ContextImpl#finalize
to not detach the token when it managed by WindowProviderService,
also make sure to post to the main handler when received
onConfigurationChanged/onWindowTokenRemoved in WindowTokenClient.

Note that this fix could help to resolve "The Window Context should
have been attached to a DisplayArea." exception if the token has been
detached as the above case that happens before the next
WindowProviderService#attachToWindowToken invoked.

[1]: I64a1614f32d097785915f6105b1813a929e0fe32
[2]: Ie565e30ed5dd3f2cfe27355a6dded76dc3adc14b
[3]: Ic592a1d2fb2da149220c8b503b522b3e864bcc77

Bug: 213118079
Bug: 211062619
Test: manual as steps:
1) adb install -r EditTextVariations.apk
2) adb install -r SoftKeyboard.apk
3) adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
4) adb shell ime set com.example.android.softkeyboard/.SoftKeyboard5
5) Enable screen auto-rotation
6) Launch EditTextVariations from launcher's shortcut
7) Tap the first EditText field to show IME
8) Rotate the device to the landscape mode
9) Expect the IME should not be shrunk

Change-Id: I7beb7a122af93e596239a36db62073233cea0726
2022-01-14 12:49:13 +00:00
Chilun
1cb6152895 Ask the policy controller for launching activities
Ask the policy controller whether an activity can be displayed on the
virtual display when it is going to launch or reparent.

Also notify the policy controller the activity changes on the virtual
display.

Bug: 201712607
Test: atest DisplayWindowPolicyControllerHelperTests
      atest ActivityRecordTests
      atest ActivityTaskSupervisorTests
      atest TaskTests
      atest TaskFragmentTest
      atest WindowManagerServiceTests

Change-Id: I11fcc38782b21ccb2f0474777242dbf5901c59e1
2022-01-14 10:51:40 +08:00
Mariia Sandrikova
7617679a61 DO NOT MERGE Revert "[2/n] Camera Compat UI: Add interfaces for client-server..."
Revert submission 16468379

Reason for revert: Feature development is moving to T.

Reverted Changes:
Id9b9a8930:[3/n] Camera Compat UI: Add a camera compat contro...
Id6be4a954:Enable a camera app compat control on Large screen...
I083aa6718:[2/n] Camera Compat UI: Add interfaces for client-...

Bug: 206602997

Change-Id: I9ad876043fd61f708a8f468fffd1ef371bfa0866
2022-01-13 15:21:38 +00:00
Jason Chang
f25e1e90c2 (1/n) Phase out FEATURE_ONE_HANDED_BACKGROUND_PANEL
Remove DisplayArea feature FEATURE_ONE_HANDED_BACKGROUND_PANEL
We are going implement One handed panel throught
WindowlessWindow mechanism instead.

Bug: 197165590

Test: manually test One-handed mode basic operations.
Test: atest WMShellUnitTests
Change-Id: I3ba106a266e69bf61cdd43c0043852eed14dc365
2022-01-11 23:57:53 +08:00
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