Commit Graph

117 Commits

Author SHA1 Message Date
Adrian Roos
c042e7c643 API: Suppress existing NullableCollections lints (TaskOrganizer)
Bug: 152525509
Test: make checkapi
Change-Id: I5ce70d3e622fcdd13d63d47bf483507378a60e16
2021-02-01 15:13:51 +00:00
Evan Rosky
27923b5a68 Merge "Add support/adapter for recents animation via shell transition" 2021-01-26 00:29:40 +00:00
Wale Ogunwale
f84a471b02 Fixed some bugs with main/side stage splits
- Dragging to right to dismiss no working.
- Dragging to left to dismiss closes all apps
- Not able to put app in split after left drag to dismiss
- Pressing back on last activity in one split dismisses both.
- Don't move home task forward when startActivityFromRecents with launch
root set.

Fixes: 176061049
Test: they pass!
Change-Id: Ic1219b747e995ee8833b31433356bd44435118da
2021-01-25 10:51:58 -08:00
Evan Rosky
710ff71169 Add support/adapter for recents animation via shell transition
This does the basics to adapt recents animation to shell transition.

Replaces startRecentsActivity with a normal startActivity. Once
we make a full switch to shell transitions, we can hopefully remove
it.

Updates the TransitionHandlers in shell and RemoteTransitions to
support attaching a WindowContainerTransaction to a transition's
finish. For recents, this is used to move the "pausing" app (the
one getting animated into the recents carousel) back to the front
if the gesture doesn't go all-the-way into recents.

Bug: 162503077
Test: enable shell transit. launch an app, use gesture to open
      recents. use gesture to start going to recents, but then
      release early to return to the app.
      atest ShellTransitionTests
Change-Id: Ied54f1b2c70c5c129b2f5798117d6d8a85360998
2021-01-22 13:43:55 -08:00
Wale Ogunwale
c04c4c1098 WindowContainerTransaction for setting adjacent roots
Ability to specify that 2 root tasks are adjcent there by allowing them
to occlude their parent. Similar to how the legacy primary/secondary
split windowing modes are used to occlude their parent.

Also, occlude parent if a child in multi-window mode as a matching
bounds.

Bug: 177166639
Test: AppConfigurationTests#testSplitscreenPortraitAppOrientationRequests
Change-Id: I7d54bfa188700a76b0bca911d2011123c21553ad
2021-01-20 06:37:04 -08:00
Evan Rosky
30f3544f65 Add support for remote transition playback in shell transitions
This adds IRemoteTransition interface for other processes (like
launcher) to register for playing transition animations.

Then there are 2 supported ways to "register":

1. Is to attach an IRemoteTransition to ActivityOptions. To
   support this pathway, requestStartTransition now takes a
   TransitionRequest object which can contain whatever info
   is needed at the time. One piece of that is the passed-in
   IRemoteTransition.

2. Is to register directly with shell (via systemuiproxy for
   now) with a TransitionFilter. This filter allows shell
   transitions to dispatch a transition to a remote without
   need to make queries over binder.

This also hooks up launcher animations by converting the new
transition info to the old RemoteAnimationTargetCompat stuff.

Bug: 169035082
Test: launch app from launcher and observe the icon animation.
      atest ShellTransitionTests
Change-Id: I8014a6f46cffda3a48a1a4ae101e2643078f4a14
2021-01-14 14:50:51 -08:00
Wale Ogunwale
b71323aa91 Support WCT#reparentTasks and WCT#setLaunchRoot
Allows for bulk reparenting of tasks from one container to another and
also setting launch root in the same call to wm-core.

Bug: 175416931
Test: CTS and split-screen tests pass!
Change-Id: I362f89bc0ccc14e4152a2040a7198fd542ffe4d5
2021-01-11 20:46:36 -08:00
Jason Chang
21538ffb10 Merge "Fix after turning the Dark theme on, users can not clearly identify the screen has entered one handed mode" 2021-01-11 08:44:25 +00:00
Jason Chang
7e8e7441ee Fix after turning the Dark theme on, users can not clearly identify
the screen has entered one handed mode

Add a new DisplayArea feature color background layer to fix it.

Bug: 157124724

