Commit Graph

529 Commits

Author SHA1 Message Date
Jerry Chang
1aa448dbea Merge "Fix not updating split bounds after devices unfolded" into sc-v2-dev am: 11a26a5665 am: cd672f385e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14932975

Change-Id: I75e5beda71865a4a2bfcac323268a7ff027a22e2
2021-06-11 04:09:06 +00:00
Jerry Chang
11a26a5665 Merge "Fix not updating split bounds after devices unfolded" into sc-v2-dev 2021-06-11 03:26:28 +00:00
Ben Lin
e8c5677e16 Merge "PiP: Introduce PipTransitionState." into sc-v2-dev am: e9d456b056 am: d60ba5ca23
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14687499

Change-Id: Idd4ef64a940ae231599df0410926a3c762d86f4f
2021-06-10 21:55:51 +00:00
Ben Lin
e9d456b056 Merge "PiP: Introduce PipTransitionState." into sc-v2-dev 2021-06-10 21:45:25 +00:00
Jerry Chang
2af1cde04d Fix not updating split bounds after devices unfolded
When the default display changed due to unfolded the device, the split
root tasks might be changed to invisible before reporting display info
changed to split component. This causing the split component didn't
update split layout due to the divider bar is not "initialized" after
released with stage roots changed to invisible.

This makes sure to update split layout while the split is activated no
matter the divider bar is initialized or not.

Fix: 189726605
Test: atest WMShellUnitTests
Test: check the split bounds updated properly after the device unfolded.
Change-Id: I722b08116a97b8482ea6e25b60ffe71005076cd7
2021-06-10 09:30:11 +00:00
Ben Lin
58b47f30e5 PiP: Introduce PipTransitionState.
This is extracted from PipTaskOrganizer and updated/used by both
TaskOrganizer and PipTransition.

Bug: 165793917
Test: Enter PiP with ENABLE_SHELL_TRANSITIONS flag on
Change-Id: Iebc70744f075112f47a3f1bec84311343acae24c
2021-06-09 00:32:45 +00:00
TreeHugger Robot
7317a58331 Merge "Wait for PIP window to exist" 2021-06-08 20:09:07 +00:00
TreeHugger Robot
b04ee60f5b Merge "Synchronize WCT for TaskView with SurfaceControl.Transaction." into sc-v2-dev am: 16eeb2c5a3 am: fc2de1ae39
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14690649

Change-Id: I632de9b8b029c9d7a332df48ee6d20f51d6db065
2021-06-08 18:41:04 +00:00
TreeHugger Robot
16eeb2c5a3 Merge "Synchronize WCT for TaskView with SurfaceControl.Transaction." into sc-v2-dev 2021-06-08 18:21:32 +00:00
TreeHugger Robot
896405b2be Merge "Include a name in the waitFor invocations for logging" 2021-06-08 17:14:56 +00:00
Riddle Hsu
b9e052c6b1 Merge "Cache window and icon color of splash screen starting window" into sc-dev am: 00d26d7185 am: 7977ff6ac3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14842877

Change-Id: Icb7e773fb81b4a300acb0ecc5a26752f51ec4e32
2021-06-08 12:16:10 +00:00
Riddle Hsu
de4577a2ce Merge "Cache window and icon color of splash screen starting window" into sc-dev am: 00d26d7185
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14842877

Change-Id: I009eb24b5db372ea8f0ffe7ffa4a17faa847b3e1
2021-06-08 11:58:10 +00:00
Nataniel Borges
9d1fb68838 Include a name in the waitFor invocations for logging
Without a name, waitFor invocations appear as:
    ***Waiting for ... retry=5 elapsed=3524 ms
    Requesting new device state dump
    ***Waiting for ... Failed!

Which makes it hard to debug

Bug: 167521849
Test: atest FlickerLibTest
Change-Id: Id04a33a51987043651ae982a3007681a72e0b382
2021-06-08 10:14:07 +02:00
Nataniel Borges
82adde8b24 Wait for PIP window to exist
Previously the test sometimes failed because the it ended before the PIP window flags were correctly updated. Now ensure animation is complete before making assertions

Bug: 190215146
Test: atest WMShellFlickerTests
Change-Id: I9c49ca3919e2e43602745b113499e086b9febb50
2021-06-08 09:36:10 +02:00
Yuncheol Heo
60b68fcbbe Synchronize WCT for TaskView with SurfaceControl.Transaction.
- Introduces SyncTransactionQueue to TaskView.
- Synchronizes the visibility, location, size changes of the window with
  Surface transaction.

