Commit Graph

423 Commits

Author SHA1 Message Date
Bill Lin
c952210248 2/ Fix flaky in WMShellFlickerTest legacySplitScreen tests
b/177374067 indicate OpenAppToLegacySplitScreenTest still flaky
1) Extend the filter in visibleLayersShownMoreThanOneConsecutiveEntry()
   - Toast window
2) When going split transition, waitForAppTransitionIdle() at end
3) Enable navBarLayerIsAlwaysVisible() & statusBarLayerIsAlwaysVisible()

Test: atest com.android.wm.shell.flicker.legacysplitscreen
Test: Set TEST_REPETITIONS to 100 and run flicker test stressfully
Bug: 177374067
Bug: 176923301
Bug: 176134495
Change-Id: I1caface176f4af591d5383877c81b786eb23ba58
2021-01-18 11:47:32 +08:00
Evan Rosky
c7bd598702 Merge "Add support for remote transition playback in shell transitions" 2021-01-15 18:23:09 +00:00
Evan Rosky
30f3544f65 Add support for remote transition playback in shell transitions
This adds IRemoteTransition interface for other processes (like
launcher) to register for playing transition animations.

Then there are 2 supported ways to "register":

1. Is to attach an IRemoteTransition to ActivityOptions. To
   support this pathway, requestStartTransition now takes a
   TransitionRequest object which can contain whatever info
   is needed at the time. One piece of that is the passed-in
   IRemoteTransition.

2. Is to register directly with shell (via systemuiproxy for
   now) with a TransitionFilter. This filter allows shell
   transitions to dispatch a transition to a remote without
   need to make queries over binder.

This also hooks up launcher animations by converting the new
transition info to the old RemoteAnimationTargetCompat stuff.

Bug: 169035082
Test: launch app from launcher and observe the icon animation.
      atest ShellTransitionTests
Change-Id: I8014a6f46cffda3a48a1a4ae101e2643078f4a14
2021-01-14 14:50:51 -08:00
Jerry Chang
d19771c9af Add double tap callback for divider bar
Add a callback in split layout to notify registered listener when users
double tapped the divider bar. Use this callback to switch side stage
position.

Bug: 176061049
Test: atest SplitLayoutTests
Test: manual check stage position changed when double tapped divider bar
Change-Id: Id3929b01a194b8eb0838cc892156bbbe48dc8690
2021-01-14 18:07:30 +00:00
Winson Chung
f74cdbed2f Merge changes I0ea9aae2,I369e83cb
* changes:
  5/ Update splitscreen to use shell main thread
  4/ Update HideDisplayCutout and AppPairs to use shell main thread
2021-01-14 03:38:50 +00:00
Wale Ogunwale
a0f9c56968 Merge "Additional interfaces for main/side stage split-screen model" 2021-01-13 22:17:35 +00:00
Evan Rosky
94c1b01e6e Finish incomplete merge
Bug: 177440160
Test: builds
Change-Id: Idfb134838e44a72e2c1eef31740e0e2eea47b6b8
2021-01-13 11:19:27 -08:00
Wale Ogunwale
8531eb85a4 Additional interfaces for main/side stage split-screen model
Add some more interfaces APIs for manipulating main/side stage
split-screen.
Also, renamed pinTask/unpinTask to moveToSideStage/removeFromSideStage
for consistency.

Test: Command line
Bug: 176061049
Change-Id: Ic5b909c42e027e6f4809931c6dc92af1bf79b050
2021-01-13 11:12:38 -08:00
Evan Rosky
f2a23c72aa Merge "Refactor default transit animations into handler for testing" 2021-01-13 18:23:05 +00:00
Wale Ogunwale
707fb0fbb6 Baseline support for main/side stage split-screen model
Bug: 175416931
Test: atest StageCoordinatorTests StageTaskListenerTests
Test: atest MainStageTests SideStageTests
Change-Id: Ib5f000599d09d6a07b559aa8a06e5786541f2324
2021-01-13 13:00:46 +08:00
Wale Ogunwale
f717288022 Merge changes from topic "reparentTasks"
* changes:
  1/ Refactor LegacySplitScreenTests
  Support WCT#reparentTasks and WCT#setLaunchRoot
2021-01-12 22:47:36 +00:00
Bill Lin
218868bb9a 1/ Refactor LegacySplitScreenTests
1) Separate NonResizable activity tests
2) Fix flaky in visibleWindowsShownMoreThanOneConsecutiveEntry
3) Fix flaky in OpenAppToLegacySplitScreenTest
4) Align implementation of ExitLegacySplitScreenFromBottomTest