Test: manual
Test: atest WMShellUnitTests
Test: atest DisplayAreaPolicyBuilderTest
Change-Id: I16beddb182125551621d0083dba2f259140d7b78
2021-01-11 13:45:31 +08:00
Evan Rosky
68fbb47250 Basic support for split-screen in new transition system
Sends the "trigger" taskinfo associated with a transition when
applicable. This can be used by the transitionplayer to make
decisions about how to start and play transitions.

Additionally, TaskInfo is provided in each Change object if
they are tasks. This provides all the information needed to
choose how to handle split.

Shell's transitionplayer makes use of this to add support for
"handlers" to deal with specific transition requests. Currently
a single handler is added to process split-screen transitions.

Bug: 169035082
Test: Use split-screen (enter, exit via swipe up/down,
      exit via dismiss top)
Change-Id: I53a03dd85cb260505e66d5d87a34afa4ab1f8cc8
2021-01-07 13:45:24 -08:00
Evan Rosky
c08017775a Merge "Add per-change flags and wallpaper windows to transitions" 2021-01-07 18:15:56 +00:00
Tiger Huang
335d657422 Merge "Send display cutout to client via insetsChanged" 2021-01-06 06:52:31 +00:00
Evan Rosky
dba8bbfd5e Add per-change flags and wallpaper windows to transitions
This CL adds flags per-change in a transition so that
extra meta-information (like is-wallpaper, shows-wallpaper,
translucent, starting-window-transfer) can be passed to
shell.

This then treats wallpaper like other activities WRT to
transitions (collect/send to shell) except for a couple
differences:
1. When any window is collected, if it shows wallpaper, then
   the wallpaper will be automatically collected too.
2. During TransitionInfo construction, wallpaper containers
   are excluded from promotion and root-leash calculation.

This also adds starting-window transfers to the transition
and adds support in the example player.

Bug: 169035082
Test: launch any non-wallpaper app (eg. messages), then press
      home-button to bring home to front. The wallpaper should
      be included with the home fading-in.
Change-Id: I7ceea614e16c2686f533937db10436f66764255e
2021-01-05 17:36:03 -08:00
Tiger Huang
ec1a69e87c Send display cutout to client via insetsChanged
Since the display cutout is a type of insets and the display cutout can
be obtained from WindowInsets, it makes sense that InsetsState has the
display cutout instance. In this way, we can send the display cutout to
client via W#insetsChanged instead of W#resized.

This can be a step to remove the class of ClientWindowFrames, and can
also be a step to make client compute its window frame locally.

Fix: 175858810
Bug: 161810301
Test: atest WindowAddRemovePerfTest ImeInsetsSourceConsumerTest
            InsetsControllerTest InsetsStateTest ViewRootImplTest
            WindowInsetsControllerTests ActivityRecordTests
            DisplayPolicyLayoutTests LaunchParamsControllerTests
            TaskSnapshotSurfaceTest WindowMetricsActivityTests
            WindowMetricsWindowContextTests WindowMetricsTest
            WindowFrameTests WindowStateTests WmDisplayCutoutTest
Change-Id: I9a930b1d2f7df3cea2b29629b767a4a5f31bca17
2021-01-05 22:22:38 +08:00
Ming-Shin Lu
d579c94480 Better IME transition while switching app with recents (3/N)
- Add hasImeWindowSurface in TaskSnapShot
- Add InsetsSourceControl#getAndClearSkipAnimationOnce for skiping
      IME showing animation once when starting window with IME surface

Bug: 166736352
Bug: 153145997
Test: manual as below steps
    0) Enabling developer options -> Quick settings developer tiles ->
       Window animation scale to slow down transition animation.
    1) Launch an app with focusing an editor to show soft-input
    2) Swipe out app task to back to launcher
    3) Using quick switch or taping shortcut to bring back the app task
    4) Verify that should be no IME showing animation happens during
       task transition.

Change-Id: I83ffc03119e01da71ad12f8ad8043cf0730dfd50
2020-12-28 22:15:12 +08:00
Chris Li
713bf48ddf Merge "Allow TaskDisplayArea to have TaskDisplayArea children (4/n)" 2020-12-21 21:12:31 +00:00
Chris Li
b38c55063e Allow TaskDisplayArea to have TaskDisplayArea children (4/n)
- Create TaskDisplayArea in another TaskDisplayArea through
DisplayAreaOrganizer
- Store the TDA organizer in mOrganizersByFeatureIds