Bug: 151449487
Test: atest TaskViewTest BubblesTest NewNotifPipelineBubblesTest
Change-Id: I13df32bb41e83bfb512be503218fcd6b44a144b3
2021-06-07 16:40:50 +00:00
Riddle Hsu
f08127e398 Cache window and icon color of splash screen starting window
The background color of splash screen starting window may depend
on the declared window background and the content if icon. That
may be expensive operations if the drawables are not using pure
color. Because the attributes to compute the colors are simple,
it only need a few fields to identify whether the incoming request
has been computed. So it is worth to cache them with very small
extra memory. The cache of a package will be cleared if the package
is removed or replaced.

It may save the creation time up to 20ms (depends on the complexity
of the drawable).

Bug: 190176296
Test: atest StartingSurfaceDrawerTests#testColorCache
Test: Cold/warm launch app twice and compare the duration of
      trace name "makeSplashScreenContentView". The second time
      should be faster. Re-install the app and launch again,
      the trace will contain "peekWindowBGColor" that means
      that cache for the package was cleared.

Change-Id: I61158416694a226999843fa8fc6a8b23d6893f02
2021-06-07 22:24:03 +08:00
Adithya Srinivasan
5179933d6a Merge "Add TaskSurfaceHelper/Controller in WMShell to plumb game mode to SF" into sc-dev am: c6273f7f15
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14687471

Change-Id: I78361faa7f6726a4540e5d2d0114cc3bdd48bd12
2021-06-03 07:06:40 +00:00
Adithya Srinivasan
e79bf55181 Merge "Add TaskSurfaceHelper/Controller in WMShell to plumb game mode to SF" into sc-dev am: c6273f7f15 am: ef3378bcea
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14687471

Change-Id: Ie183002c5df4ae0499e640b23ee06f0119cccfc1
2021-06-02 22:20:50 +00:00
Adithya Srinivasan
c6273f7f15 Merge "Add TaskSurfaceHelper/Controller in WMShell to plumb game mode to SF" into sc-dev 2021-06-02 22:00:09 +00:00
Mady Mellor
3ca7a4aae0 Merge changes I4794ed89,I0c273f4d,Ibd8609a8 into sc-dev am: 2430a0b314 am: b1ad3da49d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14707598

Change-Id: I7f28c58606fbcdaa775d0896f1fbe5b170b4f635
2021-05-28 03:12:31 +00:00
Mady Mellor
f985539cb1 Merge changes I4794ed89,I0c273f4d,Ibd8609a8 into sc-dev am: 2430a0b314
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14707598

Change-Id: Id514c7811ad8d5c72869c27930c6236e9503cb12
2021-05-27 23:08:33 +00:00
Mady Mellor
2430a0b314 Merge changes I4794ed89,I0c273f4d,Ibd8609a8 into sc-dev
* changes:
  Flexible maximum number of bubbles to show
  Add shadows back to bubble avatar
  Update sizes for the bubble avatar
2021-05-27 22:51:57 +00:00
Mady Mellor
238f122f47 Flexible maximum number of bubbles to show
* adjust the default spacing so that its small enough that 5 bubbles
  can show on crosshatch (5 is the default)
* Add max bubbles to BubblePositioner, replace the other usages

Test: atest BubbleDataTest
Test: manual - have 5 bubbles
             - adjust screen size to largest
             - open the stack
             => notice that the number of bubbles have changed and
               they all fit on the screen without overlap
             - repeat & check the different densities
Bug: 187715444
Change-Id: I4794ed89541eeb573c367748f980cf7ffe45d3f3
2021-05-27 13:41:22 -07:00
Mady Mellor
5f00d56451 Add shadows back to bubble avatar
* Add shadows back -- icon lib is no longer adding shadows but
  bubbles should still have them for background protection.
* The shadow is active on all bubbles when:
  - the stack is being dragged around & bubbles trail behind it
  - the stack is expanded (the bubbles can be dragged to dismiss &
    can show on top of the expanded view or overflow)
* When the stack is resting, only the top two bubbles show a shadow
  & the bubbles below that animate their Z translation so the change
  is smooth.
* Also put the # of bubbles we show in the stack in a static int &
  updated usages

Test: visual - add 5 of the 'test bubbles' from the test app
               and notice the white backgrounds don't blend together
               due to the shadow & that they are distinct when
               placed on a white background
             - drag / fling the stack around & notice shadows show
               for all the bubbles while moving but once they come
               to rest you don't see a stack of shadows
Bug: 183657577
Change-Id: I0c273f4d0261db9eac1b49ef584fd62fbb67cc9a
2021-05-27 13:40:43 -07:00
Adithya Srinivasan
4e8a1a05b1 Add TaskSurfaceHelper/Controller in WMShell to plumb game mode to SF
TaskSurfaceHelper(Controller) will be used as an interface to communicate
with the SurfaceControl of the underlying Task. This change adds a function
to set the game mode metadata for the task layer.

