Commit Graph

151 Commits

Author SHA1 Message Date
Wei Sheng Shih
64aa8161e0 Merge "Use a blank splash screen for new task activity" into sc-dev 2021-04-07 00:47:54 +00:00
wilsonshih
4bd7f5a92b Use a blank splash screen for new task activity
Add a condition when launch activity from continuous package, consider
to show a blank splash screen since the activity might start from an
existing task, showing an icon on it might seems strange to user.

Bug: 183150443
Bug: 183108088
Test: atest StartingSurfaceDrawerTests ActivityRecordTests
Change-Id: Ia76648c291d602302725a1814991971a1d544549
2021-04-01 14:58:47 +08:00
wilsonshih
8ab6b92895 Refine splash screen APIs
- Add @UiThread on SplashScreenView:remove
- Add @UiThread on OnExitAnimationListener:onSplashScreenExit
- Add an API SplashScreen#clearOnExitAnimationListener, also update
some comment for SplashScreen APIs.
- Remove "millis" from getIconAnimationStartMillis and
getIconAnimationDurationMillis
- Return java.time.Duration for getIconAnimationDuration
- Return java.time.Instant for getIconAnimationStart

Bug: 182997416
Test: atest SplashscreenTests
Change-Id: If07252cc4b554dcde0c5dc4c4dec3f242ee47ae7
2021-04-01 11:58:29 +08:00
Evan Rosky
6c48dabfa5 Merge "Add task-launch support to WindowContainerTransaction" into sc-dev 2021-03-30 20:19:44 +00:00
Hongwei Wang
660008c5c2 Merge "Apply the whole auto pip transaction in recents animation" into sc-dev 2021-03-30 19:26:17 +00:00
Evan Rosky
7fe3ce5378 Add task-launch support to WindowContainerTransaction
This enables launching multiple tasks (recent tasks)
within one transaction simultaneously with configuration and
hierarchy changes.

Bug: 182002789
Test: WindowOrganizerTests#testStartTasksInTransaction
Change-Id: Ic297eeae52e833286e7feede73d91354a5394e7c
2021-03-30 09:43:04 -07:00
Hongwei Wang
de204a5721 Apply the whole auto pip transaction in recents animation
Take the full transaction details passed from Launcher, including
position / windowCrop / scale / roundRadius and apply them in
RecentsAnimationController.TaskAnimationAdapter#onCleanup to make sure
the final state of autoEnterPip transition can be carried over.

Note: there are still several frames off when entering PiP from
landscape with autoEnterPip being enabled.

Bug: 179720719
Test: manually using the ApiDemos app
Change-Id: Ibfff75e09943960cfcd816d6c52a80d7a8af8fe8
2021-03-25 12:07:20 -07:00
Charles Chen
d5e2fc35e3 Merge "Introduce WindowContextController" into sc-dev 2021-03-24 09:42:51 +00:00
Charles Chen
1e76f995bf Merge "Move WindowContext module to window package" into sc-dev 2021-03-24 07:45:41 +00:00
Charles Chen
9c614d10b8 Introduce WindowContextController
This CL extracts the logic which is going to share with
WindowProviderService. It is also the preparation to introduce
WindowProviderService.

Bug: 159767464
Test: atest WindowContextControllerTest

Change-Id: Ib5a4cc8d7853bb01bde1081af091d1069865e3a0
2021-03-24 11:26:52 +08:00
Charles Chen
f48ece4875 Move WindowContext module to window package
In this way, we can clarify the owners and it is easier to maintain.
Also refactor to move WindowContext creation logic to ContextImpl.

Test: atest WindowContext WindowContextTests WindowContextPolicyTests
Bug: 159767464
Bug: 152193787

Change-Id: I78432aa18aa97e001f5a9a04321109e456fd137b
2021-03-24 11:26:50 +08:00
Vadim Caen
015adeccfd Merge "Hide branding view when empty" into sc-dev 2021-03-23 08:28:33 +00:00
Vadim Caen
884c99d065 Hide branding view when empty
It looks like the empty branding view was causing the underlying
view to bleed through it so ensuring that it is removed if empty.

Bug: 182708883
Change-Id: I868931768bed5b083433fd5222720724bfe3e60e
2021-03-23 08:28:14 +00:00
wilsonshih
2c9160c38b Add trace for tracking the performance of new starting window
Analysis performance.

Bug: 173975965
Test: check perfetto
Change-Id: Id0cf1b23799fd8bb0193c950ae4320ccca9dfac0
2021-03-22 16:23:41 +08:00
wilsonshih
a4c6d8f828 Add API windowSplashScreenIconBackground(12/N)
Add new API for developer to customize starting window, set a
background color behind the icon.

Also masking the AVD and icon background like AdaptiveIconDrawable.

Ref doc: go/improved_app_launch_animations

Bug: 73289295
Test: atest SplashscreenTests
Change-Id: Ibba49ecc3ca020022cf775fed302e383908be327
2021-03-19 11:23:56 +08:00
Evan Rosky
557bab6f87 Merge "Initial support for display rotation in shell transitions" into sc-dev 2021-03-18 23:24:48 +00:00
wilsonshih
5cafb53ce6 Remove the timeout which used for cleanup splash screen
Remove the internal timeout to clean up the starting window, for now on
the developers are responsible for removing it.