Bug: 175136051
Test: atest WmTests:DisplayAreaOrganizerTest
Change-Id: Iafb7737f269e97ac46e6c7be543564f44ef13d97
2020-12-16 23:26:17 -08:00
wilsonshih
285feba168 Mirror TaskSnapshotSurface to WMShell(2/N)
- Let WMShell able to draw task snapshot surface.
- Create new class StartingWindowInfo to pass needed data from WM to
Shell.
- Rename TaskSnapshotSurface -> TaskSnapshotWindow in WMShell.
- Mirror and modify a new TaskSnapshotWindowTest in WMShell.

Bug: 131727939
Test: atest WindowOrganizerTests ActivityRecordTests
TaskSnapshotWindowTest StartingSurfaceDrawerTests
Test: build and flash, check shell able to show/remove
TaskSnapshotWindow

Change-Id: I70dec8ce2bf1ed7d876657324e51357690c8b396
2020-12-17 11:00:07 +08:00
Ming-Shin Lu
460e9b6bce Merge "Move TaskSnapshot into android.window package" 2020-12-16 05:48:03 +00:00
Wale Ogunwale
1bf5680b38 Added support for RootTaskDisplayAreaOrganizer
Allows shell to have information on the parent container for tasks so it
can do things like attach other surfaces to it. E.g. split-screen
divider.

Also, have DisplayAreaOrganizer ctor take an executor so incoming calls
from the binder threads can be posted to the main thread.

Bug: 175416931
Test: They pass!
Change-Id: Ia3d0b978cf43badd8c495b75708aa027fe9a2aa1
2020-12-14 11:36:44 -08:00
Ming-Shin Lu
b6c4b82ebf Move TaskSnapshot into android.window package
Bug: 166736352
Test: build pass
Test: atest CtsWindowManagerDeviceTests
Change-Id: I7f03524f018ceb64c109fd9d78abeb0ea98b6ea5
2020-12-13 15:28:56 +00:00
Mady Mellor
c6eec7e57f Merge "Use shell executor for TaskView" 2020-12-11 03:38:29 +00:00
Evan Rosky
cf45363705 Merge "Some cleanup/rearrangement of shell transitions things" 2020-12-10 20:37:51 +00:00
Mady Mellor
6673b31638 Use shell executor for TaskView
Bug: 161980186
Test: atest TaskViewTest
Change-Id: I85764463ada847e2f0c8e82c5744212ee8bb2a9d
2020-12-10 12:19:09 -08:00
Evan Rosky
b6569a04c3 Merge "Handle keyguard occlude/unocclude in shell transitions" 2020-12-10 20:02:14 +00:00
Evan Rosky
c5b5c7611f Some cleanup/rearrangement of shell transitions things
Some stuff changed underneath, so we can do a little bit
of housekeeping

Bug: 169035082
Test: nothing changed
Change-Id: I70c668d5760cd6fb9ddfd56720e0b712bd7520fc
2020-12-10 10:36:45 -08:00
Jeff Sharkey
0ab7007631 resolve merge conflicts of 358f0d4fc8 to master
Bug: 174932174
Test: I solemnly swear I tested this conflict resolution.
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Change-Id: I9262a08ffc1ccede8e519d0eed90ed2bfcf0232c
2020-12-08 11:01:05 -07:00
Jeff Sharkey
9af6ac78b0 Merge changes from topic "dec5" am: c2793cf12b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519384

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifdc390f5ae046c515a30158f3f55b831be147547
2020-12-08 16:05:11 +00:00
Jeff Sharkey
52b9862f87 Improve OWNERS coverage across frameworks/base/.
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.

Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas.  Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:

-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage

Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance.  With this extensive
effort, we've now improved our coverage as follows:

-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage

This specific change is automatically generated by a script that
identifies relevant "include" directives.

Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
Change-Id: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
2020-12-08 08:36:28 -07:00
Evan Rosky
58d6cd504d Handle keyguard occlude/unocclude in shell transitions
Turns out this can just be checked when the transition starts.
However, added a flag so that shell knows.

Bug: 162500279
Test: enable shell transitions, lock screen, then open camera and
      close camera.
Change-Id: I57703ed8040172496f7091cdae11489df8724c53
2020-12-07 18:33:22 -08:00
Winson Chung
94132e14a9 1/ Initial preparation for separate shell main thread
- Add @BinderThread/@ShellMainThread/@SysUIMainThread annotations
  for some common shell classes and callbacks
