Commit Graph

423 Commits

Author SHA1 Message Date
Antonella Dellanzo
4b6d358ad6 Add test transition SplitScreenRotateTwoLaunchedAppTest
Add a new test (only the transition) called SplitScreenRotateTwoLaunchedAppTest. This test will open two apps in splitscreen and in the transition it will rotate the device.

Test: atest WMShellFlickerTests
Bug: b/171049799
Change-Id: I41e9b09d2621c2c44d276a2348b8f7f94dec71dc
2020-11-30 17:39:24 +01:00
Wale Ogunwale
071e95e8af Switch some recent tasks calls from IATM to ATM
The aidl IActivityTaskManager interface doesn't allow for method
overloading with the same name. Switching some of these calls to use
ActivityTaskManager class instead makes it easier to have overloads in
upcoming CLs.

Test: they pass!
Bug: 172776536
Change-Id: Ic4895ccf7dc1207cc6b14004cfcf6ee7b4b76cc1
2020-11-30 06:57:29 -08:00
Antonella Dellanzo
7e4ae56729 Add presubmit tag for OpenAppToSplitScreenTest
The test OpenAppToSplitScreenTest was marked as flaky as it doesn't run because of b/161435597 when being on 90 degrees. So we are removing the flaky annotation and marking the test to only run on 0 degrees. Also adding the presubmit annotation. This test is similar to one of the test inside EnterSplitScreenTest that's been running with no problem.

Test: atest WMShellFlickerTests
Change-Id: I4e9496286210805e0a8d15d7905cf6fbbc28a4ed
2020-11-30 09:38:13 +00:00
Antonella Dellanzo
e14d916e43 Move tests to Presubmit
Moving some tests to Presubmit using the annotation tag (adding the annotation lib as dependency). These tests were working on post submit:
- AppPairsTest
- PipKeybopardTest
- EnterSplitScreenTest
- ExitSplitScreenTest

Test: atest WMShellFlickerTests
Change-Id: I10603cbb869044fce9d444ab7c2a8d761eb1ee74
2020-11-30 09:22:57 +00:00
Yuncheol Heo
72800c9029 Migrate some CTS tests about PIP presentation to WMShellFlickerTests
Test mappings are as follows:
- testPinnedStackInBoundsAfterRotation => PipRotationTest
- testEnterPipToOtherOrientation => PipOrientationTest
- testSetRequestedOrientationWhilePinned => PipOrientationTest
- testPinnedStackWithDockedStack => PipSplitScreenTest
- testDisplayMetricsPinUnpin => EnterExitPipTest

Some other accompanying changes are as follows:
- add FixedAppHelper for FixedActivity.
- add testapp.Components to provide the constants for each test app.
- extend PipActivity to accept some extras from Intent/BroadcastIntent.

Bug: 161980624
Test: atest WMShellFlickerTests
Change-Id: I64d97a51387370cc086c9dcdded846e4a8c1c0ea
2020-11-26 10:23:49 -08:00
Antonella Dellanzo
ba500e9603 Merge "Move tests from FlickerTests to WMShell" 2020-11-24 11:03:06 +00:00
Antonella Dellanzo
941c3b8ac3 Move tests from FlickerTests to WMShell
Moving all tests of Pip and SplitScreen from FlickerTests lib to WMShell.

Test: atest WMShellFlickerTests FlickerTests
Change-Id: I5e915f38beb8c1fef44cf18d955caf1e3cc77b30
2020-11-23 15:54:09 +01:00
Sergey Nikolaienkov
dececd5dd3 Add tests for custom actions to TvPipMenuTests
Test that correct UI elements are displayed for the custom actions; that
the set of custom actions can be updates (while PiP menu is shown); that
custom actions collaborate correctly with "regular" actions (Full screen
and Close), as well as with the media contol actions.

Bug: 171520419
Test: atest WMShellFlickerTests:TvPipMenuTests
Change-Id: I1f5b1e4896a60b8d2bfb118e548466e7f4036e61
2020-11-20 10:03:48 +00:00
Jorge Gil
5f5fdaeaeb Merge "Add unit tests and cleanup PipBoundsState" 2020-11-19 21:04:12 +00:00
Bill Lin
a6c32cc9af 4-2/ Enhance AbstractStandardAppHelper.exit() to exit PIP at end
Integrate forceStop() in exit() that PIP window could really
exit after each round of test

