Commit Graph

1172 Commits

Author SHA1 Message Date
Bill Lin
9e2013a5d2 Merge "Integrate OneHandedTutorialHandler with OneHandedState" into sc-dev 2021-05-18 00:25:32 +00:00
Bill Lin
a92eeb798d Merge "Update divider touch-region with DividerHandle position properly" into sc-dev 2021-05-18 00:23:46 +00:00
Ben Lin
4e04b705e3 Merge "PiP: Damp resizing after going over max size." into sc-dev 2021-05-17 18:00:08 +00:00
Ben Lin
54441572a9 Merge "PiP: Use vertical/horizontal padding base on PiP orientation." into sc-dev 2021-05-17 17:59:39 +00:00
Ben Lin
750ddcc618 Merge "PiP: Constrain pinch-resize input to start inside PiP bounds." into sc-dev 2021-05-17 17:58:23 +00:00
Jorge Gil
29a2e2480a Merge "Skip finishResize for non-exit animation if PIP is about to exit" into sc-dev 2021-05-17 17:24:11 +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
Riddle Hsu
65782cf2c1 Merge "Use matrix to scale icon for splash starting window" into sc-dev 2021-05-17 11:45:54 +00:00
Winson Chung
79914dfbd5 Merge "Add fallback animation for auto-enter without source rect hint" into sc-dev 2021-05-14 23:44:23 +00:00
Chris Li
b4aec6206f Merge "Determine whether to support activities in multi window (8/n)" into sc-dev 2021-05-14 22:28:18 +00:00
Chavi Weingarten
1b0e20108d Merge "Add CAPTURE_BLACKOUT_CONTENT permission" into sc-dev 2021-05-14 16:28:43 +00:00
Riddle Hsu
43a4cb2ecd Use matrix to scale icon for splash starting window
Originally the cost would increase in proportion to the size.
Now the draw time becomes almost irrelevant to size. And the
visual appearance is almost the same as previous approach.

The icon draw time:
 News  : 32ms -> 10ms
 Clock : 46ms -> 23ms
 Dialer: 30ms -> 14ms

Bug: 187104264
Test: OpenAppMicrobenchmark
Change-Id: I9edeb367c671315374f8579bf3b91dc778bad302
2021-05-14 23:47:41 +08:00
Bill Lin
01015deb6b Integrate OneHandedTutorialHandler with OneHandedState
Previously if user do not trigger OHM, target view was attached
to window and setVisbility INVISIBLE.
Refactor to improve memory & perforamcne for systemui, and align
the state changes of one handed controller

1) Bind OneHandedController OneHandedState to handle target view
   attach and remove from window.
2) Do NOT create view and attach to window until STATE_ENTERING,
   remove legacy redundant visibility change flow.
3) Detach view from window when STATE_NONE
4) Refine OneHandedState static field definition
5) Consolidate OneHandedTutorialHandlerTest

Test: atest WMShellUnitTests
Test: atest OneHandedTutorialHandlerTest
Test: adb shell dumpsys activity service com.android.systemui
Test: adb shell settings put secure one_handed_tutorial_show_count 0
Test: manual trigger OHM
Test: Trigger OHM and invoke onConfigurationChanged()
Bug: 185558765
Change-Id: I3e9666e2379bceb23e3f80f0d8617a7884100a72
2021-05-14 19:24:30 +08:00
Jason Chang
e8b62e4d23 Merge "(1/n) Disabling OHM gesture in NavigationBar 3 Button mode" into sc-dev 2021-05-14 07:40:34 +00:00
Jerry Chang
c0302f5092 Merge "Only reparent controlling tasks when entering split" into sc-dev 2021-05-14 04:53:16 +00:00
Jerry Chang
68667bdd3a Merge "Fix wrong split bounds in legacy split flicker tests" into sc-dev 2021-05-14 02:29:18 +00:00
jorgegil@google.com
fa915cb52c Skip finishResize for non-exit animation if PIP is about to exit
This handles the case were exitPip is called while there is a
animateResize PIP ongoing, such the menu expand/unexpand animation.
When that was the case, the first finishResize was applied at the same
time as the exit WCT, resulting in bad frames at the end of the exit
animation.
This CL makes it so that the first finishResize is skipped if we
know exitPip is handling the exit and will eventually call its
own finishResize operation.