- Also clean up some redundant members.

Bug: 181838419
Test: atest SplashscreenTests
Change-Id: Iebcccbca454eb7fda4bed637cb5866deec36cf6b
2021-03-18 11:36:44 +08:00
Evan Rosky
1551cb7307 Initial support for display rotation in shell transitions
This puts display-content as another WC in a transition. It then
adds WC rotation to change tracking. If there is a rotation,
the shell-side handlers will play the transition.

This replaces ScreenTransitionAnimation, seamless-rotation, and
fixed-rotation:

 ScreenTransitionAnimation implementation will move to shell.

 seamless-rotation is redundant because the rotation setup is
 intrinsically "seamless": it requires shell to imbue an
 animation onto it rather than just doing the jump-cut.

 fixed-rotation is now just a custom animation where we
 counter-rotate the closing app on frame 1 and then perform
 the normal open animation on the opening app.

Bug: 179270750
Test: DisplayContentTests#testShellTransitRotation
      enable shell transitions and rotate the device or launch
      and close apps in different orientations.
Change-Id: I4bc23b2e614ba85bf9752f62da4c3f8d0c90436d
2021-03-17 15:08:10 -07:00
Evan Rosky
6c5f8fc3d8 Do the same size-configuration bucketing on both server and client
Otherwise they get out-of-sync and sometimes AR will not relaunch
the app, but the app client will think it needs to be relaunched

Bug: 181697795
Test: app configuration tests pass.
      With 3-button nav, open app in split and observe launcher
      reconfigure properly.
Change-Id: Idc8d71d92d9ae107e3adb949a2137de6c08908e9
2021-03-15 15:37:07 -07:00
wilsonshih
11af33eeaf Fix several test failures for the new starting window.(10/N)
1. Register TestStartingWindowOrganizer to mock add/remove starting
window.
2. Do not show starting window if not occluded.
3. Add ReadFrameBuffer permission so Car can get TaskSnapshot.
4. Correct package path for shell.startingsurface.
5. Do not show starting window for home type.

Bug: 73289295
Bug: 131311659

Test: atest TaplTestsLauncher3
Test: atest WmTests StartingSurfaceDrawerTests TaskSnapshotWindowTest
Test: atest CtsWindowManagerDeviceTestCases
Change-Id: I89930d2e8a05cca6197c36c780ee1843fe454354
2021-03-12 04:08:56 +00:00
wilsonshih
d52e491d2f Implement default exit animation for splash screen.(9/N)
Implement default exit animation on the view of splash screen, there
will be a two layers switch happen when playing exit animation. For
the detail please reference
go/improved_app_launch_animations and go/app-startup

Note: For this version we skip shift-up animation, need to fix the
flicker test so we can enable it.
Note2: Fix the possible missing splash screen view issue, but could
make the first window draw slower, keep tracking.

Bug: 73289295
Test: build/flash
Test: check splash screen starting window.
Test: atest StartingSurfaceDrawerTests ShellTaskOrganizerTests
WindowOrganizerTests SplashscreenTests

Change-Id: I796811d010ac70f256169dd03d5e05ef0ed79d28
2021-03-12 03:46:15 +00:00
wilsonshih
11598e8243 Starting window performance tuning.(8/N)
Create splashscreen thread with priority -10 in shell for starting
window controller, the definition is moved from
AMS#TOP_APP_PRIORITY_BOOST to Process#THREAD_PRIORITY_TOP_APP_BOOST.

Create and set SplashScreenView object on the starting window after the
first simple view on the starting window drawn, in this way the
transition can be prepare early than wait the actually view was draw,
which can save some time.

Bug: 73289295
Bug: 131311659
Test: atest StartingSurfaceDrawerTests ShellTaskOrganizerTests
Test: atest SplashscreenTests
Change-Id: Ibb430a66d6b329e74d62de047fbf37205cb66a96
2021-03-09 11:13:03 +08:00
Evan Rosky
86234a6ebd Merge "Abstract some transition checks so they can be expanded." into sc-dev 2021-03-05 16:48:32 +00:00
Riddle Hsu
304d3a07ea Merge "Optimize the Parcel read/write of remote animation" into sc-dev 2021-03-03 03:58:07 +00:00
Evan Rosky
7e3bc7154e Abstract some transition checks so they can be expanded.
This is mostly to clean-up CL diffs so its easier to tell
what is changing. The main change here is replacing naked
parint == null checks with TransitionInfo.isIndependent() which
can do extra logic to handle cases where, even though a change
has a parent, it might be animating independently with in it.
The easiest example is display rotating while an app is opening.

This also fixes a small bug when removing a non-visible task.

Bug: 179270750
Test: atest TransitionTests
Change-Id: Ibd72b0721f33602b26bcc5c7060fc959aed04377
2021-03-02 12:34:03 -08:00
Wei Sheng Shih
a3b84a9a62 Merge "Extract StartingSurface interface on WMShellBaseModule(7/N)" into sc-dev 2021-03-02 04:50:28 +00:00
Riddle Hsu
ec999979a7 Optimize the Parcel read/write of remote animation
Eliminate the overhead of class name. A read/write pair
of RemoteAnimationTarget can be reduced from 30us to 7us.