Bug: 173567664
Test: atest com.android.wm.shell.flicker
Test: atest com.android.server.wm.flicker.Flicker

Change-Id: I8aaa4f590344f8fb1e6e731ed865f21f63892bb2
2020-11-19 23:11:28 +08:00
TreeHugger Robot
8b69ef2dae Merge "3/ Fix bug of PipKeyboardTest do not forceExit() testApp successfully" 2020-11-19 02:41:05 +00:00
TreeHugger Robot
3e35756c79 Merge "2/ Initial AppPairs flicker test case" 2020-11-19 02:41:05 +00:00
jorgegil@google.com
8cceeffe0b Add unit tests and cleanup PipBoundsState
1. Adds missing unit tests
2. Cleans up public API (nullability and doc)
3. Renames AnimatingBoundsState to MotionBoundsState to improve
readability of what that state actually holds, that is, the state
of the "bounds in motion" which can be the bounds used during an
animation but also the bounds used during a drag or resize
operation.

Bug: 169373982
Test: atest com.android.wm.shell.pip
Change-Id: I951fa3ea1310b69c93b53a1690c0a1cf0632dd33
2020-11-18 18:28:19 -08:00
Jorge Gil
828490c31e Merge changes from topic "bounds-algo-tests"
* changes:
  Add unit tests for PipSnapAlgorithm
  Add unit tests for PipBoundsAlgorithm
2020-11-19 00:50:16 +00:00
Treehugger Robot
c258e3ecaa Merge "Add Nataniel as OWNER of WMShellFlickerTests/WMShellUnitTests" am: 2ba09b6747 am: c579af998c am: 47b3639a83 am: 7e454b9029
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1503412

Change-Id: I0f50c5b9333f17d46bc77ae47164b762bd67098f
2020-11-18 23:48:28 +00:00
jorgegil@google.com
cb5acc2f2b Add unit tests for PipSnapAlgorithm
Bug: 169373982
Test: com.android.shell.wm.pip
Change-Id: Iecc7ede73644f975c8bc71300e72925bd220f28d
2020-11-18 11:13:31 -08:00
Hongwei Wang
ebaf114818 Add Nataniel as OWNER of WMShellFlickerTests/WMShellUnitTests
Bug: N/A
Test: N/A
Change-Id: Ibddd92a03daf368397a88a2959f301bf53a2bbf4
2020-11-18 10:56:34 -08:00
TreeHugger Robot
5bc9594c6b Merge "Add divider view support for app-pairs" 2020-11-18 12:12:18 +00:00
Bill Lin
57c4847f3d 2/ Initial AppPairs flicker test case
1. Send adb command to pair test apps
2. Assert primary & secondary apps visibility
3. Assert Region of primary & secondary apps in portrait

Bug: 172776659
Test: atest WMShellFlickerTests:AppPairsTest
Test: set TEST_REPETITIONS = 10, tests no flaky
Change-Id: If41340c82782da01909d84b9ad101556e3234aa1
2020-11-18 16:39:18 +08:00
Bill Lin
ceb6007a62 Merge "1/ Migrate cts SplitScreenTests to wm shell flicker test" 2020-11-18 05:38:21 +00:00
Mariia Sandrikova
2b54b5d709 Merge "Make positioning in letterbox mode configurable." 2020-11-17 22:45:44 +00:00
Sergey Nikolaienkov
2edad48f94 Merge "Test Pip window position when Pip menu is open" 2020-11-17 20:51:22 +00:00
Mariia Sandrikova
49fc5569f0 Make positioning in letterbox mode configurable.
Changes:
- Allow to specify in config_letterboxPortraitGravity and config_letterboxLandscapeGravity desired alignment for letterboxed apps.
- Add ADB commands to allow overriding these config values for testing
- Move positioning logic for letterbox mode from WM Core to WM Shell.

