Commit Graph

400 Commits

Author SHA1 Message Date
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
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
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
wilsonshih
11af33eeaf Fix several test failures for the new starting window.(10/N)
1. Register TestStartingWindowOrganizer to mock add/remove starting
window.
2. Do not show starting window if not occluded.
3. Add ReadFrameBuffer permission so Car can get TaskSnapshot.
4. Correct package path for shell.startingsurface.
5. Do not show starting window for home type.

Bug: 73289295
Bug: 131311659

Test: atest TaplTestsLauncher3
Test: atest WmTests StartingSurfaceDrawerTests TaskSnapshotWindowTest
Test: atest CtsWindowManagerDeviceTestCases
Change-Id: I89930d2e8a05cca6197c36c780ee1843fe454354
2021-03-12 04:08:56 +00:00
wilsonshih
d52e491d2f Implement default exit animation for splash screen.(9/N)
Implement default exit animation on the view of splash screen, there
will be a two layers switch happen when playing exit animation. For
the detail please reference
go/improved_app_launch_animations and go/app-startup

Note: For this version we skip shift-up animation, need to fix the
flicker test so we can enable it.
Note2: Fix the possible missing splash screen view issue, but could
make the first window draw slower, keep tracking.

Bug: 73289295
Test: build/flash
Test: check splash screen starting window.
Test: atest StartingSurfaceDrawerTests ShellTaskOrganizerTests
WindowOrganizerTests SplashscreenTests

Change-Id: I796811d010ac70f256169dd03d5e05ef0ed79d28
2021-03-12 03:46:15 +00:00
Jorge Gil
fa63935a61 Merge "Update PIP menu accessiblity bounds when it is moved" into sc-dev 2021-03-10 23:51:52 +00:00
Nataniel Borges
c0da8c3f13 New enter pip assertion
Rename previous assertion to "pip app always visible" and create a new one asserting that pip window becomes visible

Test: atest FlickerTests:com.android.wm.shell.flicker.pip
Bug: 167521701
Change-Id: I237c8369b58a766b60f4eb96b7dc465e86f96679
2021-03-10 15:29:14 +01:00
Nataniel Borges
41b7c17297 Generalize pip transitions and assertions
Share code and assertions between the transitions to improve maintainability

Test: atest FlickerTests:com.android.wm.shell.flicker.pip
Bug: 167521849
Change-Id: Ie24ac84e0ffcaa6ef786865b9f5d5220fea4263f
2021-03-10 14:07:31 +01:00
Nataniel Borges
8cbe35fa80 Generalize apppairs assertions
Share code and assertions between both transitions to improve maintainability

Test: atest FlickerTests:com.android.wm.flicker.apppairs
Bug: 167521849
Change-Id: I591a6eda408a169d92732f8c1497fef51b27797f
2021-03-10 14:06:35 +01:00
Nataniel Borges
3f0a1f40a5 Merge "Fix enter pip parameters" into sc-dev 2021-03-10 10:37:29 +00:00
jorgegil@google.com
a5547def07 Update PIP menu accessiblity bounds when it is moved
Bug: 179337864
Test: atest PipHomeTest
Change-Id: I37ffbade283861f0013f29a86855146fd2c012de
2021-03-09 16:18:14 -08:00
Bill Lin
d6a9853d3b Merge "Fix OneHandedGestureHandler incorrect InputMonitor behavior" into sc-dev 2021-03-09 08:19:08 +00:00
Wei Sheng Shih
db3d82a4e3 Merge "Starting window performance tuning.(8/N)" into sc-dev 2021-03-09 08:00:12 +00:00
wilsonshih
11598e8243 Starting window performance tuning.(8/N)
Create splashscreen thread with priority -10 in shell for starting
window controller, the definition is moved from
AMS#TOP_APP_PRIORITY_BOOST to Process#THREAD_PRIORITY_TOP_APP_BOOST.

Create and set SplashScreenView object on the starting window after the
first simple view on the starting window drawn, in this way the
transition can be prepare early than wait the actually view was draw,
which can save some time.

Bug: 73289295
Bug: 131311659
Test: atest StartingSurfaceDrawerTests ShellTaskOrganizerTests
Test: atest SplashscreenTests
Change-Id: Ibb430a66d6b329e74d62de047fbf37205cb66a96
2021-03-09 11:13:03 +08:00
Hongwei Wang
63b565d61f Merge "Use SyncTransactionQueue in PiP" into sc-dev 2021-03-08 23:05:20 +00:00
Mady Mellor
e15c6dd81a Merge changes from topic "mm_setSuppress" into sc-dev
* changes:
  SysUI changes for setSuppressBubble
  Track locusId visibility in ShellTaskOrganizer
  Add locus id to ActivityRecord / TaskInfo
  Bubble API: suppress bubble
2021-03-08 21:27:36 +00:00
Nataniel Borges
0e77adca1a Fix enter pip parameters
Enter pip is not a rotation test and should use the non-rotation configuration

Test: atest FlickerTests:com.android.wm.shell.flicker.pip.EnterPipTest
Bug: 167521701
Change-Id: I0df35bdc08e7ac9c07bdf7f55398004076966410
2021-03-08 16:10:46 +01:00
Bill Lin
908c5afb30 Fix OneHandedGestureHandler incorrect InputMonitor behavior
1) Fix CTS WindowInsetsBehaviorTests test fail in NavBar 3 Button mode
   When device set NavBar 3 Button mode, OneHandedGestureHandler
   will monitor the InputEvent and pilferPointers() over NavBar region
   and break WindowInsetsBehaviorTests
   a) systemGesture_excludeViewRects_withoutAnyCancel
   b) systemGesture_notExcludeViewRects_withoutAnyCancel

2) In landscape, disposeInputChannelInputMonitor in OneHandedGestureHandler

3) Add dump in OneHandedGestureHandler for bugreport

Test: atest android.systemui.cts.WindowInsetsBehaviorTests
Test: manual test check the UX feel good on 3 Button mode
Bug: 181025710
Change-Id: I4c30578f45e5a569d7b5a1698d3d30229cecb13f
2021-03-08 11:20:07 +08:00
Jason Chang
90f3cd927a Merge "Refactor to use WindowManager#getCurrentWindowMetrics() instead of using Display#getRealSize()" into sc-dev 2021-03-06 08:04:52 +00:00