Test: atest WMShellFlickerTests
Bug: 176897747
Bug: 176923301
Bug: 176134495
Change-Id: I1e3efdbb1645f6d1a77950101e2c9f5b34856a2f
2021-01-12 11:43:19 -08:00
Winson Chung
813664c88c 4/ Update HideDisplayCutout and AppPairs to use shell main thread
Bug: 161979899
Test: atest WMShellUnitTests
Change-Id: I369e83cbc85fea80b0db4d58ba8d05d12fbd09e3
2021-01-12 10:05:06 -08:00
Winson Chung
5b43185172 3/ Update OneHanded to use shell main thread
- Clean up some usages of handlers and explicit main loopers to use
  the shell executors
- Remove the update thread (will eventually move to the shell main thread)
- Make timeout handler non-static (it only has one instance at the moment)
- Post calls from shell back onto the sysui thread

Bug: 161979899
Test: atest WMShellUnitTests
Change-Id: I1db0f0d8e7f83eeb7e4581fb266ffd77aa73fea1
2021-01-12 10:05:03 -08:00
Winson Chung
8dd46b0ef1 Merge changes I3657efcc,Iabdf5ee9
* changes:
  Re-implement TvPipController
  Refactor .tv.PipNotification
2021-01-12 05:21:15 +00:00
Evan Rosky
1229c01a4e Refactor default transit animations into handler for testing
In order to make shell transitions testable, this makes the
default animations into a TransitionHandler. This is also cleaner,
more consistent, and will make expanding the default animations
easier later.

The reason this is needed is because animations themselves aren't
very amenable to testing, so to test the interface logic, we need
to be able to replace the default handler with one that simulates
just the contract of the default handler (don't claim any requests,
but always perform animation).

Also added some tests for both basic transition flow and for
the TransitionHandler contracts

Bug: 169035082
Test: atest ShellTransitionTests
Change-Id: I92e367af155831c11f583322e95151a2cb645caa
2021-01-11 19:33:20 -08:00
Jason Chang
21538ffb10 Merge "Fix after turning the Dark theme on, users can not clearly identify the screen has entered one handed mode" 2021-01-11 08:44:25 +00:00
Jason Chang
7e8e7441ee Fix after turning the Dark theme on, users can not clearly identify
the screen has entered one handed mode

Add a new DisplayArea feature color background layer to fix it.

Bug: 157124724

Test: manual
Test: atest WMShellUnitTests
Test: atest DisplayAreaPolicyBuilderTest
Change-Id: I16beddb182125551621d0083dba2f259140d7b78
2021-01-11 13:45:31 +08:00
Wei Sheng Shih
819c691ba3 Merge "Specify the default theme for splash screen window." 2021-01-11 03:10:49 +00:00
Yuncheol Heo
f3929238b0 Add TaskViewFactory.
- This CL also changes TV.setListener to have a separate Executor.

Bug: 165794075
Test: atest TaskViewTest BubblesTest NewNotifPipelineBubblesTest
Change-Id: Ib0324ec06d088694556f8cef6cee726d9789ce2c
2021-01-08 18:17:45 -08:00
TreeHugger Robot
feb8ef30aa Merge "2/ Migrate some common shell classes to use executors" 2021-01-08 23:26:57 +00:00
TreeHugger Robot
86cb49109a Merge "Mark mutability explicitly in tests" 2021-01-08 21:28:55 +00:00
Winson Chung
68d5d7cdfe 2/ Migrate some common shell classes to use executors
- Remove Handler usage in some (non-feature specific) shell code
(Note: The shell main thread will still be the sysui main thread)
- Add explicit executor for display organizer

Bug: 161979899
Test: atest WMShellUnitTests
Change-Id: I9a354f742167b907c32537eb022e22c0d5bfb97a
2021-01-08 11:17:03 -08:00
TreeHugger Robot
eab713e351 Merge "Do not click on TVs in PipKeyboardTest" 2021-01-08 19:13:12 +00:00
Mady Mellor
fd8a0240c0 Mark mutability explicitly in tests
Fixes: 176869010
Test: atest BubbleTest
Change-Id: I5ace7342b3c20cf2946f86ed463fe7ae40105820
2021-01-08 10:33:52 -08:00
Sergey Nikolaienkov
068369c26a Refactor .tv.PipNotification
Make TvPipNotificationController (formerly PipNotification) responsible
for handling broadcasts sent from the Pip StatusBarNotification.
Previouslt TV PipContoller was in charge of that.
Also, as mentioned above, rename PipNotification to
TvPipNotificationController.

