655 Commits

Author SHA1 Message Date
Chris Li
85377a9785 Allow non-resizable apps in split-screen (10/n)
Render size compat restart button on Task surface with
WindowlessWindowManager.

Bug: 176061101
Bug: 178327644
Test: atest WMShellUnitTests:SizeCompatRestartButtonTest
Test: atest WMShellUnitTests:SizeCompatUIControllerTest
Test: atest WMShellUnitTests:SizeCompatUILayoutTest
Change-Id: I86912adca18a6a62265cd31585f2c7d612c90fd1
2021-02-15 14:05:01 -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
Evan Rosky
fa9d715bde Merge "Apply split-screen resize on sync queue" into sc-dev 2021-02-12 02:08:59 +00:00
Winson Chung
7a337facf6 Merge "Remove some blocking calls in BubbleManager" into sc-dev 2021-02-12 01:26:33 +00:00
Ben Lin
8033b081b4 Merge "PiP: Snap to closest edge when releasing during a pinch-resize." into sc-dev 2021-02-11 19:30:30 +00:00
TreeHugger Robot
bcacea742c Merge "Remove deprecated AutomationUtils methods" into sc-dev 2021-02-11 15:43:58 +00:00
Winson Chung
79633c2b31 Merge "11/ Clean up usage of exported interfaces from internal controllers" into sc-dev 2021-02-11 07:16:47 +00:00
Winson Chung
6d4d8ed181 Remove some blocking calls in BubbleManager
- When shell thread is enabled, there's a deadlock that can happen from
  having blocking calls from both Shell -> SysUI and vice versa.
  Specifically if you have a scenario like:

  Shell            SysUI
  A ----------------> f() (shell blocking call, posts onto thread & awaits)
                      |
  g() <-------------- B (sysui blocking call while f() is posted)
  |                   |
  |                   V
  V                   f() runs
  g() runs

  The call f() will never actually run since B came in which is blocked
  on g() which can't finish because f() has not returned.
- Instead, replace some blocking calls with preloaded info (ie. can send
  bubble entry and whether the the entry should bubble up to
  onRankingUpdated since it just calls back to query it), and make
  getShouldRestoredEntries() and getPendingOrActiveEntry() async with
  a callback.
- Can remove isNotificationShadeExpand() since it's not actually used
  anymore in bubble code

Bug: 161979899
Test: atest WMShellUnitTests
Test: atest SystemUITests

Change-Id: Iba834172c17c3f4b03c23448fef346c71c16c1bb
Signed-off-by: Winson Chung <winsonc@google.com>
2021-02-10 21:56:43 -08:00
Mady Mellor
b91377962d Merge "Bubble API: intent extra for bubbled activities" into sc-dev 2021-02-11 00:35:56 +00:00
Evan Rosky
0557739e43 Apply split-screen resize on sync queue
This keeps it synchronized with dismissal and thus avoids
a race between pending and sync transaction application

Bug: 170801863
Test: launch a forced-multiwindow sizecompat app in split and
      then dismiss split to that app. App should not be cropped.
Change-Id: I4d89be443af5616174ea44e62774133e3b99597c
2021-02-10 16:19:29 -08:00
Ben Lin
f45228ff1d PiP: Snap to closest edge when releasing during a pinch-resize.
Bug: 178881304
Test: Manual
Change-Id: Ibbc1c5bebe2e742fe55bbad44f9b2a9b530b71c7
2021-02-10 16:18:04 -08:00
Nataniel Borges
94a16e376c Remove deprecated AutomationUtils methods
Those methods were replaced by WindowManagerStateHelper to make the tests more stable.

Bug: 172321238
Test: atest FlickerTests WMShellFlickerTests
Change-Id: I87d4fb031603eb060551f4800a31fb44851a3cff
2021-02-10 17:02:46 +01:00
Wale Ogunwale
fd5b5eaea5 Merge "Fix split divider position issue" into sc-dev 2021-02-10 14:40:56 +00:00
Winson Chung
d580290a3b 11/ Clean up usage of exported interfaces from internal controllers
- Adding documentation for dagger setup for shell
- We should only reference the controllers from shell code instead of
  through the external interfaces.  This reduces the number of exposed
  methods, and is also more direct (it ends up in the controller
  anyways).  This means that the base module will provide the
  controllers separately and we can remove some duplication in the
  create methods for the controllers (except in cases where it's doing
  other initialization)
- Remove SizeCompatUi interface since it's not actually used in SysUI
- Group related dependencies in the module to make it a little eaiser
  to parse

Bug: 161979899
Test: atest WMShellUnitTests
Test: atest SystemUITests
Change-Id: I07c2c002b87ffd127ebfce67b5485ff47d127e1f
2021-02-09 21:30:51 -08:00
Josh Tsuji
56033d227d Merge "New Bubbles animations!" into sc-dev 2021-02-10 01:49:30 +00:00
Wale Ogunwale
636f9e3aa4 Fix split divider position issue
ag/13463021 missed a case to convert for leashing.
Also, fixed logic typo in setSideStageVisibility