Bug: 186025682
Test: atest TaskSurfaceControllerTest
Change-Id: I136b65636b98e1883eaf9e4f4f0b34c61350d4e4
2021-05-27 20:12:08 +00:00
Mady Mellor
bb53cce0db Update sizes for the bubble avatar
* Update sizes of badge & bubble; also simplify some of the sizing
  code, we can do it with just the overall size
* Simplified things, instead of the inner / outer sizes just use
  the overall size

Test: visual - create a bubble and look at the size of the bubble and
               badge
      visual - have some bubbles, change display size, create a new
               bubble & verify that all of the sizes are the same
Bug: 183657577
Change-Id: Ibd8609a8737bb0a57519fa70fba17138bb69b379
2021-05-27 10:32:02 -07:00
Wei Sheng Shih
0f488562e4 Merge "Prevent the splashscreenview be replaced after transfer starting window" into sc-dev am: 4bc9052468
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14622503

Change-Id: I8bea1d9e606a5a56d58e26518f57fcbe067a947b
2021-05-25 11:54:47 +00:00
Wei Sheng Shih
4bc9052468 Merge "Prevent the splashscreenview be replaced after transfer starting window" into sc-dev 2021-05-25 11:24:56 +00:00
Jerry Chang
85c712a6ba Merge "Prevent rendering divider bar into wrong orientation" into sc-v2-dev 2021-05-25 05:19:47 +00:00
Evan Rosky
ffac171d4d Merge "Enable remote transition animations to append to the finish transaction" into sc-v2-dev 2021-05-24 19:28:20 +00:00
Evan Rosky
46ba708bb8 Enable remote transition animations to append to the finish transaction
Adds a parameter to the IRemoteTransitionFinishedCallback. This
transaction will be merged into the finish transaction before it is
applied. This is needed by transitions like live-tile recents where
the end-state of the transition is altered during the "animation".

Bug: 172695387
Test: open app, swipe up to overview, resume that same app, screen
      shouldn't turn black anymore.
Change-Id: I6fa1e22288ce087ad17fdfc950a8419e6ba61a47
2021-05-24 09:14:46 -07:00
Jerry Chang
16ec9faad5 Prevent rendering divider bar into wrong orientation
The display area's bounds and orientation changed might be callbacked
seperatedly when the device's folded state changed, causing the
SplitLayout rendered divider bar into wrong orientation. This makes sure
to update divider bar and split layout correspondingly when the
orientation, rotation and root bounds chagned.

Fix: 189101216
Test: atest WMShellUnitTests
Change-Id: Ie5d7132e4122b82d9b5b404a40f97cca3095ce2c
2021-05-24 16:12:25 +00:00
TreeHugger Robot
3d7bed9d65 Merge "Split flicker tests into groups" into sc-dev am: 608a439238
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14601816

Change-Id: I579c9f2588bd492f3abc87fdfe7c1038e7433874
2021-05-22 10:02:13 +00:00
TreeHugger Robot
608a439238 Merge "Split flicker tests into groups" into sc-dev 2021-05-22 09:44:36 +00:00
Mady Mellor
c58ba3c816 Merge changes Ib640add6,I168a14e1 into sc-dev am: db99d2664e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14626186

Change-Id: I532b29196a9081b9ad24e1e6f4010d98ae3b026f
2021-05-22 00:17:34 +00:00
Mady Mellor
1d75e183c9 Only show the first 2 bubbles in the stack when collapsed
Test: manual - add more than 2 bubbles, note you only see the top 2
             - expand & collapse the stack, note you only see top 2
               after collapse
             - fling the stack around, note once it hits the edge
               you only see top 2 bubbles but while dragging around
               you see all of them following
Bug: 180142824
Change-Id: I168a14e1fba1506f53ed0734b55b44971d128de4
2021-05-21 14:00:46 -07:00
Ben Lin
bf09fa1d8a Merge "Pass in finishTransaction to TransitionHandler#startAnimation" into sc-v2-dev 2021-05-21 06:20:33 +00:00
Ben Lin
a8b3618691 Pass in finishTransaction to TransitionHandler#startAnimation
When iterating through registered transitions and finding one and
marking as active, WM sets a reset transition which runs at when the
transition handler runs its finish callback. However, not all transition
handler wants a complete reset of the transition; in PiP's case, it
actually wants to set the final position to the new PiP x and y
coordinates. Passing in the finish transition to #startAnimation will allow
each transition handler to customize and overwrite values as necessary.

Bug: 165793917
Test: Enable Transitions, enter PIP - PIP animates correctly now
Change-Id: I741a04c1a9123c924383168c0db48646ef34059d
2021-05-20 17:32:46 -07:00
Mady Mellor
83f4345f9e Merge "Fix transitions in the background when launching something in TaskView" into sc-dev 2021-05-20 22:55:00 +00:00
Nataniel Borges
8aaaeea849 Split flicker tests into groups
The flicker test suite grew and now trigger a treehuger SLO violation. To address this problem create different groups for different tests using: --module-arg <TEST SUITE>:include-annotation:<GROUP>

