Commit Graph

1030 Commits

Author SHA1 Message Date
TreeHugger Robot
929d2ce07d Merge "Support FLAG_ACTIVITY_LAUNCH_ADJACENT for launch root with adjacent" into sc-dev 2021-04-27 00:03:34 +00:00
Jerry Chang
d8abe76ba1 Support FLAG_ACTIVITY_LAUNCH_ADJACENT for launch root with adjacent
Add window container transaction APIs to indicate launch root for task
launching with FLAG_ACTIVITY_LAUNCH_ADJACENT. If launch adjacent flag
root is available, consider to launch to its adjacent task if the launch
is coming from the same root task.

Fix: 169271875
Test: atest WMShellUnitTests
Test: atest TaskDisplayAreaTests
Test: manual test FLAG_ACTIVITY_LAUNCH_ADJACENT behavior with adjacent
root.

Change-Id: I1716aaa48745d2c32cd413c8eac0b1d17810f0de
2021-04-27 01:07:50 +08:00
Sergey Nikolaienkov
5a3ebc03f3 Introduce StartingWindowTypeAlgorithm interface
Extracting StartingWindowTypeAlgorithm static nested class within
StartingWindowController into StartingWidnowTypeAlgorithm interface and
PhoneStartingWindowTypeAlgorithm class that implemets the interface.

Adding an alternative implementation - TvStartingWindowTypeAlgorithm, for
use on TV. The TV implementation always returns StartingWindowTypeAlgorithm.

Setting up TvWMShellModule and WMShellModule to provide the TV and the
Phone implementations respectively.

Also removing a redundant StartingWindowController constructor.

Bug: 182759603
Test: make SystemUI
Change-Id: I10bab125320a9cdc9e3ddaedad1c74930b681fa6
2021-04-26 11:36:41 +00:00
Riddle Hsu
dc4c8ea3f5 Merge "Support PiP with fixed rotation" into sc-dev 2021-04-26 00:18:29 +00:00
Riddle Hsu
25457d4257 Support PiP with fixed rotation
Add 2 cases with rotation change:
(a) Enter PiP from fullscreen.
    http://recall/-/d6GxE5mVL8Ww2IPnx7Nk0o/hDfmdrhrBFjJNOdi1s66OW
(b) Launch fullscreen app with the existing PiP.
    http://recall/-/d6GxE5mVL8Ww2IPnx7Nk0o/bUpHZ6Sh98zKZJnRM7oFy9

Steps of (a):
1. Task#setWindowingMode to PiP. If the next fullscreen activity
   will change display orientation, start fixed rotation on it.
   And start deferring orientation change.
2. PipTaskOrganizer#onFixedRotationStarted is called to mark it
   will be a special case.
3. PipTaskOrganizer#onTaskAppeared is called and starts the PiP
   rotation animation by animateResizePip with rotated destination
   bounds from rotated DisplayLayout.