Test: atest LetterboxTaskListenerTest LetterboxConfigControllerTest
Test: go/wm-smoke
Test: manual with adb shell dumpsys activity service SystemUIService WMShell (get)set-letterbox-portrait-gravity / (get)set-letterbox-landscape-gravity
Fix: 170216257, 170215849
Change-Id: I8e6392faab05bec1bf61b9691f3bd9b8b09b9621
2020-11-17 20:15:31 +00:00
Bill Lin
d89e31bad2 1/ Migrate cts SplitScreenTests to wm shell flicker test
This is the initial version to achieve:
1. SplitScreenActivity in test-apps
2. Create SplitScreenTestBase and add a basic test cases to
   ensure SplitScreenActivity enter split screen mode
3. Assert StatusBar/NavBar/SplitScreenActivity showing when
   device enter split screen mode
4. Verify docked apps ending bounds

Bug: 169271943
Bug: 172811376
Test: atest WMShellFlickerTests:EnterSplitScreenTest
Change-Id: I26461b958c578dcbcc5ca2235f9d269559fd9ec5
2020-11-17 19:38:22 +08:00
Sergey Nikolaienkov
31fcbcfed1 Test Pip window position when Pip menu is open
Bug: 171520419
Test: atest WMShellFlickerTests:TvPipMenuTests
Change-Id: Ie0a5651667bfe1bc04ee1127fbcd721b3bd36d81
2020-11-17 07:49:26 +00:00
Sergey Nikolaienkov
160bd0f088 Test PiP on TV with different aspect ratios
Introduce TvPipBasicTest that runs a basic Pip scenario:
1) enter Pip;
2) open Pip menu using the Window button;
3) close Pip menu using the Back button;
4) close Pip.
The test runs with 4 times with different Pip window aspect ratios:
defaul; square(1:1); wide(2:1); tall(1:2).

Bug: 13054136
Test: atest WMShellFlickerTests:TvPipBasicPipTest
Change-Id: I9a138ba9daaac223d451bac750e6a028def0a468
2020-11-17 07:37:15 +00:00
Sergey Nikolaienkov
0451222aed Always run TV PiP tests with 0 rotation
Bug: 13054136
Test: atest WMShellFlickerTests:TvPipMenuTests
Test: atest WMShellFlickerTests:TvPipNotificationTests
Change-Id: Ied62beb0c8551c8a0572455bd790c11c5517f61d
2020-11-17 07:37:15 +00:00
Bill Lin
c89e663119 3/ Fix bug of PipKeyboardTest do not forceExit() testApp successfully
After PipKeyboardTest teardown{}, the testApp in PIP mode is alive and
introduce the NEXT flicker test case get unexpected assertion fails.

Root cause:
The flow of exit(), neither pressHome() nor pressBack() could lead
TestApp(in PIP) successfully exit PIP and back to fullscreen in teardown.

Bug: 173477410
Test: atest com.android.wm.shell.flicker, make sure all tests PASSED
Test: atest WMShellFlickerTests, make sure all tests PASSED
Change-Id: I5e7e6f0323b2e6145dc25e2b8e99b77557f4ce13
2020-11-17 07:22:57 +00:00
Jerry Chang
0545edfa3d Add divider view support for app-pairs
Add divider bar for app-pairs. AppPairLayout and divide policy records
and handles the layout in pair.

Bug: 172704238
Bug: 172704672
Test: manul check the behavior of the splits and divider bar.
Test: AppPairTests, AppPairsPoolTests, AppPairsControllerTests

Change-Id: I688c7001d056fe8dd9a192885e1f9fd5f004dc11
2020-11-17 11:22:19 +08:00
jorgegil@google.com
82b6802083 Add unit tests for PipBoundsAlgorithm
Bug: 169373982
Test: atest PipBoundsAlgorithmTest
Change-Id: I033039191f34e4bae22cd2690b0413cab1aaa7a5
2020-11-16 11:39:46 -08:00
Jorge Gil
990f36728b Merge changes I423219e9,Id5636cfc
* changes:
  Move movement bounds into PipBoundsState
  Move normal and expanded bounds into PipBoundsState