Bug: 185306679
Test: enter PIP with YT, tap on menu to show it and immediately
tap on the app launcher icon to expand PIP - verify the exit
transtion runs smoothly

Change-Id: I230a94b53d2a96331021c1ea49510caa92fa991e
2021-05-13 12:00:27 -07:00
Jerry Chang
80d67949a2 Only reparent controlling tasks when entering split
Only move split controlling tasks to split secondary root when entering
split. So that it could align with launch root rule while in split.

Fix: 187892355
Test: enter split screen while having assist type task in recent,
observed it won't reparent assist type task to split-secondary-root.

Change-Id: I648dc74e2e44d62a0e40d50b29b08dd23b85ed26
2021-05-14 01:38:36 +08:00
Bill Lin
fc0278f740 Update divider touch-region with DividerHandle position properly
Context : ag/11948950
The divider view itself isn't really relayouted (because now
it's surface just gets moved around). This means we actually
need to update its touch region when moving the surface instead
of in relayout. Additionally, because the views themselves
don't move, update the touch-region from divider position
instead.

What changes:
After onLayout() mHandle has the final position on screen,
we reference mHandle's left or top position based on orientation
and update for corresponding touch-region

Test: atest WMShellUnitTests
Test: Enable A11y talkback, check the divider handle can be focused
Test: add log in notifySplitScreenBoundsChanged() check the split
      handle touch region dose NOT locate at screen left or top edge

Bug: 175687842
Change-Id: I7530e3e1daa373926654c3ae8bc2084566650d62
2021-05-13 17:48:00 +08:00
Jerry Chang
93edc1eae5 Fix wrong split bounds in legacy split flicker tests
Fix: 188013792
Test: passed presubmit
Change-Id: I675633a078d172f9c8cd836980658c4f2aa2d246
2021-05-13 16:23:42 +08:00
Winson Chung
8aa6016bb3 Add fallback animation for auto-enter without source rect hint
- Launcher will create a new surface which is faded in over the app,
  and as it finishes the recents animation, we transfer the overlay
  from the leash to the task (as with the transform), and when the
  pip task organizer receives it, it can fade out and remove the
  surface
- Fixes flash of status bar colors when going from light status bar
  to home (dark status bar) by deferring whether a task affects the
  sysui flag until it enters pip (only for autoenter)

https://recall.googleplex.com/projects/e3f080d7-2818-43f0-a087-405000b8fdf5/sessions/971a84c8-a622-4b34-a9de-4e595595da42

Bug: 184703546
Test: Swipe up from app with auto-enter but no source hint rect

Change-Id: I0a00cdb98d0a599ef065206e0cd2cfc0e6cc72b1
2021-05-12 23:53:25 -07:00
Wei Sheng Shih
a9cbf391e0 Merge "Enable app reveal animation after splash screen." into sc-dev 2021-05-13 01:40:49 +00:00
Jason Chang
1d1ea541f0 (1/n) Disabling OHM gesture in NavigationBar 3 Button mode
1) UX mentioned the swipe gesture in 3-Button NavgationBar area
may confuse user from taping NavBar buttons(Back, Home, Recents).
They decide to disable the swipe gesture and allow user to trigger
One Handed Mode(3 Button Mode) through A11y shortcut.
However, user can still use OHM by enabled shortcut button on
both Gesture Navigation & 3-Button mode.

2) OHM gestural handler consume the touch event while window
Magnification overlap with NavigationBar area in 3-button mode,
this result Magnification function can no long obtain the control.

Bug: 184903678
Bug: 179648683

Test: manual
Test: atest WMShellUnitTests
Change-Id: Ib9a06e19d749707e6f5e08c3ef803c1681f86bbc
2021-05-13 08:47:56 +08:00
chaviw
fb796315ed Add CAPTURE_BLACKOUT_CONTENT permission
Added a permssion to allow an application to capture screenshots of
layers that would normally be blacked out.