4. When onPipAnimationEnd, use WCT#scheduleFinishEnterPip to notify
   that the animation is done, so the deferred orientation change
   can continue to update (PinnedTaskController#setEnterPipBounds).
   The end transaction of animation (reset matrix) is deferred
   until fixed rotation is finished. Also freeze the PiP task
   configuration one time, to avoid extra configuration change
   (letterboxed) by rotation change.
5. The seamless rotation starts, the PiP surface is transformed
   to previous rotation based on the bounds of previous step. So
   the PiP task can show the same orientation as rotated display.
   The frozen flag of PiP task configuration is cleared.
6. PipTaskOrganizer#onFixedRotationFinished is called. The final
   PiP destination bounds and the deferred transaction of step 4
   will be sent to WM.

Steps of (b):
1. Fixed rotation happens (PipTaskOrganizer#onFixedRotationStarted)
   when there is an existing PiP. Apply fade-out animation.
2. PipTaskOrganizer#onMovementBoundsChanged is called to update
   rotated destination bounds.
3. PipTaskOrganizer#onFixedRotationFinished is called to apply
   fade-in animation with new bounds.

Other changes:
- WCT#scheduleFinishEnterPip was used to set bounds and notify
  windowing mode change. That is already done by other config
  change oepration of WCT. So this redundant operation is changed
  to be a signal to notify that the PiP animation is done.
- Ignore calculating letterbox bounds for PiP activity because
  it should fill the task.
- Add PinnedTaskController#DEFER_ORIENTATION_CHANGE_TIMEOUT_MS
  to avoid using alpha animation after swiping from any task.
- Consider source rect hint with rotation.

Bug: 165794724
Bug: 175836469
Test: DisplayContentTests#testFixedRotationWithPip
      PipAnimationControllerTest#pipTransitionAnimator_rotatedEndValue

Change-Id: I2c26b5d93996193caaf020bd0e2314c8e1789545
2021-04-23 20:16:55 +08:00
Bill Lin
4add47c730 Merge changes I741b1915,Ida2f23da into sc-dev
* changes:
  2/ Migrate isInOneHanded() in OneHandedState
  1/ Add OneHandedState to manage the transition flow
2021-04-23 08:37:07 +00:00
Tony Huang
faa060ae15 Merge "Make AppTransition animations sharable (3/n)" into sc-dev 2021-04-23 04:03:10 +00:00
TreeHugger Robot
7ebc50ac8c Merge "Disable flaky flicker tests" into sc-dev 2021-04-23 02:38:16 +00:00
Ben Lin
f0572fd733 Merge "PiP: Don't invoke double-tap gesture (maximize) if menu is showing." into sc-dev 2021-04-22 22:27:25 +00:00
Chavi Weingarten
0498394f3e Merge "Use BLAST layer for snapshot starting windows" into sc-dev 2021-04-22 18:52:39 +00:00
Nataniel Borges
91b6830e38 Disable flaky flicker tests
Some tests are still flaky and affecting presubmit

Bug: 185400889
Bug: 186119282
Bug: 186115871
Test: atest FlickerTests WMShellFlickerTests
Change-Id: Ie4e21d01d5ea7586f88470543321ce26ed74afa6
2021-04-22 19:10:04 +02:00
Evan Rosky
d1d54a14ef Merge "Initial implementation of merge-able transitions" into sc-dev 2021-04-22 17:04:13 +00:00
Tony Huang
1c7fcdb9ca Make AppTransition animations sharable (3/n)
Handle animation include keyguard, voice interaction and relaunch
in default shell transition.

Bug: 178678389
Test: manual
Change-Id: I45e3f400bc3537bbbcd9d45f388312b8fe962579
2021-04-22 14:49:16 +08:00
Wei Sheng Shih
2ddcaeb425 Merge "Add luminance condition to validate color contrast." into sc-dev 2021-04-22 03:21:43 +00:00
Bill Lin
be632ac364 Merge "1/ Add onStartTransition() callback for SYSUI_STATE_ONE_HANDED_ACTIVE" into sc-dev 2021-04-22 00:40:23 +00:00
Bill Lin
0b4a445568 2/ Migrate isInOneHanded() in OneHandedState
It's make sense to let controller manage function states,
and left organizer handle leash & transition stuffs.

Move isInOneHanded() in OneHandedState.java

Controller can get STATEs throught organizer callback:
 - onTransition()
 - onStartFinish()
 - onStopFinsih()

Test: atest WMShellUnitTests
Bug: 185558765
Change-Id: I741b191557ed8e8ca85184d75a7bd8a2573e9b7c
2021-04-22 08:16:04 +08:00
Bill Lin
8a8f117280 1/ Add OneHandedState to manage the transition flow
1) Define STATEs flags for OHM CUJ:
    STATE_NONE               (0)
    STATE_ENTERING           (1)
    STATE_ACTIVE             (2)
    STATE_EXITING            (3)

STATE_NONE->STATE_ENTERING->STATE_ACTIVE->STATE_EXITING

- Default = STATE_NONE
- When user trigger OHM        = STATE_ENTERING
- When user is in OHM          = STATE_ACTIVE
- When user exit OHM           = STATE_EXITING
- When user finish exiting OHM = STATE_NONE

2) Unbound one handed mode state from OHMDAOrganzier
- Move isInOneHandedMode() to OneHandedState

