Commit Graph

466 Commits

Author SHA1 Message Date
Bill Lin
f94486117f Merge changes from topic "ohm-shortcut" into sc-dev
* changes:
  3/ Listen ONE_HANDED_MODE_ACTIVATED for A11y shortcut action
  2/ Implement Shortcut for One Handed mode feature
2021-05-05 23:43:12 +00:00
Bill Lin
02f635462b Merge "OneHandedUiEventLoggerTest sometimes flaky" into sc-dev 2021-05-04 10:12:06 +00:00
Bill Lin
214bff101f Merge "Refactor OHM to use (float)offset for translating windows" into sc-dev 2021-05-03 09:49:20 +00:00
Bill Lin
eb9b719bc5 3/ Listen ONE_HANDED_MODE_ACTIVATED for A11y shortcut action
- Observe ONE_HANDED_MODE_ACTIVATED secure settings key
- Skip action when OneHandedState is in transition
  1. STATE_ENTERING
  2. STATE_EXITING
- Skip action if current OneHandedState = request activate
  1. STATE NONE -> Shortcut request ACTIVATED : StartOneHanded
  2. STATE_ACTIVE -> Shortcut request non ACTIVATED : StopOneHanded
  3. STATE_NONE -> Shortcut request non ACTIVATED : SKip
  4. STATE_ACTIVE -> Shortcut request ACTIVATED : Skip
- Controller will update latest state to secure setting
  ONE_HANDED_MODE_ACTIVATED either trigger by gesture or shortcut

Test: atest WMShellUnitTests
Test: enable shortcut and click
Bug: 182425480
Change-Id: I03bd2679a5a08801efc9868148adfddef87171f4
2021-05-03 15:04:24 +08:00
Bill Lin
0fd7baaf31 OneHandedUiEventLoggerTest sometimes flaky
Check : go/wm-tests

Ignore the unit tests until the better approach available

Test: atest WMShellUnitTests
Bug: 184813408
Change-Id: I3139afa58ed15c535a55822504c3331771f1bfdf
2021-05-03 12:45:33 +08:00
Ben Lin
7fc1313d39 Merge "PiP: Take inset into consideration when calculating stash offset." into sc-dev 2021-04-29 22:51:26 +00:00
Chris Li
f9c4ee1fd3 Merge "Move legacy split screen flicker tests for non-resizable to presubmit" into sc-dev 2021-04-29 17:49:15 +00:00
Nataniel Borges
8a26f00f1f Merge "Fix pip window visibility assertions" into sc-dev 2021-04-29 15:51:59 +00:00
TreeHugger Robot
c8a0871269 Merge "Disable flaky app pair assertions" into sc-dev 2021-04-29 15:18:23 +00:00
Nataniel Borges
4b2f1da126 Fix pip window visibility assertions
1) Fix `Could not find: PipApp`, the test previously used the launcher name, instead of the window name for assertion

2) The command previously missed a `verify` call to actually execute the assertion

Bug: 186115871
Bug: 186445782
Test: atest FlickerTests WMShellFlickerTests
Change-Id: Ie9274e273bcda2be24491705cd28d7dc0d5ea5db
2021-04-29 12:02:31 +02:00
Bill Lin
57f37bf143 Refactor OHM to use (float)offset for translating windows
The core function of OHM is translate all windows down
instead of resize, it's unnecessary to set WCT & app bounds
that will introduce DA require to cache configuration in
DAInfo as well as handle configuration changes stuffs

This change ensure App Compat mode works good:
- Remove wct.setBounds() & wct.setAppBounds()
- Use float instead of bounds for transition/animation
- Remove unused code
- Reset setWindowCrop(leash, -1, -1) after rotate
- Reset setCornerRadius(leash, -1) after rotate
- Add dump() for OneHandedAnimationController
- Add dump() for OneHandedSurfaceTransactionHelper

Test: atest WMShellUnitTests
Test: maunal trigger OHM, rotate, and obseve function works
Bug: 184091042
Bug: 181091031

Change-Id: I401d9b8a79a2a1526b8683362a1e0330458141b1
2021-04-29 12:14:29 +08:00
Ben Lin
a4c8a3c524 PiP: Take inset into consideration when calculating stash offset.
When stashing, currently it assumes the entire display is usable - not
taking into insets into consideration that can be caused by navigation
bar, etc.