Where:
   <TEST SUITE> = FlickerTests or WMShellFlickerTests
   <GROUP> = com.android.server.wm.flicker.annotation.Group1 or com.android.server.wm.flicker.annotation.Group2 or com.android.server.wm.flicker.annotation.Group3

For example:

1) to run only tests in the first group in flicker use: `--module-arg FlickerTests:include-annotation:com.android.server.wm.flicker.annotation.Group1`

2) to run only the third group of tests from wmshell flicker: ``--module-arg FlickerTests:include-annotation:com.android.server.wm.flicker.annotation.Group3`

Bug: 180620475
Test: atest FlickerTests WMShellFlickerTests with the respective parameters
Change-Id: I82f668713ba262bafe2758e2c618bfc060cc2c8a
2021-05-20 09:36:44 +02:00
Wei Sheng Shih
c56f67e7d9 Merge "Delete the delay for keeping tasksnapshot on screen." into sc-dev 2021-05-20 01:26:29 +00:00
Hongwei Wang
c81fdf89d7 Merge "Add test for move PiP upon Display change" into sc-dev 2021-05-20 01:07:00 +00:00
Mady Mellor
9abaa3be2c Fix transitions in the background when launching something in TaskView
* Allow bounds to be set on launch params for multiwindow activities
* Users of TaskView should pass bounds when starting an activity
  otherwise they will see this animation
* Modify bubbles & controls to pass launch bounds

Test: atest TaskLaunchParamsModifierTests LaunchParamsControllerTests
MultiWindowTests
Bug: 182299605
Bug: 182516248
Change-Id: Ie5337593d776309f8aac0c6991cf846463e519a7
2021-05-19 15:13:17 -07:00
Hongwei Wang
ea24f4c7ab Add test for move PiP upon Display change
Bug: 184941272
Test: atest PipControllerTest
Change-Id: I61372311c0e81c7d6b5dedd49d48b3738b796585
2021-05-19 12:50:02 -07:00
wilsonshih
532c5a42fb Delete the delay for keeping tasksnapshot on screen.
Tasksnapshot window can block touch event so user may not able
to touch the screen after showing task snapshot. Remove the delay
so app window can response touch event as soon as possible.

Bug: 187227846
Test: atest TaskSnapshotWindowTest
Change-Id: I5fb0fa3a1e6a5e6210d3baf400a84c5892bd2e34
2021-05-19 14:54:01 +08:00
wilsonshih
de35559cb1 Prevent the splashscreenview be replaced after transfer starting window
The splashscreenview can be replaced if starting window was transferred
and the first starting window didn't added success.
There should verify the appToken before setViewSynchronized set the
splashscreenview back to the container.

Issue sequence:
- Start first activity A, core request to add a starting window for it.
- Start second activity B, core try to transfer starting window from A
to B but since the window haven't added back,  there will trigger to
add a new starting window for B.
- SystemUI add starting window to A but added fail because there was
transferred.
- SystemUI add starting window to B, success.
- Choreographer post setViewSynchronized to add view for A and B to the
container, because we only verify by taskId, so the SplashscreenView was
overwrite by A.
- After reveal animation finish, SplashScreenView#post will not be
executed because this view was not on screen.

Fixes: 188540606
Test: atest StartingSurfaceDrawerTests
Test: Open twitter from notification.
Change-Id: I894da75827556d3c1bc8bb0656196102de5a6847
2021-05-19 14:04:08 +08:00
Chris Li
b9034aba83 Merge "Determine whether to support activities in multi window (9/n)" into sc-dev 2021-05-19 05:47:41 +00:00
Chris Li
30248a1952 Determine whether to support activities in multi window (9/n)
When a Task is detached but is still stored as a recent Task, it should
be allowed to launched into split screen.

Bug: 176061101
Test: atest WMShellFlickerTests:EnterSplitScreenFromDetachedRecentTask
Test: atest WmTests:RecentTasksTest
Change-Id: Ic72901ca76f4acb6e68926062675ecc290b399be
2021-05-18 21:07:52 +00:00
Bill Lin
9e2013a5d2 Merge "Integrate OneHandedTutorialHandler with OneHandedState" into sc-dev 2021-05-18 00:25:32 +00:00
Jerry Chang
63e732e89e Merge changes from topic "staged_split_ime" into sc-dev
* changes:
  Adjust split layout with IME animation in split (5/N)
  Adjust split layout with IME animation in split (4/N)
  Adjust split layout with IME animation in split (3/N)
  Adjust split layout with IME animation in split (2/N)
  Adjust split layout with IME animation in split (1/N)
2021-05-17 17:00:59 +00:00