Test: atest OneHandedStateTest
Test: atest WMShellUnitTests
Test: manual test
Bug: 185558765
Change-Id: Ida2f23da6c4df9cbcf6903ffc9ad07fcfc73bbcb
2021-04-22 08:12:29 +08:00
Sergey Nikolaienkov
f4c17d8f4c Remove WmShell's min_sdk and lint-baseline.xml
Removing min_sdk_version for WmShell since it's not meant to be backward
compatible.
Removing lint-baseline.xml which only contains "NewApi" errors, that
won't be generated now, since min_sdk_version has been removed.

Bug: 182759603
Test: make WmShell
Change-Id: I38e4814581d6c6a8aeb8d66b1b554a5bac331f68
2021-04-21 23:00:26 +00:00
Evan Rosky
3fef7ff6e2 Initial implementation of merge-able transitions
This adds a couple things to support "merging" of transition
animations in shell.

1. Moves the finishing surface operations into a transaction that
   gets sent to shell. This does a couple things: it complies with
   the contract we have where during a transition, only the player
   should touch relevant surfaces; and, it makes it so that the
   player can merge the transaction with other ones.

2. Keeps a queue of "pending" transition animations in shell and
   either merges them or runs them serially.

3. Any transition that becomes ready while another is playing will
   first be sent to the playing handler to give it a chance to
   "merge" the incoming transition.

There are 3 expected responses to overlapping transition animations:
1. Cancel the currently playing transition and immediately start
   the incoming one. This can be achieved by having the currently
   playing transition cancel itself (ie. immediately finishing) when
   a merge request comes in. Then the rest of the shell transition
   logic will immediately start the next transition.

2. Queue up the incoming transition to play once the current one
   finishes animating. This is basically the default as long as
   the current transition simply rejects/ignores merge requests

3. Merge the incoming transition. This is achieved when the
   currently playing transition actually does some special logic
   to handle the incoming transition. It then calls the finish
   callback for the incoming transition (before it finishes its
   own animation) to indicate that it has been merged (or "consumed").
   Basically, any time the finish callback for a transition is
   called before a pre-ceding transition, that transition is assumed
   to have been merged.

Bug: 183994113
Test: atest ShellTransitionTests
Change-Id: I3cb54e221d57642306ddf15827c21d8881b014d0
2021-04-21 10:00:28 -07:00
Bill Lin
3e20856215 1/ Add onStartTransition() callback for SYSUI_STATE_ONE_HANDED_ACTIVE
Previously in launcher quick steps, when one handed mode trigger
the gesture is easy to conflict "swipe up Recents" and
"swipe horizontal for quick switch", we only consume gesture when
SYSUI_STATE_ONE_HANDED_ACTIVE=true, however, user have a bad
experience when one handed transitioning conflict to "swipe up
to launch recents".

Legacy design :
  onStartFinished() : SYSUI_STATE_ONE_HANDED_ACTIVE -> true
  onStopFinished()  : SYSUI_STATE_ONE_HANDED_ACTIVE -> false

New design :
  onTransition()    : SYSUI_STATE_ONE_HANDED_ACTIVE -> true
  onStartFinished() : SYSUI_STATE_ONE_HANDED_ACTIVE -> true
  onStopFinished()  : SYSUI_STATE_ONE_HANDED_ACTIVE -> false

Test: atest WMShellUnitTests
Bug: 177978035
Change-Id: Iac9612b2eb07606712a4ab3eb036ac6fd3d12ae3
2021-04-21 16:33:01 +08:00
Chris Li
a3e28dec2c Merge "Fix flaky legacy split screen flicker tests" into sc-dev 2021-04-21 03:07:15 +00:00
Kyunglyul Hyun
05df0a936c Merge "Revert^2 "Change PlaybackState#isActiveState to isActive"" into sc-dev 2021-04-21 01:56:15 +00:00
Winson Chung
839b9a1147 Merge "Skip some unnecessary allocations" into sc-dev 2021-04-21 00:17:01 +00:00
TreeHugger Robot
466a9e2b68 Merge "Turn on rounded corners on PIP with a flag" into sc-dev 2021-04-20 23:24:00 +00:00
Mady Mellor
681f269d78 Merge changes from topic "global_to_secure" into sc-dev
* changes:
  Fix bubbles for workprofile
  Sysui bubbles multiuser fixes: persistence / overflow
  Move bubble setting to secure table & support multiuser