2020-11-13 21:56:15 +00:00
Sergey Nikolaienkov
a2b16e18ec Merge "Do not call assumeTrue(isTelevision) in @After" 2020-11-13 16:35:48 +00:00
Wale Ogunwale
fe8c73b18d App-pairs baseline commit
- AppPairs: Main interface used to pair and unpair tasks.
- AppPairsController: Main controller for app-pairs and implements
AppPairs interface.
- AppPair: Manages a singal instance of an app-pair consisting of a
root task and 2 other tasks that are paired together.
- AppPairPool: Helper object pool for AppPair class so we don't have to
wait for a root task creation from system_server when we need an
app-pair.
- adb shell commands for pairing and unpairing tasks

Test: adb shell commands for pair/unpair
      adb shell dumpsys activity service SystemUIService WMShell \
        pair taskId1 taskId2
      adb shell dumpsys activity service SystemUIService WMShell \
        unpair taskId
Test: AppPairTests, AppPairsPoolTests, AppPairControllerTests
Bug: 172704672
Change-Id: Ie0a70c1aa764ad83b763931501234c1960251ca4
2020-11-13 21:33:38 +08:00
Sergey Nikolaienkov
327e175409 Do not call assumeTrue(isTelevision) in @After
Only call assumeTrue(isTelevision) during test setup (@Before), and do
not call it in teardown (@After), which causes tests to fail instead of
be slipped.

Bug: 171520419
Test: atest WMShellFlickerTests
Change-Id: I12f72d46a63c497686f0da7c4763ae79bbeb7dcd
2020-11-13 10:10:07 +00:00
jorgegil@google.com
4f93268de7 Move movement bounds into PipBoundsState
Bug: 169373982
Test: com.android.wm.shell.pip
Change-Id: I423219e9093f52edbd84ef52b928219679e187bc
2020-11-12 11:14:36 -08:00
Sergey Nikolaienkov
ded47e0d1d Merge "Report if SystemUI crashes during TV Pip tests" 2020-11-12 18:47:05 +00:00
Jorge Gil
5384885a56 Merge "Rename PipBoundsHandler to PipBoundsAlgorithm" 2020-11-12 16:53:00 +00:00
Sergey Nikolaienkov
af5c8ad1cd Merge "More TvPipMenuTests tests in WmShell" 2020-11-12 06:07:21 +00:00
Shawn Lin
f076bba8e2 Merge "Support hide display cutout with display area" 2020-11-12 04:49:35 +00:00
Mady Mellor
ed1098532d Merge changes I36b9cedc,I79948a4b
* changes:
  Allow Bubble overflow to be opened without other active bubbles
  Flexible bubble sizing & fixed position
2020-11-12 00:26:43 +00:00
Mady Mellor
157cd3f736 Allow Bubble overflow to be opened without other active bubbles
Currently you can only access the overflow if you have bubbles in
the stack. There are a bunch of explorations that show accessing
the overflow without the stack (e.g. from taskbar, from people area).

- BubbleData holds onto BubbleOverflow now
- When last bubble is removed, if showing in taskbar/already expanded
  & has overflow bubbs, select the overflow.
- No longer null out BubbleStackView when no more bubbles, this
  allows overflow to continue to show
- Added tests for overflow behaviour in BubblesTest

Test: atest SystemUITests
Test: manua 1) - produce a bunch of bubbles
               - expand the stack, dismiss each bubble
               => when you dismiss the last one, overflow selected
               - collapse the stack
               => overflow goes away
            2) - have taskbar cl / prototype
               - have bubbles in the overflow but no active bubbles
               => observe that taskbar shows the overflow (i.e. sysui
                 renders the stack in that spot)
Bug: 171322463
Bug: 167413172
Change-Id: I36b9cedc492ace59105dba58c89f9ef92ff4b9e8
2020-11-11 12:58:12 -08:00
Mady Mellor
97fcd7a082 Flexible bubble sizing & fixed position
This will enable some stuff for taskbar & hopefully make customizations by
ARC++ easier??

- BubblePositioner now tracks the size of the bubble & bitmap within it.
  Have to use a multiplier to derive the size of a couple of things now
  (e.g. bitmap size)
- BubblePositioner now tracks the position of the bubble stack & allows
  a way to override / set a fixed position. If something is in fixed
  location, it is not draggable (however when expanded you can still
  drag individual bubbles to dismiss)
- BubblePositioner tracks some taskbar related info
- Rather than checking for "isLandscape" we want "showBubblesVertically"
  (e.g. device might not be landscape but should be vertical if taskbar)
