Commit Graph

423 Commits

Author SHA1 Message Date
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
wilsonshih
4bd7f5a92b Use a blank splash screen for new task activity
Add a condition when launch activity from continuous package, consider
to show a blank splash screen since the activity might start from an
existing task, showing an icon on it might seems strange to user.

Bug: 183150443
Bug: 183108088
Test: atest StartingSurfaceDrawerTests ActivityRecordTests
Change-Id: Ia76648c291d602302725a1814991971a1d544549
2021-04-01 14:58:47 +08:00
Bill Lin
f9d740b0dc Merge "1/ Make One handed mode support multiple user switch" into sc-dev 2021-04-01 02:02:39 +00:00
Hongwei Wang
c5d831fea1 Flicker test for PiP and launcher shelf height
PipMovesInAllApps was intended to test the PiP window movement when the
shelf height of Launcher changes and breaks with the recent `Device
search` feature that opening all-apps in Launcher triggers both IME and
shelf height change.

Since PipKeyboardTest has covered PiP movement with IME, reimplement
this by launching a new app instead of going to all-apps and also rename
this test for its intention.

Bug: 184050344
Test: atest WMShellFlickerTests:PipShelfHeightTest
Change-Id: I102ea95e6e91c9707b73587282702b868eb705fb
2021-03-31 13:38:10 -07:00
Iver Hsieh
265b7d336f Make PipMotionHelper injectable
This change allows PipMotionHelper
and PipSnapAlgorithm can be injected
for customization.

Bug: 181956433
Test: manual test - test snapping PIP windows
      atest PipBoundsAlgorithmTest PipTaskOrganizerTest PipTouchHandlerTest
Change-Id: Ic6e54f178b40ae21f8e198d8953db619b3ac9ec4
2021-03-31 12:50:40 -07:00
Ben Lin
8b70910beb PiP: Ensure PiP menu layout updates are on Shell main thread.
Only the thread which created the menu view (shell main thread) can
update its view layout, so ensuring that it is executed in that sense.

Also moved setup work in PipController to Shell Main thread. Ideally
they should be in ShellInit, but that will need to wait until
tv.PipController can unify with PipController.

Bug: 182418859
Test: Enter PIP
Change-Id: Ib88fefb9320ab441715c6ef3d5cf4f80dc9f022f
2021-03-31 11:02:01 -07:00
Nataniel Borges
400197ade7 Merge changes from topic "remove-all-tasks" into sc-dev
* changes:
  Ensure apps not running on cold launch test
  Remove all tasks before flicker tests
2021-03-31 16:54:05 +00:00
Nataniel Borges
2935ef01dc Merge "Move Pip assertions to flickerlib" into sc-dev 2021-03-31 07:54:24 +00:00
Jorge Gil
5ec8620a0b Merge "Account for OHM offset during PIP drag corner resize" into sc-dev 2021-03-30 23:07:58 +00:00
Evan Rosky
0bdcf9b9c6 Merge "Add one-shot remote handler and remote runner interface" into sc-dev 2021-03-30 23:01:43 +00:00
Nataniel Borges
61c3ea1789 Move Pip assertions to flickerlib
Previously the assertions were part of WMShell, however it is easier to keep them in the library as they can be used in other projects

Test: atest FlickerTests WMShellFlickerTests
Bug: 162925924
Change-Id: Ia6ca7cce1da81be2b73166acce40218bc304a77a
2021-03-30 23:11:41 +02:00
Hongwei Wang
6c9640f8b3 Merge "Disable PipMovesInAllApps temporarily" into sc-dev 2021-03-30 19:27:00 +00:00
Nataniel Borges
ba72075844 Remove all tasks before flicker tests
Ensures no other tasks are executing (cleanup) when a flicker test states to mitigate flakiness

Test: atest FlickerTests WMShellFlickerTests
Bug: 162925924
Change-Id: I84f712c8aba13ac845b9467f6c9753bc91e21a27
2021-03-30 21:19:08 +02:00
Hongwei Wang
722871b3e4 Disable PipMovesInAllApps temporarily
Test's currently failing due to the new `device search`, disable for
now to unblock presubmit and re-enable once we have a working solution.