2021-04-20 23:06:40 +00:00
Ben Lin
6e6e6b5162 Merge "Add Activity#onPictureInPictureUiStateChanged and PictureInPictureUiState." into sc-dev 2021-04-20 17:45:38 +00:00
wilsonshih
82e484b4c3 Add luminance condition to validate color contrast.
Reference WCAG to calculate color contrast via luminance, add this as
one condition for similar color validate.

Bug: 184830058
Test: atest SplashscreenTests
Change-Id: I93bad2a8ff813036e71757e50f82b6d0ea7f81d5
2021-04-20 16:00:31 +00:00
Wei Sheng Shih
8fdd1d8780 Merge "Let windowSplashScreenBackground work independent from icon." into sc-dev 2021-04-20 15:32:03 +00:00
Jorge Gil
81c20075fe Merge "Add tests for PIP exclusion bounds updates" into sc-dev 2021-04-20 14:28:33 +00:00
Mady Mellor
26d226301c Fix bubbles for workprofile
- use getPackageManagerForUser when looking up app info
- add test for it

Bug: 184041127
Test: atest BubblesTest
Test: - have a managed work profile
      - install the bubbles app *only* for the work profile
      - make some bubbles
      => Notice bubbles appear
      - dismiss all the bubbles
      - restart the device, add a bubble
      - open the bubble, navigate to the bubble overflow
      => notice the previously dismissed workprofile bubbles
        are in the overflow
Change-Id: I479bb717b3c365346682331b0def7170ed1a791b
2021-04-19 18:51:01 -07:00
Mady Mellor
bac16b93bc Sysui bubbles multiuser fixes: persistence / overflow
* Persist bubbles per-user - rather than one list the
  XML now has a list per-user. The entries in these lists
  still include userId for workprofile since bubbles are
  mixed in the stack / overflow for workprofile.
* When loading bubbles, only the ones for the current user
  are loaded / hit bubbleController code
* When user changes, overflow data should be re-loaded
* Allow the bubble window to be visible for all users

Test: atest BubbleXmlHelperTest BubbleVolatileRepositoryTest
BubblePersistentRepositoryTest BubblesTest
Bug: 173408780

Change-Id: I88cb7cc7ee676d8e0756328a95a54fdaf018a013
2021-04-19 18:51:01 -07:00
wilsonshih
25ddb677b6 Let windowSplashScreenBackground work independent from icon.
The API windowSplashScreenBackground should work even when starting
window controller request to create an empty icon splash screen.

Bug: 182759603
Test: atest SplashscreenTests
Change-Id: I0c8178f27663f92acfdd0da8d216ff7ae94db981
2021-04-20 09:49:25 +08:00
Chris Li
1ca437909f Fix flaky legacy split screen flicker tests
Bug: 182235458
Test: pass existing
Change-Id: I20e957b0bfcacb37c1ad72b4a8cea155eeee911a
2021-04-19 18:25:26 -07:00
chaviw
cc6cdbc9de Use BLAST layer for snapshot starting windows
Test: Snapshot starting window uses blast and works
Bug: 170765639
Change-Id: Iab1e5cf200e02509d3ab72cb3f04e788e1c1aa38
2021-04-19 18:06:27 -05:00
Leon Scroggins III
bf309e63d4 Turn on rounded corners on PIP with a flag
Bug: 163076219
Test: manual

Use the flag "debug.sf.enable_hole_punch_pip" (also used by
I56e2a6debce6ede4bebfcbd32bffa01c20461542 to activate using a hole punch
to render the rounded corners) to turn on rounded corners even if
config_pipEnableRoundCorner is set to false.