Bug: 168505645
Test: adb shell dumpsys activity service SystemUIService WMShell setSideStageVisibility false
Change-Id: Iaba1f25d457d0211d43364bb6885ba688fea3790
2021-02-09 17:30:17 -08:00
Wale Ogunwale
b4080f637b Merge "Fixed issue with not sending stage position change" into sc-dev 2021-02-09 21:04:38 +00:00
Wale Ogunwale
31e48a2df8 Fixed issue with not sending stage position change
Also, added API to specify if split-screen should exit on hide.

Bug: 179176511
Test: presubmits
Change-Id: Iad2884554d16d922906386cb2887bcf35d6327e8
2021-02-09 07:23:31 -08:00
Nataniel Borges
068156db02 Migrate Pip tests to new DSL format
Make sure the test can run multiple times and is stable on flame

Introduce methods to allow waitForPipWindowShow/Gone using the WindowManagerState to determine if a PIP window is active (windowingMode = PINNED), since the UiDevice method is unstable and doesn't work on TVs.

Bug: 171049720
Bug: 172321238
Bug: 171049762
Test: atest WMShellFlickerTests
Change-Id: Iade19fadeb0ba07e047eb5f64479e592920ca11e
2021-02-09 15:13:54 +01:00
TreeHugger Robot
2390b55c90 Merge changes I08071058,I9a64a7ab into sc-dev
* changes:
  Update app pairs tests to new DSL format
  Create common assertions for new tests
2021-02-09 08:41:44 +00:00
TreeHugger Robot
ca7f10993f Merge "Apply fixed rotation animation for pip to fullscreen" into sc-dev 2021-02-09 07:08:02 +00:00
Winson Chung
5bb86857d6 Merge changes I06d26609,I0afbacd0 into sc-dev
* changes:
  10/ Update split for shell thread
  9/ Update transitions/starting window for shell thread
2021-02-09 06:40:57 +00:00
Rob Carr
c534edd535 Merge "Port SurfaceControlViewHost to BLAST" into sc-dev 2021-02-09 01:10:51 +00:00
Hongwei Wang
f3e5e9cdee Merge "Revert "Add an invisible layer to trap focus"" into sc-dev 2021-02-08 22:36:14 +00:00
TreeHugger Robot
cfce53fc55 Merge "Remove flaky from default excluded tests" into sc-dev 2021-02-08 22:33:02 +00:00
Mady Mellor
1ecb1ccb9a Bubble API: intent extra for bubbled activities
Apps need a better way to check if their shortcut or
pending intent is bubbled, to do this we'll add an intent
extra on the bubbled activity that they may check.

- updated doc around bubbles for how to check the extra
- applied flag on activity for intent & shortcut

Bug: 171220648
Test: atest NotificationManagerTest (see CTS CL)
Change-Id: Iba97a0058e1e4fc33c4df32a3f258ff350ad04e2
2021-02-08 14:04:18 -08:00
Robert Carr
fb59b6880f Port SurfaceControlViewHost to BLAST
This is mostly a matter of flipping the flag, except for the case of
SystemWindows. While external SurfaceControlViewHost clients use the
leash provided by the SurfaceControlViewHost rather than the internal
ViewRootImpl surface, SystemWindows clients will use the actual
ViewRootImpl surface. This can conflict with the BLAST adapter setting
crop/frame/etc on this Surface. We modify SystemWindows to put
each layer inside a leash, and hand this out to other parts of SysUI
instead of the ViewRootImpl surface.

Test: Existing tests pass
Bug: 168505645
Change-Id: Ie621f89166f00ce385d450f1f1cea4d4abd1b805
2021-02-08 13:33:00 -08:00
Ben Lin
5f5968a225 Merge "PiP: Better rotation angle calculation." into sc-dev 2021-02-08 20:20:39 +00:00
Jorge Gil
bec99582ef Merge "Run alignment logic of menu icons when the menu is created" into sc-dev 2021-02-08 19:51:18 +00:00
Hongwei Wang
f2fd0294a9 Revert "Add an invisible layer to trap focus"
This reverts commit cb98114abd40b645245bbf9d60195b662b6eba37.

Reason for revert: Not needed once ag/13507782 is merged

Bug: 169372603
Change-Id: I52d4344f6f2f3fb973f3f20e7d6f1ec2844d7567
Test: manually enter PiP
2021-02-08 18:43:30 +00:00
Nataniel Borges
3ff83743e2 Remove flaky from default excluded tests
Atest cannot override include-annotation and exclude-annotation from the Android.xml, only append new ones.

Ideally we should have a single test configuration for all flicker tests (presubmit/postsubmit/flaky) and adjust the arguments according to the type of test we intend to run.

Presubmit:
    atest FlickerTests -- --module-arg FlickerTests:include-annotation:android.platform.test.annotations.Presubmit --module-arg FlickerTests:exclude-annotation:androidx.test.filters.FlakyTest