- Add mechanism to inject shell-anim/shell-main/sysui-main/etc
  executors (removed AnimationThread static instance)
(Note: The shell main thread will still be the sysui main thread)

Bug: 161979899
Test: atest WMShellUnitTests

Change-Id: I4adfeaebe5b79fab7c9451eef7b54fcdf4d8d40a
2020-12-03 10:42:48 -08:00
Evan Rosky
9ca6b44136 Merge "Calculate and provide more info necessary for animations" 2020-11-26 00:05:19 +00:00
Chris Li
dfeeea1b82 Add API to create new TaskDisplayArea at runtime
Allow DA organizer to create new TaskDisplayArea.

Fix: 173455508
Test: atest WmTests:DisplayAreaOrganizerTest
Change-Id: I7d4e88f43ae14561720c6942ca0e9f82dc28e9f6
2020-11-20 11:51:17 -08:00
Evan Rosky
8cfc4c2b64 Calculate and provide more info necessary for animations
This adds relative offsets so that animating surfaces can
be reparented with the knowledge of how to position them
within their new parents.

This also creates a "rootleash" which serves as a place for the
transition player to put animating surfaces into where they
can all be siblings. This provides control over z-ordering
during the animation and removes relative cropping
constraints. This rootleash surface is a child of the
deepest container that is an ancestor to all animating
targets. It's layer is picked to be the top-most(z) of the
ancestor's direct children which contains animating
targets.

This then Updates the example transition in shell to use
the rootleash.

Bug: 169035082
Test: atest TransitionTests
Change-Id: If40872138cbb6087b46be4a93c298bad94e88ca1
2020-11-18 13:00:13 -08:00
Evan Rosky
6510883d40 Merge "Relocate transition collection around lifecycle events (1/N)" 2020-11-17 23:24:22 +00:00
Evan Rosky
738ba5601f Relocate transition collection around lifecycle events (1/N)
Previously was just using whatever the legacy transition system
used. However, that system would wait too late (until after
round-trips to the client) in order to prepare some transitions.
Since the new transitions utilize "snapshots", they need to
collect earlier in the lifecycle to work properly.

This first CL deals mostly with activity start/finish and
task to-front/to-back. It also adds some utilities like the
ability to abort a transition (needed because activitystarter
works this way) and the ability to un-ready a transition/
sync transaction to enable trampolines.

This also switches the transit types to the new constants.

Bug: 169035022
Test: Existing tests (TransitionTests) pass
Change-Id: I05f3a2e8e27ccaed7077d648daf033aeabc333f9
2020-11-17 12:56:30 -08:00
Chris Li
6ba5a463e0 Reparent IME container to the root of the IME target window
Reparent IME container so that it's bounds and config will be updated to
match the RootDisplayArea.

Bug: 156355859
Test: manual: test with dual display policy
Change-Id: Ia9c4f6c73c2a6b8ecbf2cd9f6feb39967ebff80c
2020-11-16 21:53:01 -08:00
shawnlin
8dd26b237d Support hide display cutout with display area
- Added a new DisplayArea feature for hide display cutout
- Added a new config for enable/disable hide display cutout
- Resize and shift display areas to exclude the cutout areas.
- Force dark status bar when there is a cutout area at top
- Update bounds & offsets for different rotations.

Bug: 157388722
Test: atest HideDisplayCutoutControllerTest
      atest HideDisplayCutoutOrganizerTest
      atest WMShellTest
Change-Id: Iad2c8b1eff1ea4523f8a7e362c9e851d8594141c
2020-11-11 19:40:57 +08:00
wilsonshih
c1c4c5a661 Delegate splash screen starting window to SystemUI(1/N)
Mirror PhoneWindowManager#addSplashScreen to StartingSurfaceDrawer,
which make WMShell able to draw the splash screen starting window.

- Use StartingSurfaceController#DEBUG_ENABLE_SHELL_DRAWER to switch
drawer when developing this feature.

- Temporarily put StartingSurfaceDrawer in ShellTaskOrganizer, the
drawer should be controlled by a controller which should be create
while porting ActivityRecord#addStartingWindow to Shell.

Ref doc: go/delegate_starting_window