This will allow testing the feature until we can turn it on.

Change-Id: I2719f8ac151895874ab22e4cd7e64c9e1dc9eac8
2021-04-19 16:01:23 -04:00
jorgegil@google.com
a50e0e791d Add tests for PIP exclusion bounds updates
Bug: 176302696
Test: atest PipTaskOrganizerTest && atest PipBoundsStateTest
Change-Id: I7de14865cc944d35452dedc054ad917afd2ecb18
2021-04-19 10:11:17 -07:00
TreeHugger Robot
0540a18e26 Merge "Add permission check for TvPipNotification" into sc-dev 2021-04-19 16:55:21 +00:00
Kyunglyul Hyun
b4e519caf4 Revert^2 "Change PlaybackState#isActiveState to isActive"
This reverts d077dbf438
because the issue was resolved.

Bug: 161331016
Test: m lint-check
Change-Id: Ic4a2025407caeb6d41db3b84a293dc249f77ad0b
2021-04-19 07:11:57 +00:00
Wei Sheng Shih
9dea87c0d1 Merge "Starting window performance tuning for binder block." into sc-dev 2021-04-19 01:33:24 +00:00
Bill Yi
9234f7086d Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: If4d473b60d373922663727fc2bca6bf73ac9cff7
2021-04-17 18:04:51 -07:00
Jason Chang
7833cf0af4 Merge "Fix screen will flicker when swipe-down around NavigationBar to trigger One-Handed mode many times quickly in a short time" into sc-dev 2021-04-17 10:23:09 +00:00
Jason Chang
3a77d720e9 Fix screen will flicker when swipe-down around NavigationBar to
trigger One-Handed mode many times quickly in a short time

To prevent entering or exiting OHM quilcky in a shot time.

Bug: 185304468
Test: manual
Test: atest WMShellUnitTests
Change-Id: Ibc5ade564da241d5871b3b037c97bd68a6b03a5d
2021-04-17 01:50:18 +08:00
TreeHugger Robot
db9210da53 Merge "Import translations. DO NOT MERGE ANYWHERE" into sc-dev 2021-04-16 17:06:51 +00:00
TreeHugger Robot
7c21c82dcb Merge "Import translations. DO NOT MERGE ANYWHERE" into sc-dev 2021-04-16 16:27:54 +00:00
Jason Chang
fbe969c925 Merge "Fix metrics didn't log ONE_HANDED_TRIGGER_GESTURE_OUT logs when NavigationBar type is Gesture Navi" into sc-dev 2021-04-16 14:26:03 +00:00
Bill Yi
278e113140 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I2d14138a84252d40e8d297f6e88a94c7be25f7da
2021-04-16 12:28:00 +00:00
Bill Yi
d3588352d6 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Ic6c358da64628996d3ca72f3837ba1cf2345f9e8
2021-04-16 12:09:21 +00:00
Jason Chang
6cb7c9515f Fix metrics didn't log ONE_HANDED_TRIGGER_GESTURE_OUT logs when
NavigationBar type is Gesture Navi

Write metrics gesture out event in stopOneHanded() callback.

Bug: 178445384

Test: manual
Test: Westworld metrics logger
Change-Id: Ifd358d2aeda1a518f184216674a304511e251100
Merged-In: Ifd358d2aeda1a518f184216674a304511e251100
(cherry picked from commit 688e89c65d)
2021-04-16 19:38:15 +08:00
TreeHugger Robot
502c75489d Merge "Remove quicksearchbox from home window list" into sc-dev 2021-04-16 10:22:35 +00:00
Winson Chung
e5b567749e Skip some unnecessary allocations
- Move new matrix/rect construction to if the param is set on the
  builder, we only apply the params if the flags are set anyways
  and if the caller doesn't set those params then we are allocating
  new objects unnecessarily
- Always recycle motion event

Bug: 183756396
Test: Take memory profile when dragging pip
Change-Id: Ie7457c8c508ee61bd27daeebe486c39a5cebe7d7
2021-04-15 22:53:02 -07:00