Bug: 184050344
Test: atest WMShellFlickerTests:com.android.wm.shell.flicker.pip
Change-Id: I6b75ea213b442400090ee0a3f2b7e46ee5ecd395
2021-03-30 17:01:41 +00:00
Nataniel Borges
edd2a68464 Merge "Introduce a subject to assert changes over rectangles" into sc-dev 2021-03-30 12:26:23 +00:00
Wei Sheng Shih
744b9f18fd Merge "Catch getDrawable throw exception when add splash screen window." into sc-dev 2021-03-30 08:03:39 +00:00
Bill Lin
f18a7b0bc1 1/ Make One handed mode support multiple user switch
Previously OHM did not support for multile user switch
Now we hook SysUI onUserSwitch callback to update
latest one handed mode functionality by currentUserId

Test: atest SystemUITests
Test: atest WMShellUnitTests
Test: manually switch user and observe verify different OHM config
      for different users
Bug: 182278800
Change-Id: I8ae7d0aedcafc8f477f41d2703df2df53839a89f
2021-03-30 15:46:19 +08:00
wilsonshih
c79329e7b6 Catch getDrawable throw exception when add splash screen window.
Catch for hidden resource not found exception.

Fix: 183277667
Test: atest StartingSurfaceDrawerTests
Change-Id: Ie1c25b044c6617f13025ccb7f6b43f3a2ee8c0e6
2021-03-30 10:35:02 +08:00
Nataniel Borges
887a3c9d38 Introduce a subject to assert changes over rectangles
In several flicker tests it is necessary to check if a window or layer position is moving or resizing.

To facilitate these checks this CL introduces RectSubject (accessible through WindowStateSubject and LayerSubject) to assert rectangle behaviors

Bug: 174238224
Test: atest FlickerTests WMShellFlickerTests
Change-Id: Id568fd9dbd59f176eeb84323c321553221932685
2021-03-29 22:33:41 +02:00
Bill Lin
52a3bb48ca Integrate DisplayLayout for One handed mode
1) Handle rotation
2) Initialize DisplayLayout in dagger and update when
   onDisplayAdded() & onDisplayRemoved()
3) Refact OneHandedTouchHandler
4) Refact OneHandedBackgroundPanelOrganizer
5) Refact OneHandedDisplayAreaOrganizer

Test: atest WMShellUnitTests
Bug:182899148
Bug:182633327
Bug:183172404
Bug:183489178
Bug:183559944
Bug:183065937
Bug:183005910
Bug:183063280
Bug:183162084
Bug:181423645
Bug:177497107
Change-Id: Ie7a4fa97df5f6a3963a55bd507d36e026e971bab
2021-03-25 07:32:58 +00:00
Evan Rosky
eae6c92d2a Add one-shot remote handler and remote runner interface
This is the shell-transitions equivalent to RemoteAnimationRunner.

The OneShot handler is a utility to directly tie one call of a
remote transition to a specific transition (via
Transitions.startTransition) or as a general holder of a remote
for shell to use (taking care of binder lifetime and wrapping
callbacks).

Bug: 182002789
Test: ShellTransitionTests#testOneShotRemoteHandler
Change-Id: Ia405b133b18b4f132c8c841e74a6a264561df5a3
2021-03-24 19:56:45 -07:00
jorgegil@google.com
de49b9c6b9 Account for OHM offset during PIP drag corner resize
The InputEventReceiver in PipResizeGestureHandler receives
global coordinates in its events (i.e. screen coordinates)
that need to be translated into the PIP's window position.

Bug: 172839150
Test: enter PIP, enter OHM, drag resize
Change-Id: If5aaa8940904046ffc2303574e272601589a1638
2021-03-24 11:09:52 -07:00
wilsonshih
9d1ce22f88 Pre-draw AdaptiveIconDrawable and cache it before doFrame
The AdaptiveIconDrawable can spend much time which will impact the
time for first window drawn. But usually there is a small time
between setContentView to doFrame, we can use this gap to pre-draw
the AdaptiveIconDrawable and cache it since we already know the size
and it won't change anymore.