Bug: 131727939
Test: atest AppWindowTokenTests WindowOrganizerTests ActivityStackTests
Test: atest WMShellTest ShellTaskOrganizerTests
StartingSurfaceDrawerTests
Test: check from winscope that the splash screen window can
attach to/detach from the ActivityRecord.

Change-Id: I6dfc9ff75807e2f9479149d14f219c91a6527393
2020-11-10 15:49:07 +08:00
Chris Li
1f34774d36 Update DisplayAreaOrganizer document
We are not allowing client to register for feature that has alreay been
registered. Update the doument to make it clear.

Fix: 172027455
Test: just document update
Change-Id: I66823d073aaf65eef044329b6f793f58a0643643
2020-11-03 12:47:34 -08:00
Chris Li
a9e67cd9aa Return the existing DisplayAreas when registering an organizer
A list of existing DisplayAreas of the given feature are returned when
registering the organizer, and the organizer will not receive
onDisplayAreaAppeared() for these DisplayAreas.

Fix: 162028888
Test: atest WmTests:DisplayAreaOrganizerTest
Test: atest OneHandedDisplayAreaOrganizerTest
Change-Id: I3f4c5921a31c06e5b6c0040397df15cdee6ebcdd
2020-10-28 12:09:09 -07:00
Louis Chang
5510ecdfa9 Deprecate MANAGE_ACTIVITY_STACKS permission
Adding MANAGE_ACTIVITY_TASKS permission as the replacement, but
still grant the deprecated MANAGE_ACTIVITY_STACKS permission for
app compatibility.

Bug: 157876448
Test: presubmit

Change-Id: I894ee66e058b1024a731d3be4b33b69626451f08
2020-10-28 09:20:00 +08:00
Wale Ogunwale
188d801038 Changed createRootTask task to be completely async
Currently some of the information about a task created by createRootTask
is returned with the method and the rest like leash is return in
onTaskAppear. Mixing both async and sync infromation return styles
complicates the mental model for this. So, we will have this be
completely aync for now.

Also, fixed an issue where the windowing mode for organizer created
task was not set correctly before the organizer gets the first task
appear signal.

Bug: 169266958
Test: Split-screen works!
Change-Id: Ia4180d5a42838bf566fbf75f40466dfd8237e0f1
2020-10-26 13:18:09 -07:00
Issei Suzuki
1e2b859350 Merge "Replace old app transition type to new transition type (1/N)" 2020-10-23 17:19:28 +00:00
Wei Sheng Shih
e11ad96453 Revert "Have createRootTask return TaskAppearInfo"
Revert "ARC++ changes to mirror changes to createRootTask"

Revert submission 12855635-create-root-task

Reason for revert: b/171369770
Reverted Changes:
Iabf090caa:ARC++ changes to mirror changes to createRootTask
I5948e6234:Have createRootTask return TaskAppearInfo
Fixes: 171369770
Bug: 169266958

Change-Id: Iee1cf0b30e368987931f928de8c691640e18286a
2020-10-22 11:23:56 -07:00
Issei Suzuki
aa5118f23d Replace old app transition type to new transition type (1/N)
- Rename TransitionType to TransitionOldType, and define a new
  TransitionType.
- Calls prepareAppTransition which takes a new TransitionType when app
  transition related event happens.

The TransitionOldType and related logic will eventually removed. Until
migration finishes, we keep both.

Bug: 166736358
Test: Pass existing tests, since no new logic is enabled.

Change-Id: I984f68d5ecfae56fbfe7d91babbfddcf34378f6c
2020-10-22 19:49:12 +02:00
Wale Ogunwale
089dda160c Merge "Made ShellTaskOrganizer thread safe" 2020-10-22 13:52:27 +00:00
Wale Ogunwale
c21aca86d8 Made ShellTaskOrganizer thread safe
- Post callbacks from WM Core on executor.
- Added lock to protect critical sections.

Bug: 171384876
Test: They pass!
Change-Id: Ia1808b66104c2a1e6efb9f43c31e6a3a2f67a952
2020-10-21 15:15:10 -07:00
Winson Chung
5c0e676957 Merge "Remove single task display path" 2020-10-21 17:09:17 +00:00
Winson Chung
d660f73a42 Remove single task display path
Test: atest TaskStackChangedListenerTest
Test: atest RecentTasksTest
Bug: 165794879
Change-Id: I4c86e58026be7bcbbd8a2568b396a281668b9385
2020-10-21 17:08:55 +00:00