Postsubmit:
    atest FlickerTests -- --module-arg FlickerTests:include-annotation:android.platform.test.annotations.Postsubmit --module-arg FlickerTests:exclude-annotation:androidx.test.filters.FlakyTest

Flaky:
    atest FlickerTests -- --module-arg FlickerTests:include-annotation:androidx.test.filters.FlakyTest

To run WMShellFlickerTests, just replace FlickerTests for WMShellFlickerTests in the commands above.

Bug: 170490377
Test: atest FlickerTests WMShellFlickerTests
Change-Id: Ic252f27065714e9039e3c0f33659b98eb288aa6f
2021-02-08 14:19:09 +01:00
Winson Chung
0054d7fc8c 10/ Update split for shell thread
- Also remove usages of external interface within the shell code
  and remove methods only used in the controller from the interface
  (will update for other components separately)

Bug: 161979899
Test: atest WMShellUnitTests
Test: atest SystemUITests
Change-Id: I06d266095d8e287ba131e41dc6bebefa15c9e477
2021-02-07 21:14:07 -08:00
Winson Chung
6c75e58fc6 9/ Update transitions/starting window for shell thread
Bug: 161979899
Test: atest WMShellUnitTests
Test: atest SystemUITests
Change-Id: I0afbacd0db32ef02f1e178f7a53b16df5b64449b
2021-02-07 21:07:43 -08:00
Riddle Hsu
c0e5b3d92f Apply fixed rotation animation for pip to fullscreen
The activity surface is rotated by WM core when changing
the windowing mode of PiP activity to fullscreen. And then
PipTaskOrganizer#onFixedRotationStarted will be called before
WindowContainerTransactionCallback#onTransactionReady. So
PipTaskOrganizer can use the given new rotation to run the
animation in current rotation. After the animation is done,
PipTaskOrganizer will set the task to fullscreen, that makes
previous top activity pause and then resume the next top
activity (the original PiP). Finally, the fixed rotation is
finished by transition done event, and then continue to
rotate the display seamlessly.

Also remove mInitialState from PipTaskOrganizer because it
is no longer needed for predicting the fullscreen bounds.

Bug: 165794724
Test: DisplayContentTests#testFixedRotationWithPip
      PipAnimationControllerTest#pipTransitionAnimator_rotatedEndValue
Test: Expand PiP in portrait which was in landscape

Change-Id: I5c1400ece9d80226bc35b497d308215010ead027
2021-02-08 12:25:27 +08:00
Nataniel Borges
628b65f91e Update app pairs tests to new DSL format
Move the existing assertions into presubmit and flaky blocks

Bug: 162923992
Test: atest FlickerTests
Change-Id: I08071058fdaec33f65e03bd97d41c4bc91125040
2021-02-07 11:18:58 +01:00
Nataniel Borges
0d56c0f528 Create common assertions for new tests
Maintain the same assertions for new assertion blocks and legacy. This CL is used while migrating the existing tests from the old to the new DSL format.

Once the tests are migrated the legacy support will be removed.

Bug: 162923992
Test: atest FlickerTests
Change-Id: I9a64a7ab43bf60c67a26f37562ab6c4d7bb0c487
2021-02-07 11:18:43 +01:00
Ben Lin
852a04c2da PiP: Better rotation angle calculation.
Bug: 178881304
Test: Manual
Change-Id: Ib63ef96a7b8771b2a920a25e44d8583dc584cf05
2021-02-05 16:29:06 -08:00
TreeHugger Robot
028348d871 Merge "Update badge visibility on expand and collapse" into sc-dev 2021-02-05 20:30:51 +00:00
TreeHugger Robot
e2215fc083 Merge "Enable kotlin tests in shell & fix some bubbles ones" into sc-dev 2021-02-05 17:53:09 +00:00
Lyn Han
fddf14356a Merge "Skip reorder animation while collapsing" into sc-dev 2021-02-05 15:01:03 +00:00
Ben Lin
563727df26 Merge "PiP: Pinch-resize auto to max size if it's pretty close to it." into sc-dev 2021-02-05 02:19:38 +00:00
TreeHugger Robot
7ff13b5213 Merge "Disable split screen tests at 90 degrees" into sc-dev 2021-02-05 00:53:37 +00:00
TreeHugger Robot
80f96120be Merge "Log bubble package when available" into sc-dev 2021-02-05 00:08:45 +00:00
Evan Rosky
8277f84911 Merge "Add some more Protologs to Shell-side Transitions" into sc-dev 2021-02-04 23:33:08 +00:00
TreeHugger Robot
70b6c098ab Merge "Save the notification group key on the bubble" into sc-dev 2021-02-04 23:08:50 +00:00
Ben Lin
f3e2661602 Merge "Add basic PiP Transition foundation." into sc-dev 2021-02-04 22:40:43 +00:00