Bug: 173975965
Test: atest StartingSurfaceDrawerTests SplashscreenTests
Change-Id: I759de2e1b4025dd150532f3fd5c67d1b404f56a0
2021-03-22 14:54:31 +08:00
Winson Chung
d3d61ffefe Merge changes from topic "shell_feature_interfaces_reland" into sc-dev
* changes:
  2/ Add mechanism to expose other features directly
  1/ Add mechanism to expose shell feature directly (for Pip)
2021-03-19 06:55:31 +00:00
Chris Li
667d242404 Merge "Fix non-resizable split flicker tests" into sc-dev 2021-03-19 03:19:26 +00:00
Chris Li
c40cb1103a Fix non-resizable split flicker tests
1. Update the flag of DEVELOPMENT_ENABLE_NON_RESIZABLE_MULTI_WINDOW
during tests.

2. Before, the tests only checked whether the app window/layer became
visible/invisible, which could also happen during opening recent. Now,
we also check the visibility at the end.

Bug: 182235458
Test: atest WMShellFlickerTests
Change-Id: Ibc7b359d600a0e4105cc3a84b3111d59813eb9f1
2021-03-18 13:35:54 -07:00
Mady Mellor
651be19f5c Merge "Remove the explicit callback, not all of them" into sc-dev 2021-03-18 20:29:50 +00:00
Winson Chung
caa6d6484f 2/ Add mechanism to expose other features directly
- Expose interfaces for splitscreen, one handed, shell transitions,
  starting window
- Make the shell code only reference the starting window controller and
  not the exported interface

Bug: 180074017
Test: atest WMShellUnitTests
Test: Verify Pip calls from Launcher work
Change-Id: Idafed90a8ed3382adfb4322b4b1797237be86a90
2021-03-18 20:12:07 +00:00
Nataniel Borges
a4c5870608 Merge "Promote stable PIP app tests to presubmit" into sc-dev 2021-03-18 16:54:07 +00:00
Tiger Huang
1c7a274367 Merge "Let insets can still be controlled if its window bounds is moved" into sc-dev 2021-03-18 15:27:57 +00:00
Bill Lin
8a612f73e2 2/ Do not access SettingProvider in test code
- Refactor OneHandedSettingsUtil.java
- Remove redundant test for SettingProvider

New policy: b/175024829
Settings key: <one_handed_*> is not readable.
From S+, new public settings keys need to be annotated
with @Readable unless they are annotated with @hide.

Recent changes :
ag/13764747 Remove @Readable for hidden fields added in S

Test: atest WMShellUnitTests
Bug: 183064974
Change-Id: I85bf3680cbcdba4c85aa96de058bc85cfabead46
2021-03-18 18:14:22 +08:00
Nataniel Borges
1a3724eced Promote stable PIP app tests to presubmit
These flaky tests have been stable for the past week and can be promoted

Test: atest WMShellFlickerTests:com.android.wm.shell.flicker.pip
Bug: 171049720
Bug: 167521849
Change-Id: Ibd78e9d9e53a5712ca781b265b1b65c830a74c08
2021-03-18 11:10:32 +01:00
Bill Lin
801a654427 Do not access SettingProvider in test code
New policy: b/175024829
Settings key: <one_handed_*> is not readable.
From S+, new public settings keys need to be annotated
with @Readable unless they are annotated with @hide.

Recent changes :
ag/13764747 Remove @Readable for hidden fields added in S

Test: atest WMShellUnitTests
Bug: 183064974
Change-Id: I185491189a3804d7038be3c117583ab571e7a961
2021-03-18 15:07:15 +08:00
Mady Mellor
8b7afff3ef Remove the explicit callback, not all of them
Test: manual - expand / collapse / switch between bubbles
      works fine
Bug: 181896441
Change-Id: Ib724b2195aeb7748ade669964a65394e61f675a5
2021-03-16 18:31:11 -07:00
Tiger Huang
7faf533fb3 Let insets can still be controlled if its window bounds is moved
Insets source window can be moved by the display area policy so that
the window would not on the edge of the display. This makes the window
cannot provide insets to the display frame. The default animation uses
the display frame to compute insets, so the moved types cannot be
animated properly.

