Commit Graph

416 Commits

Author SHA1 Message Date
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
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
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
Chris Li
f834092444 Allow non-resizable to enter split screen from recent
Before, LegacySplitScreen is not allowing non-resizable to enter split
screen. Now, it also checks supportsNonResizableMultiWindow.

Fix: 181377395
Bug: 176061101
Test: manual
Change-Id: Iae4c65b5c8b0a139dbf8af55caba9f6c99d1f470
2021-03-12 16:04:11 -08:00
Nataniel Borges
920cf61139 Merge "New enter pip assertion" into sc-dev 2021-03-12 16:35:46 +00:00
Nataniel Borges
575f4bf38f Merge "Generalize pip transitions and assertions" into sc-dev 2021-03-12 16:34:52 +00:00
Nataniel Borges
bfc834eeea Merge "Generalize apppairs assertions" into sc-dev 2021-03-12 16:34:42 +00:00
Nataniel Borges
9bc15837b6 Promote PIP postsubmit tests to presubmit
The tests have been stable for the past 2 weeks in postsubmit and can be promoted to presubmit

Test: atest FlickerTests:com.android.wm.shell.flicker.pip
Bug: 174238224
Change-Id: Ie7cbd56940e4b5eacd25ba38d1fd0a5966b9a7e9
2021-03-12 15:05:34 +01:00
Bill Lin
1041042873 Fix OHM DA Organizer do not update display bounds by orientation
Legacy code depend on getDisplayBounds() which obtain bounds from
current WindowMetrics, unfortunately, WindowMetrics's info is not
up-to-date due to DisplayChangeController.onRotateDisplay() callback
earlier than WindowMetrics get update.

When onRotateDisplay() callback, we rotate old display bounds by
the rotation policy manually.

Test: atest WMShellUnitTests
Bug: 182342712
Change-Id: I9ff91dd7e51417ee33d57327ca07203de52dbe33
2021-03-12 18:06:48 +08:00
Nataniel Borges
8923c65435 Merge "Log WM trace on frame instead of transaction" into sc-dev 2021-03-12 09:40:15 +00:00