Bug: 153784643
Test: atest WMShellFlickerTests:TvPipNotificationTests
Change-Id: Iabdf5ee9d464653e233aee9044ac8cbb26478dea
2021-01-08 15:31:36 +00:00
Sergey Nikolaienkov
bfc6604163 Do not click on TVs in PipKeyboardTest
Implement an alternative way of showing/hiding IME in PipKeyboardTest on
TV - via "re-launching" the ImeActivity with a particular action. The
original way - calling UiObject2.click() on the EditText does not work
well on TVs, because the touch events injected by the Instrumentation to
emulate the click force TV into the touch mode.

Bug: 176413558
Test: atest WMShellFlickerTests:PipKeyboardTest
Change-Id: Id3462eba548c8ed639ba44437db573928348c1e6
2021-01-08 15:30:15 +00:00
TreeHugger Robot
f1882fe75c Merge "Fix Tv Pip tests" 2021-01-08 11:21:34 +00:00
TreeHugger Robot
6581a7d0ac Merge "Fix and clean up Tv Pip Menu" 2021-01-08 09:44:55 +00:00
wilsonshih
aefbd7ba69 Specify the default theme for splash screen window.
By default if application didn't specify a theme, PhoneWindow will
get the default theme by Resources#selectDefaultTheme for itself
and currently it could be Theme_DeviceDefault_Light_DarkActionBar,
which will shows an ActionBar on splash screen window, and looks
bad for starting window.
For this case, use Theme_DeviceDefault_DayNight for splash screen
window should be a better choice.

Bug: 73289295
Test: atest StartingSurfaceDrawerTests
Change-Id: Ia47afcb26c7aaa7781a24e3fe8122e58901776dc
2021-01-08 15:03:38 +08:00
TreeHugger Robot
631135a9a8 Merge "Better IME transition while switching app with recents (3/N)" 2020-12-28 18:34:32 +00:00
Ming-Shin Lu
d579c94480 Better IME transition while switching app with recents (3/N)
- Add hasImeWindowSurface in TaskSnapShot
- Add InsetsSourceControl#getAndClearSkipAnimationOnce for skiping
      IME showing animation once when starting window with IME surface

Bug: 166736352
Bug: 153145997
Test: manual as below steps
    0) Enabling developer options -> Quick settings developer tiles ->
       Window animation scale to slow down transition animation.
    1) Launch an app with focusing an editor to show soft-input
    2) Swipe out app task to back to launcher
    3) Using quick switch or taping shortcut to bring back the app task
    4) Verify that should be no IME showing animation happens during
       task transition.

Change-Id: I83ffc03119e01da71ad12f8ad8043cf0730dfd50
2020-12-28 22:15:12 +08:00
Sergey Nikolaienkov
7599ffc7b0 Fix Tv Pip tests
Work around the eccentricities of the Accessibility framework on TV in
Pip tests.

Bug: 174818743
Test: atest WMShellFlickerTests:TvPipBasicTest
Test: atest WMShellFlickerTests:TvPipMenuTests
Test: atest WMShellFlickerTests:TvPipNotificationTests
Change-Id: I00e12c5e88a7c4a6e9f3c18d7c978288d28ab43c
2020-12-28 06:22:41 +00:00
Sergey Nikolaienkov
1991120975 Fix and clean up Tv Pip Menu
Fix for Tv Pip Menu not properly setting custom actions provided by an
application.
Fix Pip Menu not closing on the Home button press.
Simply and revise Tv Pip Menu implementation which now consists of 3
classes:
- TvPipMenuController
- TvPipMenuView (formerly PipMenuView)
- TvPipMenuActionButton (formerly PipControlButtonView)
and thus spare
- PipControlsView
- PipControlsViewContoller

Bug: 174818743
Test: atest WMShellFlickerTests:TvPipBasicTest
Test: atest WMShellFlickerTests:TvPipMenuTests
Test: atest WMShellFlickerTests:TvPipNotificationTests
Change-Id: I9e08ca142e0407a4ede084323b0201194a7e89b8
2020-12-28 06:22:41 +00:00
Bill Lin
2403df0482 Merge "6-2/ Integrate AppPairs flicker rotation tests" 2020-12-24 03:13:41 +00:00
Nataniel Borges
520883b15d Merge "Use WMStateHelper to waitFor transition" 2020-12-22 08:30:48 +00:00
Bill Lin
f7bb7555e0 6-2/ Integrate AppPairs flicker rotation tests
Bug: 172776659
Test: atest com.android.wm.shell.flicker.apppairs
Change-Id: I203c6f278fbdc7d22579df335580b6c358e7fc1e
2020-12-22 13:03:29 +08:00
Nataniel Borges
27b4b833f6 Use WMStateHelper to waitFor transition
Using the UI automator to wait for elements is unstable and occasionally triggers `android.os.DeadObjectException`

Using the activity manager state to wait for the device is a more reliable way of doing this