Bug: 186698828
Test: Manual. Stashing PIP while w/ insets now stashes correctly.
Test: atest PipSnapAlgorithmTest
Change-Id: Ia6cbb8f21b666a4ba4ee10b84e3087b6a23cd982
2021-04-28 19:31:40 -07:00
Chris Li
328079de27 Merge "Determine whether to support activities in multi window (1/n)" into sc-dev 2021-04-29 01:09:53 +00:00
Ben Lin
cabb4a0317 Merge "PiP: Add ResizeGestureHandlerTest." into sc-dev 2021-04-28 20:59:04 +00:00
Chris Li
2e02036650 Move legacy split screen flicker tests for non-resizable to presubmit
Fix: 182235458
Test: pass existing
Change-Id: Ia139972beae25fcb60dc68c11c2d50efc38e00cf
2021-04-28 16:46:58 +00:00
TreeHugger Robot
4a44c4f4d7 Merge "Fix duplicate bubbles in the overflow" into sc-dev 2021-04-28 14:47:52 +00:00
TreeHugger Robot
da2192eacf Merge "Disable flaky pip/app close tests (flicker)" into sc-dev 2021-04-28 10:13:57 +00:00
Nataniel Borges
d825929c73 Disable flaky app pair assertions
Assertion is flaky in presubmit

Bug: 186510496
Test: atest FlickerTests WMShellFlickerTests
Change-Id: Ic796c86d555376283adbcdb06ea80c6d9ddbfe07
2021-04-28 10:05:16 +02:00
Chris Li
cde271685f Determine whether to support activities in multi window (1/n)
Add a field of supportsMultiWindow to TaskInfo for WM Shell to use.

Because we will change to Task#supportsMultiWindow to check the
support based on the root activity's resizibilty, min widht/height,
and the device settings, using this to replace the check in
ActivityTaskManager, which is pure device settings.

Bug: 176061101
Test: atest WMShellFlickerTests
Change-Id: Iad94b39506e71b6224d923f02bd7fc454cae02c8
2021-04-27 23:59:38 -07:00
Mady Mellor
495b7069c6 Fix duplicate bubbles in the overflow
* If something was added to the overflow that was already there
  make sure to remove it from the list first
* Did this in data & in update adapter to be safe

Bug: 181890793
Test: atest BubbleDataTest
Change-Id: I2a576911e0f3791768536f4a866d7174f55a0a2d
2021-04-27 17:00:44 -07:00
Chris Li
4bc72c96db Merge "Fix EnterSplitScreenNotSupportNonResizable flaky" into sc-dev 2021-04-27 19:50:35 +00:00
Nataniel Borges
73e2773099 Disable flaky pip/app close tests (flicker)
Some tests are still flaky and affecting presubmit

Bug: 185400889
Test: atest FlickerTests WMShellFlickerTests
Change-Id: I477799646791c69b71c6f29d71e87caba900a983
2021-04-27 14:58:56 +02:00
Ben Lin
c5dbf031fe PiP: Add ResizeGestureHandlerTest.
Bug: 180525424
Test: atest PipResizeGestureHandlerTest
Change-Id: Ibfca3f9d8b5b8f50a1b79f74d2348824ac052746
2021-04-26 14:25:17 -07:00
Riddle Hsu
dc4c8ea3f5 Merge "Support PiP with fixed rotation" into sc-dev 2021-04-26 00:18:29 +00:00
Chris Li
55a68d161b Fix EnterSplitScreenNotSupportNonResizable flaky
Before, it called openQuickstep before canSplitScreen, but the later one
is also calling openQuickstep. This caused the recent is pressed twice
to introduce the flakness.

Test: atest WMShellFlickerTests:EnterSplitScreenNotSupportNonResizable
Bug: 182235458
Change-Id: Iba5af5114fd8883b73d78ac34e6f891ee8ca798f
2021-04-23 21:50:14 -07: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
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
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
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
Chris Li
a3e28dec2c Merge "Fix flaky legacy split screen flicker tests" into sc-dev 2021-04-21 03:07:15 +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
Jorge Gil
81c20075fe Merge "Add tests for PIP exclusion bounds updates" into sc-dev 2021-04-20 14:28:33 +00: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
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
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
Wei Sheng Shih
9dea87c0d1 Merge "Starting window performance tuning for binder block." into sc-dev 2021-04-19 01:33:24 +00:00
wilsonshih
6298f2c046 Starting window performance tuning for binder block.
- Pass TaskSnapshot to Shell directly.
- Parallel process: create a splash screen worker thread to create the
splash screen view and pre-draw the icon drawable, and use splash
screen thread to do stuff about window's lifecycle like add/remove
window. We don't use shell main thread here so the starting window
won't blocking any task execute on main thread.
- Trigger addStartingWindow directly when startActivity, also
removeStartingWindow directly without post the animation thread.
- Do not defer addStartingWindow for prepare surface, on the contrast
it should be execute before prepare surface.
- Remove ActivityRecordTests#testAddRemoveRace, it wasn't been test as
expected because in original logic the add and remove starting window
are post to animation thread, so the test was actually testing on
handler#postAtFrontOfQueue and handler#removeCallbacks.
For now it will only cause OutOfMemoryError.