- Fixes an animation issue where bubbles super-overshoot the y position
  when expanding vertically.

Bug: 167413172
Test: a lot of manual testing
Test: atest WMShellTest SystemUITests
Change-Id: I79948a4bd6b58fb3aa2f52e2553f3dfc31630cf1
2020-11-11 12:57:29 -08:00
jorgegil@google.com
67959b765d Rename PipBoundsHandler to PipBoundsAlgorithm
Now that all state handling has been moved out of
PipBoundsHandler, this CL renames it to
PipBoundsAlgorithm and cleans up its public API
so that it functions more like an utility to
calculate several types of "bounds" related to PIP
such as:
- Default bounds
- Normal bounds
- Movemement bounds
- Entry bounds
- Bounds adjusted to aspect ratio
- Inset bounds

PipBoundsAlgorithm's is then only responsible for
calculating such bounds based on the current state of
PIP (owned by PipBoundsState) but it no longer owns
or manages the state, as that would be the
responsability of its users (e.g PipController).

Bug: 169373982
Test: atest com.android.wm.shell.pip
Change-Id: I67c3004b60069160f82d7c3d00d8c3995c0c5f80
2020-11-11 11:07:23 -08:00
Sergey Nikolaienkov
b28adf0d2d More TvPipMenuTests tests in WmShell
Bug: 171520419
Test: atest WMShellFlickerTests:TvPipMenuTests
Change-Id: I0ffdcc8d7fbae636288bd6b4fbfd567cb1cacac0
2020-11-11 15:41:00 +00:00
Sergey Nikolaienkov
44ede0b9e6 Report if SystemUI crashes during TV Pip tests
Bug: 171520419
Test: atest WMShellFlickerTests:TvPipMenuTests
Test: atest WMShellFlickerTests:TvPipNotificationTests
Change-Id: Id272b67dec36b5b3a0ffa0713ecd736cb64befd5
2020-11-11 15:36:39 +00:00
shawnlin
8dd26b237d Support hide display cutout with display area
- Added a new DisplayArea feature for hide display cutout
- Added a new config for enable/disable hide display cutout
- Resize and shift display areas to exclude the cutout areas.
- Force dark status bar when there is a cutout area at top
- Update bounds & offsets for different rotations.

Bug: 157388722
Test: atest HideDisplayCutoutControllerTest
      atest HideDisplayCutoutOrganizerTest
      atest WMShellTest
Change-Id: Iad2c8b1eff1ea4523f8a7e362c9e851d8594141c
2020-11-11 19:40:57 +08:00
Wei Sheng Shih
079f596c4e Merge "Delegate splash screen starting window to SystemUI(1/N)" 2020-11-11 02:30:02 +00:00
jorgegil@google.com
d6349bb46b Move IME & shelf visibility/height into PipBoundsState
Bug: 169373982
Test: com.android.wm.shell.pip
Change-Id: I411d857c57e2dc593c3506318f5ce1ab6d625b08
2020-11-10 10:19:12 -08:00
jorgegil@google.com
a61e9fec04 Refactor getDestinationBounds into more readable methods
getDestinationBounds(Rect) was only being used to calculate
the "entry" bounds (e.g. onTaskAppeared, swipeToHome) and
all its callers were passing in null.
getDestinationBounds(Rect, boolean) had only one caller,
onTaskInfoChanged, who did pass the current bounds in to
be adjusted to the aspect ratio.

Instead of having overloaded methods and complex logic to
know whether to calculate default bounds or use the provided
bounds, the method is now split into two methods that better
represent what they're calculating:
1. getEntryDestinationBounds, no arguments, calculates either
default or reentry bounds
2. getAdjustedDestinationBounds, takes in the current bounds
and the new aspect ratio, simply adjusts the bounds to the
aspect ratio.

Bug: 169373982
Test: atest com.android.wm.shell.pip
Change-Id: Ie8adda458fc5a56b9d78245c663dbc54b8525378
2020-11-10 10:11:33 -08:00
Winson Chung
b73cc69fbc Merge changes from topic "shell_task_stack_listener"
* changes:
  6/ Fix some flakey issues with dragging to split
  Clean up task stack listeners
2020-11-10 17:24:57 +00:00