Bug: 175877007
Test: atest WMShellFlickerTests:com.android.wm.shell.flicker.pip.PipKeyboardTest -- --abi arm64-v8a
Change-Id: I0c838ea91e18cb6e9821efd85b05f507b131cc71
2020-12-21 21:45:54 +01:00
Sergey Nikolaienkov
7c6db063bc Filter out WmShellFlickerTests that are not supported on TV
By default all new WmShellFlickerTests are enabled on TV even despite
the fact that most of them focus the features that are not supported on
TV, and never been run on TV devices prior to adding. Some examples are:
com.android.wm.shell.flicker.apppairs.AppPairsTest
com.android.wm.shell.flicker.splitscreen.*
com.android.wm.shell.flicker.legacysplitscreen.*
To address this we move from "opt-out" to "opt-in" model for
WmShellFlickerTests on TV.

Bug: 176074784
Test: run `atest WMShellFlickerTests` on ADT-3
Change-Id: Ic71f9ed4cd0f3b13d81763b2741e827f32b26c4a
2020-12-21 12:48:51 +00:00
Wei Sheng Shih
612dbde32a Merge "Mirror TaskSnapshotSurface to WMShell(2/N)" 2020-12-21 01:39:04 +00:00
Nataniel Borges
22d3663b0f Merge "Add test transition ExitSplitScreenFromBottomTest" 2020-12-20 08:46:02 +00:00
Nataniel Borges
6c1663167c Merge "Ignore letterbox in two tests" 2020-12-20 08:44:14 +00:00
Antonella Dellanzo
3bc2c00a53 Ignore letterbox in two tests
Two tests in EnterLegacySplitScreen were failing from time to time with letter box layer not showing 2+ times. We are ignoring it also in the assertions and refactoring the assertion to only ignore the app layers used in each corresponding case instead of ignoring all of them.

Test: atest WMShellFlickerTests
Bug: b/171049797
Change-Id: I6212f833c790fb0fa002cae2f7a3efc688168578
2020-12-18 11:23:48 +01:00
Antonella Dellanzo
fbcf6e3253 Add test transition ExitSplitScreenFromBottomTest
Add a new test (only the transition) called ExitSplitScreenFromBottomTest. This test will open an app in splitscreen and then it will exit the split screen by moving the divider to the bottom (similar to SplitScreenToLauncherTest that moves it to the top).

Test: atest WMShellFlickerTests
Bug: b/171049505
Change-Id: I42feb423d346829f829404db13590e70bed16f21
2020-12-18 10:07:12 +00:00
Bill Lin
21cfe8bb58 2/ Clear all recents tasks before running legacysplitscreen tests
Sometimes previous launched activity will affect the order of
current test activity in recents and cause the flicker test flaky.
Trigger openQuickStepAndClearRecentAppsFromOverview() in setup()
to ensure overview/recents is clear before the tests

Bug: 175728979
Test: atest com.android.wm.shell.flicker.legacysplitscreen
Change-Id: I6a6aae362617bb7948473aaafaab8f2c3eec0bc1
2020-12-18 15:32:26 +08:00
Hongwei Wang
72ced07393 Merge "Provide vsync id for PiP animation" 2020-12-18 03:13:30 +00:00
Antonella Dellanzo
ab508e96cf Updating split screen tests
Updating split screen tests:
- Adding the assertions visibleWindowsShownMoreThanOneConsecutiveEntry and visibleLayersShownMoreThanOneConsecutiveEntry for all the split screen tests (the layer one is disabled as we need ag/13051160 to ignore one layer).
- Replacing some assertions for other that check more things (i.e. replacing the dockedStackDividerIsVisible assertion for dockedStackDividerBecomesVisible).
- Adding some new assertions to the current tests in order to check for more things.

Adding new WM and layer assertions to Flicker tests to avoid repeating code:
- appWindowBecomesVisible
- layerBecomesVisible
- layerBecomesInvisible

Adding new layer assertions to WM shell to avoid repeating code:
- dockedStackDividerBecomesVisible
- dockedStackDividerBecomesInvisible

Test: atest WMShellFlickerTests
Bug: b/171049797
Change-Id: I2bbb23a1cf92df16ee6292e5da4644936a6d99e5
2020-12-17 22:13:26 +01:00
Jorge Gil
982fc7eb5c Merge "Prevent duplicate call to update movement bounds on rotation" 2020-12-17 17:49:31 +00:00
Sergey Nikolaienkov
cf69ba1961 Merge "Fix Pip tests after Pip Menu migration to a Window" 2020-12-17 11:20:53 +00:00
Jerry Chang
39a6d69a5d Merge "Fix showing black background when resizing the divider bar." 2020-12-17 06:17:26 +00:00