Test: Builds, screenshots still work as before
Test: ScreenshotTests
Bug: 173746627
Change-Id: I27237c8e340904cbaa82c7e5793de35cab85d8de
2021-05-12 18:00:36 -05:00
Chris Li
806b5b8ed6 Merge "Determine whether to support activities in multi window (5/n)" into sc-dev 2021-05-12 22:37:41 +00:00
Ben Lin
4c21ac8f33 Merge "PiP: Update menu state AFTER animation is done for show/hide/resize." into sc-dev 2021-05-12 21:34:48 +00:00
Ben Lin
8c39ee10d3 Merge "PiP: Recheck condition to pass input to menu." into sc-dev 2021-05-12 21:33:01 +00:00
Leon Scroggins III
4dda15cd27 PIP: Always enable rounded corners
Bug: 187922869

Previously, we turned on rounded corners with a sysprop in
bf309e63d4. Now that a bug in rendering
them in landscape has been fixed, remove the sysprop and always use
the rounded corners radius specified in the xml file.

Change-Id: Ib0f61bbcbee6ead82beec2b149b0892836492b78
2021-05-12 10:37:43 -04:00
Jordan Demeulenaere
ac3b62b2d0 Merge "Scale splash screen icon by 1.2 instead of 1.3" into sc-dev 2021-05-12 13:19:10 +00:00
Jordan Demeulenaere
c970b02ee0 Enable app reveal animation after splash screen.
Bug: 184830058
Test: Open an app
Change-Id: I91746ebb8fd86d4db8c94a42712da094009d49be
2021-05-12 10:21:32 +00:00
Ben Lin
dcecbaed57 PiP: Recheck condition to pass input to menu.
This used to be OR (pip is not stashed), but it should be AND.

Bug: 186499713
Test: Double tap on where the play button should be even when the menu
is not visible, no longer pauses

Change-Id: If8e101286ddfbb83caf0d6a85a1089e6c257f996
2021-05-11 16:23:40 -07:00
Sunny Goyal
b04efdff70 Merge "Removing generalization from OneHandledAnimationController" into sc-dev 2021-05-11 16:20:44 +00:00
Jordan Demeulenaere
4acb22437c Scale splash screen icon by 1.2 instead of 1.3
Bug: 186847483
Test: Open an app
Change-Id: I889df24a8a39bafa3c4c5eec6b14536a7cc804a2
2021-05-11 17:15:54 +02:00
Chris Li
375ce7fe52 Determine whether to support activities in multi window (8/n)
Dismiss multi window from Shell if the task no longer supports multi
window.

Bug: 176061101
Test: manually test with fold/unfold
Change-Id: Ie8bdb70ed63805c6e51a20e6db8f02e91f18dd35
2021-05-11 04:21:40 +00:00
Chris Li
43d99647e4 Determine whether to support activities in multi window (5/n)
Update Task/ActivityRecord to use the new elgibility check and update
tests

Bug: 176061101
Test: pass existing
Change-Id: Ibb78a43d5901a604b02904be0a0bfdc6da0eb421
2021-05-11 04:20:49 +00:00
Riddle Hsu
81e85863e5 Merge "Skip creating config context if it is the same as current" into sc-dev 2021-05-11 04:15:57 +00:00
Hongwei Wang
57618b94ef Merge "Unify round corner radius in PipSurfaceTransactionHelper(s)" into sc-dev 2021-05-11 03:23:11 +00:00
Ben Lin
620ee55cc3 PiP: Damp resizing after going over max size.
Video: http://recall/-/gu5DjQFZPMFpwgaXdl4cV3/ehwIIonDvQwp5qqdgCtfBO
Bug: 187752281
Test: Manual
Change-Id: I10422869e2ea566f12782685cc78e0bd547c4007
2021-05-10 15:38:20 -07:00
Ben Lin
b0748625e6 PiP: Use vertical/horizontal padding base on PiP orientation.
Since not all paddings are created the same, let's respect the correct
top/bottom or left/right pair based on PIP orientation.