Bug: 181025587
Test: CtsWindowManagerDeviceTestCases
Change-Id: I58bd69012fcc3e6cb72c1fcfbb1db697e6c70e87
2021-02-26 20:37:13 +08:00
wilsonshih
75d1558ce1 Extract StartingSurface interface on WMShellBaseModule(7/N)
Decouple the dependency for the rest CLs.

Bug: 73289295
Bug: 131311659
Test: atest WindowOrganizerTests StartingSurfaceDrawerTests
SplashscreenTests

Change-Id: Ifd323714184fad285b4d65f8c86c9b8feafc2374
2021-02-26 18:22:40 +08:00
Riddle Hsu
b293d933e0 Optimize the Parcel read/write of common window data
The Parcel read/write speed of MergedConfiguration/InsetsSource
becomes 4x+ faster.

Because writeParcelable sends additional type info which is
unnecessary if the type is known on the reading side, replace
the usages to writeTypedObject and well-written readFromParcel.
That saves the time of class lookup and object creation.

Bug: 181025587
Test: vogar --mode app_process --benchmark \
frameworks/base/core/tests/benchmarks/src/android/os/ParcelableBenchmark.java

Change-Id: I29548ce6c2e5886f0e90a5dc70d8e9ecc0fb25a8
2021-02-24 23:33:16 +08:00
wilsonshih
bfb28f2f3c Add two more Api for SplashScreenView(7/N)
getIconAnimationDuration - Returns the duration of the icon animation
if icon is animatable.
getIconAnimationStart - If the replaced icon is animatable, return
the animation start time in millisecond based on system.

Bug: 73289295
Test: atest CtsWindowManagerDeviceTestCases:SplashscreenTests
Change-Id: Ie4332d6764b4d0892a0e5e6f7c297102b71a79f9
2021-02-15 15:27:04 +01:00
wilsonshih
cf05d92650 Allow ShortcutInfo to specify a theme for splash screen.(5/N)
Provides new APIs so that shortcuts can preset the theme of the splash
screen window.
- Static way: android:splashScreenTheme
  Preset the splash screen theme from xml.
- Dynamic way: ShortcutInfo.Builder#setStartingTheme
  Preset the splash screen theme when construct the ShortcutInfo
  programmatically.

Bug: 73289295
Test: build/flash
Test: atest AppWindowTokenTests ActivityRecordTests
Change-Id: Ie5e73f9b22fea22659e496c12198c942f4bc93cd
2021-02-15 15:27:03 +01:00
wilsonshih
8ac1b58101 Add API for show branding image on splash screen.(4/N)
Add API windowSplashScreenBrandingImage to attach branding image
on splash screen.

Bug: 73289295
Test: build and flash
Test: StartingSurfaceDrawerTests SplashscreenTests

Change-Id: I15ab799d4e7bb74ce6814fa9375334db18022f3a
2021-02-15 15:22:42 +01:00
wilsonshih
ae7ee3f3ef Provide new APIs for customize splash screen window.(3/N)
Create new APIs for developer to customize starting window
- windowSplashScreenBackground: specify the background color
- windowSplashScreenAnimatedIcon: replace center icon on starting
window, and it can be animatable.
- windowSplashScreenAnimationDuration: the animation duration if
the replace icon is animatable, it cannot exceed
max_starting_window_intro_icon_anim_duration.

Support ADV to replace the icon on starting window.

Ref doc: go/improved_app_launch_animations

Bug: 73289295
Test: build/flash
Test: check splash screen starting window.
Test: atest StartingSurfaceDrawerTests SplashscreenTests
Test: atest ShellTaskOrganizerTests
Change-Id: Id3de3e9b57d769f096baf43713c1e3c327ecfdc8
2021-02-15 15:22:03 +01:00
wilsonshih
56f65c3bb7 Customizable exit splash screen animation.(2/N)
Introduce new APIs to customize exit splash screen animation.
- SplashScreen
  This can be used for Activity to handle the exit splash screen
  animation.
- SplashScreen#OnExitAnimationListener
  When receive onSplashScreenExit, the splash screen view will be on
  top of the activity.
- SplashScreenView
  The view object which represents the view of current starting window.
  There are two APIs for developer to control it:
  - getIconView: get the icon view object.
  - remove: remove the view and release resources.

If an Activity create a OnExitAnimationListener and set on
SplashScreen, the core will request a copy of SplashScreenView
from Shell, then send the parcelable information to client to
reconstruct the view on top of the DecorView, then call
onSplashScreenExit to let the listener able to operating this view.

Bug: 73289295
Test: build/flash, check splash screen starting window.
Test: atest StartingSurfaceDrawerTests ActivityRecordTests
WindowOrganizerTests
Test: atest CtsWindowManagerDeviceTestCases:SplashscreenTests

Change-Id: I9f77fb4471bcf37a7f74d6c18a345ca56c05b716
2021-02-15 14:49:00 +01:00
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