Bug: 183665220
Bug: 182836977
Test: atest StartingSurfaceDrawerTests SplashscreenTests
Change-Id: Ie9a529c7d81f07f923394eb69944518f3e9010ce
2021-04-16 11:04:38 +08:00
Nataniel Borges
f226bc0878 Remove quicksearchbox from home window list
Previously Winscope considered only the `isVisible` property to determine if the window was visible or not. This failed in cases such as `com.google.android.googlequicksearchbox/android.app.ContextImpl` when launching apps, where `isVisible=true` and `alpha=0`

Bug: 181630910
Bug: 182720234
Test: atest FlickerTests WMShellFlickerTests
Change-Id: I75fab0c6de02e43265002986901353f8e230baa5
2021-04-15 17:50:34 +02:00
Nataniel Borges
6788d2b5d6 Merge changes from topics "3button-runner", "re-enable-flicker" into sc-dev
* changes:
  Disable some trace assertions
  Fix use of NavigationModeRule on flicker
2021-04-14 08:35:07 +00:00
Nataniel Borges
c258d7f4ca Disable some trace assertions
Previously some assertions didn't run on the whole trace because of a missing `forAllEntries` statement in the library. When activating this statement these tests fail and should be disabled.

Test: atest FlickerTests WMShellFlickerTests
Bug: 183547024
Bug: 181630910
Change-Id: I28f92e2d9de1a5465a4da5971c438bc4c0b311f9
2021-04-13 20:55:39 +02:00
Nataniel Borges
e852b071ff Fix use of NavigationModeRule on flicker
The method was ignored before and now should be activated to enable 3 button mode. Some tests become flaky in 3-button mode and should be disabled for the moment.

Test: atest FlickerTests WMShellFlickerTests
Bug: 162925924
Change-Id: Ife24ad85c302da6fc193f1a5a226722cfed51b2b
2021-04-12 15:15:56 +02:00
Evan Rosky
2bc5bd5168 Add shell transition handling for staged split-screen.
This makes StageCoordinator implement the TransitionHandler
interface.

In general, this currently expects 'enter' transitions to
contain 2 tasks (one in each split). The current UX is undefined
when one only one of the splits is occupied, so for now it will
throw an exception if that case is hit.

There is a split-screen API called startTasks which takes a list
of tasks (currently only supports 2) and associated options and
creates a transition to both enter split-screen and launch those
tasks into their respective stages.

These are the currently accounted-for entrypoints into
the handler interface:

- Core-initiated (handleRequest)
  - in split: trigger=HOME that is opening -> full dismiss.
  - in split: trigger=task with a stage parent that is last closing in
                    that stage -> dismiss with other stage onTop
  - NOT split: trigger=task with stage parent -> exception
- Shell-initiated
  - NOT split: startTasks -> enter split with 2 tasks
  - in split: snap-to-dismiss -> dismiss with other stage on top

Bug: 182002789
Test: atest SplitTransitionTests
      Or use the experimental pair-launch split-screen and observe
      protologs to see clean transition-infos.
Change-Id: I4f4dd431ad5642cf98b4a01c32eb1d09e5b9a11e
2021-04-09 13:13:56 -07:00
Jason Chang
c16a826d85 Merge "Fix Talk back announces "Exit one handed mode" on every orientation change though one-handed mode is off" into sc-dev 2021-04-08 23:46:39 +00:00
Jason Chang
327e463a30 Fix Talk back announces "Exit one handed mode" on every orientation
change though one-handed mode is off

Add more condition check when Talk back announce one-handed mode
related.

Bug: 182475904
Test: manual
Test: atest WMShellUnitTests
Change-Id: I0644146eaa6d7d6701af94fe6caceee5e6c3be8b
2021-04-08 12:19:58 +08:00
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
Darryl Johnson
6b7f69ef38 Merge "Make PipMotionHelper injectable" into sc-dev 2021-04-02 06:18:44 +00:00
Ben Lin
085035f9cc Merge "PiP: Ensure PiP menu layout updates are on Shell main thread." into sc-dev 2021-04-01 17:44:52 +00:00
Hongwei Wang
313a5ed5fa Merge "Flicker test for PiP and launcher shelf height" into sc-dev 2021-04-01 16:26:44 +00:00