Bug: 187525862
Test: Open vertical PIP, rotate to landscape, maximize PIP - respects
maximum space now

Change-Id: Ib04ac72328e246302b45fe6630dc01d0c081cfcc
2021-05-10 12:57:07 -07:00
Jordan Demeulenaere
0cd1d01d63 Merge "Polish the app reveal animation." into sc-dev 2021-05-10 14:09:51 +00:00
Jerry Chang
aebdc015e0 Adjust split layout with IME animation in split (5/N)
Adjust split bounds to match the IME animation.

Fix: 179262787
Test: atest WMShellUnitTests
Test: observed split bounds been offset properly when rotating devices
or changing focus while IME showing.

Change-Id: I70d8cdf5a019f77873a75bc0881b1c100b372664
2021-05-07 14:30:23 +08:00
Bill Yi
bca4acc749 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I0fb1a33648fe6a9f57a7f1412ad03164eebacb0b
2021-05-07 04:29:30 +00:00
Jerry Chang
64049c4e00 Adjust split layout with IME animation in split (4/N)
Update split surface dim value to match IME animation.

Bug: 179262787
Test: atest WMShellUnitTests
Test: manual checks split surface dim properly with IME animation.

Change-Id: I17c03def1a7e19d6bdbfc44fa846da4b1efa3275
2021-05-07 12:26:12 +08:00
Jerry Chang
5d2533cdfc Adjust split layout with IME animation in split (3/N)
Listen to IME position changes in SplitLayout to make sure it updates
divider view status after re-inflated. Also add functions to get IME
position of split which is needed for integrating IME animation with
new split implementations.

Bug: 179262787
Test: atest WMShellUnitTests
Test: observed divider bar won't change to interactive after rotating
devices with IME shown.

Change-Id: Ic01c23e61ffb666cfc292e56dd6dcf4646be749b
2021-05-07 12:09:23 +08:00
Jordan Demeulenaere
37a3c61b82 Polish the app reveal animation.
This CL polishes the app reveal animation after a cold start. It does so
by:

1. Fading out the icon during 233ms before revealing the app, as spec'ed
   in the direct [1].
2. Animating the reveal gradient opacity from 0 too 100% (instead of
   starting at 100% opacity directly).

See b/184830058#comment7 and #comment13 for before/after videos.

[1] https://direct.googleplex.com/#/spec/241550001

Bug: 184830058
Test: atest SplashscreenTests StartingSurfaceDrawerTests
Change-Id: Ie4561887a259eec398f8f347050f27a094026945
2021-05-06 15:25:55 +02:00
Vadim Caen
279e06697b Merge "Support enable default splash screen reveal aninatmion" into sc-dev 2021-05-06 10:03:56 +00:00
Riddle Hsu
0c54f2192f Skip creating config context if it is the same as current
If the launching app is fullscreen on default display, the task
config should be the same as current global config. Then it is
unnecessary to create a context again.

Use diffPublicOnly because task config may have specified windowing
mode, which won't affect resources resolving.

It saves up to 4ms when adding splash screen starting window.
Also simply the initialization a bit.

Bug: 187104264
Test: OpenAppMicrobenchmark
Change-Id: I2bc7e8dfba3b1d8ad501f6935080a86f2c45f032
2021-05-06 16:15:29 +08:00
Jerry Chang
4c425b2a1e Adjust split layout with IME animation in split (2/N)
Add surface utils to help establishing dim surface layer for splits.

Bug: 179262787
Test: atest WMShellUnitTests
Change-Id: I0c268e0b1891fddcf717e8e54e0d29acbf8c5f24
2021-05-06 13:14:57 +08:00
Jerry Chang
dda6e07e4b Adjust split layout with IME animation in split (1/N)
Update StagePosition to more general SplitPosition so that it could be
shared among split implementations.

Bug: 179262787
Test: atest WMShellUnitTests
Change-Id: I6f461fac62d350f50171136f079cb0254b06d767
2021-05-06 13:14:37 +08:00
Riddle Hsu
a54290f36b Merge "Load icon of splash screen only once" into sc-dev 2021-05-06 02:28:59 +00:00