This CL adds an insets hint to InsetsSourceControl. It is the insets
computed from its owning window bounds. With the insets hint, the insets
animation can be played regardless of the display frame.

This CL also fixes an issue that the insets animation would be played in
the wrong direction by the fixed-rotation window.

Bug: 175775686
Fix: 181939099
Fix: 163018915
Test: atest ImeInsetsSourceConsumerTest InsetsAnimationControlImplTest
            InsetsControllerTest InsetsSourceConsumerTest
            DisplayImeControllerTest
      WindowInsetsTests (manual)
Change-Id: Ic6a8a215bd9b3a3b1af18e425dabe803c9be323e
2021-03-16 23:33:31 +08:00
Nataniel Borges
89740805f3 Merge "Remove Snapshot and Splash Screen from consecutive entry check" into sc-dev 2021-03-16 14:14:02 +00:00
Nataniel Borges
8b15b01c43 Remove Snapshot and Splash Screen from consecutive entry check
It is already possible to ignore windows/layers on the verification of  visibleWindowsShownMoreThanOneConsecutiveEntry and visibleLayersShownMoreThanOneConsecutiveEntry. However many tests need to manually add the Snapshot and Splash Screen entries.

Those entries are not guaranteed to show for more than 1 entry, they depend on the app behavior and when the SF actually renders the information sent by WM.

This CL removes those windows by default from the verification and refactor the tests to make it easier to update in the future

Test: atest FlickerTests WMShellFlickerTests
Bug: 182720234
Change-Id: I0e3346e078515b3e9a2065256ac04696acfa59fb
2021-03-16 10:26:55 +01:00
Bill Lin
8dc4ecd2c8 Merge "Fix OHM DA Organizer do not update display bounds by orientation" into sc-dev 2021-03-15 23:06:36 +00:00
Winson Chung
e3e90bd0c4 Merge changes from topic "revert-13608835-shell_feature_interfaces-HRAUSTBFGW" into sc-dev
* changes:
  Revert "1/ Add mechanism to expose shell feature directly (for Pip)"
  Revert "2/ Add mechanism to expose other features directly"
2021-03-15 20:46:18 +00:00
Winson Chung
a33a496a6f Revert "2/ Add mechanism to expose other features directly"
Revert "Add shell aidl files"

Revert "Update starting window init call for CarLauncher"

Revert submission 13608835-shell_feature_interfaces

Reason for revert: SysUI Studio aidl import issue
Reverted Changes:
I49a5a0419:2/ Add mechanism to expose other features directly...
I19425896d:Update starting window init call for CarLauncher
If048d2cd9:1/ Add mechanism to expose shell feature directly ...
Ibb8365d3c:Add shell aidl files
Ie41b0b77a:Update calls to go through the feature interface i...

Change-Id: I8bacc844fc3f0447311b5a97c4d356f2fb80f3ce
2021-03-15 17:52:25 +00:00
Nataniel Borges
1f9f16f880 Merge "Promote PIP postsubmit tests to presubmit" into sc-dev 2021-03-15 16:03:48 +00:00
Chris Li
3c2c7d9b42 Merge "Allow non-resizable to enter split screen from recent" into sc-dev 2021-03-13 22:31:52 +00:00
Winson Chung
b7e0678d36 Merge changes from topic "shell_feature_interfaces" into sc-dev
* changes:
  2/ Add mechanism to expose other features directly
  1/ Add mechanism to expose shell feature directly (for Pip)
2021-03-13 19:13:21 +00:00
Winson Chung
8e76243e57 2/ Add mechanism to expose other features directly
- Expose interfaces for splitscreen, one handed, shell transitions,
  starting window
- Make the shell code only reference the starting window controller and
  not the exported interface

Bug: 180074017
Test: atest WMShellUnitTests
Test: Verify Pip calls from Launcher work
Change-Id: I49a5a0419996754e5e154df7af1e475268035a5a
2021-03-12 21:22:51 -08:00