Commit Graph

54 Commits

Author SHA1 Message Date
Jerry Chang
38af94c821 Merge "Allow children task of created-by-organizer task to be organized" 2020-11-02 03:40:38 +00:00
Ben Lin
f2d1d26479 Merge "PiP: Move menu to SystemWindow." 2020-10-30 06:45:29 +00:00
Ben Lin
4ee2588a05 PiP: Move menu to SystemWindow.
This is the first step to move the menu to fullscreen, but not quite
yet.

This CL does:
- Move PipMenuView to be attached to SystemWindow, instead of child of
PiP leash
- Use SyncRtSurfaceTransactionApplier to ensure the menu moves along the
PIP leash at the same time when the menu is visible
- Remove setup/destroy code in PipTaskOrganizer with SurfaceViewHost
- Expose Window information to Accessibility services
- Refactor ShellRoot to take in a Layer type instead of windowType
instead

Bug: 161710689
Bug: 170151121
Bug: 169894316
Bug: 152738416
Test: Manual

Change-Id: I73c26f96784b35b9bb9a4bea452df55cf5913278
2020-10-30 01:47:34 +00:00
Jerry Chang
e6fc6a3c2a Allow children task of created-by-organizer task to be organized
Allows to organize direct child of root task created by organizer and
extends TaskInfo to reveal the parent task id.

To organize child task properly for each features, passes all child
task organizer events to the listener listening to its parent task if
feasible.

Fix: 169267298
Fix: 169266482
Test: atest WindowOrganizerTests
Test: atest SplitScreenTests
Test: atest PinnedStackTests
Test: atest WindowInsetPolicyTests
Test: atest WMShellUnitTests
Test: split screen works
Change-Id: I8e66f810c86fcdac3287adfa208d8e34786fc9b5
2020-10-29 16:20:19 +08:00
Jorge Gil
eed8af911a Merge "Add tests to verify last pip component name updates" 2020-10-28 20:34:17 +00:00
TreeHugger Robot
805dcb4435 Merge "Move PipMediaController from pip/phone/ to pip/" 2020-10-28 10:44:04 +00:00
jorgegil@google.com
9f86389c97 Add tests to verify last pip component name updates
Bug: 169373982
Test: atest com.android.wm.shell.pip
Change-Id: I49df43b9462c50f1beef774a14583afda9d8cf3b
2020-10-27 16:19:49 -07:00
jorgegil@google.com
9bc88aad46 Reland: Add tests to verify aspect ratio updates
Test: atest PipTaskOrganizerTest
Bug: 169373982
Change-Id: I4e9c5d3fe8c9d87e16d4a86bd311ee76bbb206b5
2020-10-27 16:16:56 -07:00
Sergey Nikolaienkov
ca3aa40238 Move PipMediaController from pip/phone/ to pip/
Move PipMediaContoller from com.android.wm.shell.pip.phone to
com.android.wm.shell.pip.
Since PipMediaController relies on the PipUtils, move that along.

Bug: 169575409
Bug: 165795012
Test: make WindowManager-Shell
Change-Id: Ide2dfd813eb8df906b58f50e1ed9b57a62d63dbc
2020-10-27 19:11:37 +00:00
TreeHugger Robot
1a9d724648 Merge "Revert "Add tests to verify aspect ratio updates"" 2020-10-26 23:26:11 +00:00
Brad Ebinger
235a0cfe1f Revert "Add tests to verify aspect ratio updates"
This reverts commit 0796ebff82.

Reason for revert: Looks to have broken master b/171738702

Change-Id: Iac7a680dd15b5c884fa74592484b7c094e3177c4
2020-10-26 22:16:42 +00:00
Jorge Gil
3a83894396 Merge "Add tests to verify aspect ratio updates" 2020-10-26 21:04:38 +00:00
jorgegil@google.com
0796ebff82 Add tests to verify aspect ratio updates
Test: atest PipTaskOrganizerTest
Bug: 169373982
Change-Id: Ia3bb5a721049e33611d0efda0fc29c5815ac7fe4
2020-10-26 09:40:59 -07:00
Mariia Sandrikova
2d81132f30 Move letterbox task positioning to LetterboxTaskListener.
Changes:
- Introduce LetterboxTaskListerner
- Pass activity bounds and task position from WM Core to WM Shell
- Position a task from LetterboxTaskListener.

Fix: 170210431, 170213038, 168706428, 171549361
Test: go/wm-smoke
Test: atest ShellTaskOrganizerTests, LetterboxTaskListenerTest
Change-Id: I9c25b7fe1053900fe3b6eea8e71db302a0c14a5a
2020-10-26 15:42:32 +00:00
Jorge Gil
1be6b7f462 Merge "Move display state into PipBoundsState" 2020-10-23 21:43:01 +00:00
Antonella Dellanzo
1905a06186 Merge changes from topic "fix-assertions-type-enable-param"
* changes:
  Fix params of flicker assertions
  Disable assertion in SeamlessAppRotation test
  Fix params of flicker assertions
2020-10-23 16:27:19 +00:00
Antonella Dellanzo
3b0ae16db3 Fix params of flicker assertions
As now the AssertionTypes in Flicker checks for the bug id to set the default value of the enabled param (ag/12886026), we are fixing all the calls to the assertions types as the params order changed.

Test: atest WMShellFlickerTests
Bug: b/162923992
Change-Id: I04c0b70aeb201dc1d7627571cc4809e959bd2370
2020-10-23 09:04:52 +00:00
jorgegil@google.com
448e8d4c9a Move display state into PipBoundsState
Migrates more state out of PipBoundsHandler as an effort
to split it into a state holder (PipBoundsState) and a
bounds calculating util.

Bug: 169373982
Test: atest com.android.wm.shell.pip
Change-Id: I37ab29c988be519a074ec260163632df3060efc4
2020-10-22 13:19:59 -07:00
Sergey Nikolaienkov
5eec4cefd1 Merge "Fix WMShellFlickerTest on TV" 2020-10-22 18:29:30 +00:00
Sergey Nikolaienkov
2bee685151 Fix WMShellFlickerTest on TV
Add intent-filter for LEANBACK_LAUNCHER to PipActivity and ImeActivity
in com.android.wm.shell.flicker.testapp.

Bug: 170484870
Test: atest WMShellFlickerTests:PipKeyboardTest
Change-Id: Ib9be4d4c30c5759a18b67be1a606c06562b47d3c
2020-10-22 13:46:05 +00:00
jorgegil@google.com
5ebaec9607 Move aspect ratio state into PipBoundsState
Couple of changes here:
1. mAspectRatio is moved to PipBoundsState
2. Simplified getDestinationBounds by removing the aspect ratio
param. It was always re-calculated, then sent to getDestinationBounds,
then updated mAspectRatio. Now mAspectRatio is updated first and
getDestinationBounds just uses the PipBoundsState's ratio.

Bug: 169373982
Test: aspect ratio is set correctly on enter PIP, and updated during
PIP mode if app changes it (e.g. Youtube)

Change-Id: I144960ff41bde4f18eb1e9a8e60ea0cba29a8470
2020-10-20 19:22:45 -07:00
Wale Ogunwale
0e6581c1e6 Support task listener by task id.
Allows for managing specific task regardless of windowing mode.
Converted TaskView which to use the new API.

Bug: 170153209
Test: All tests pass and bubbles works!
Change-Id: Ic5281bc9dd9124841834c88f2b85545107567417
2020-10-19 19:21:45 -07:00
jorgegil@google.com
5b8d244061 Move reentry state into PipBoundsState
Bug: 169373982
Test: existing tests pass, reentry works
Change-Id: I45af27637f24ad0822e4bdf65cd3a93d4a2442dd
2020-10-19 14:52:11 -07:00
TreeHugger Robot
1869ff1f1e Merge "Respect feature flag when providing Pip controller" 2020-10-15 13:06:41 +00:00
Winson Chung
3f4c002e1f Return the existing tasks when registering an organizer
- Existing tasks for supported windowing modes are returned when
  registering the organizer and the organizer will not receive
  onTaskAppeared() for these tasks.  For now, the shell task
  organizer will keep these tasks for reporting task appeared when
  individual components add listeners for their windowing modes.
- Fixed some tests now that we organize fullscreen tasks

Bug: 162028888
Test: atest WindowOrganizerTests
Test: atest ShellTaskOrganizerTests
Change-Id: Iedc5f58fbfa819e753a5dcea7a8eb9dee8b6843b
2020-10-13 20:58:25 -07:00
Jerry Chang
c8773d073a Respect feature flag when providing Pip controller
Makes sysui dagger provides optional PIP controller with PIP feature
flag. Adds test in PipControllerTest to make sure it won't instantiate
controller if the feature is not supported.

Bug: 170188471
Test: atest SystemUITests
Test: atest WMShellUnitTests
Change-Id: I681bb5ac2972d6426c270099605d44fc82dc9f78
2020-10-14 11:21:28 +08:00
jorgegil@google.com
9366e26361 Add PipBoundsState to manage current pip bounds
This change adds a basic state class and migrates
mLastReportedBounds from PipTaskOrg into it. It'll
eventually become the holder of all bounds-related state
such as movements bounds, reentry bounds/fraction and
aspect ratio.

Bug: 169373982
Test: atest com.android.wm.shell.pip
Change-Id: I43c530f4f3ab192756964022417f39f3085e593e
2020-10-13 09:16:05 -07:00
Jorge Gil
f846ea48f0 Merge "Fix wrong package name in wm.shell.pip tests" 2020-10-09 20:21:11 +00:00
jorgegil@google.com
fc72c7aaa2 Fix wrong package name in wm.shell.pip tests
Bug: 170188412
Test: atest com.android.wm.shell.pip actually runs all tests
Change-Id: I9b8857e1a739d03b1d0b05bbcbeb2be1a28c984d
2020-10-09 18:11:16 +00:00
Mariia Sandrikova
18029e2a2d Merge "Refactor task listeners mapping in ShellTaskOrganiser" 2020-10-09 11:27:57 +00:00
TreeHugger Robot
c6b1386fc3 Merge "Presubmit com.android.wm.shell.onehanded test flaky" 2020-10-08 20:49:58 +00:00
TreeHugger Robot
b64df77f46 Merge "Migrate FlickerPiPTests to WmShellFlickerTests." 2020-10-08 16:53:23 +00:00
Mariia Sandrikova
fe89198905 Refactor task listeners mapping in ShellTaskOrganiser
Stop using windowing modes as keys for task listerners mapping to allow adding multiple listeners for one windowing mode.

Fix: 170209272
Test: go/wm-smoke
Change-Id: I31c20a00f8747a8510a5fab9e54efa63173aab6a
2020-10-08 17:06:26 +01:00
Bill Lin
42af4e5468 Presubmit com.android.wm.shell.onehanded test flaky
Root cause:
Obtain handler from OneHandedDisplayAreaOrganizer and assert if
there's message in the message queue will encounter timing problem.

Solution:
Set a spied handler object into OneHandedDisplayAreaOrganizer,
and verify if sendMessage() was called or not.

Test: for i in {1..1000};do atest WMShellUnitTests;done
Bug: 170376119
Change-Id: Ie9f5561d61ac3c917a7dfced6c3281adb81fd12e
2020-10-08 21:44:01 +08:00
TreeHugger Robot
56af862615 Merge "Reset WindowContainerTransaction when rotation changed callback" 2020-10-08 06:05:19 +00:00
Bill Lin
038ca7f431 Reset WindowContainerTransaction when rotation changed callback
* Fix the problem that wct do not update/reset bounds after rotation
* Fix ConcurrentModificationException bug
* Refactor OneHandedDisplayAreaOrganizerTest
* Implement OHM dump in WMShell
* Consolidate the test cases
* Replace HashMap to ArrayMap for memory efficiency

Test: manual trigger OHM, rotate device, observe leash is reset
Test: atest SystemUITests
Test: atest WMShellUnitTests
Bug: 162470563
Bug: 170284095
Fixes: 160848002
Change-Id: I1c653174e28c72253cc7eac1d294a5c598bb7921
2020-10-08 03:55:50 +00:00
Yuncheol Heo
bc0e28b480 Migrate FlickerPiPTests to WmShellFlickerTests.
- This CL migrates FlickerPiPTests.java to WmShell: http://shortn/_Y4GUnepWZl
- This introduces ImeAppHelper and ImeActivity from FlickerTests.
- This uses launchActivity() function to launch Keyboard Activity, since UiAutomator doesn't support to launch the multiple Activities in a task: http://shortn/_KlCIzvahyr

Bug: 167233905
Test: atest WMShellFlickerTests:PipKeyboardTest
Change-Id: I990e6e83213610ca657dbc69f4535971760fde65
2020-10-06 23:54:43 -07:00
Winson Chung
33c9f1c71b Disallow multiple listeners in the shell task org for the same win mode
- Chatted offline, individual listeners can proxy state, but the task
  org doesn't need to have multiple listeners for each mode

Bug: 161980327
Test: atest ShellTaskOrganizerTests
Change-Id: Ic11400a64bf9dc1e00ab6d22c29727414b608e17
2020-10-06 09:54:19 -07:00
Evan Rosky
0dd1586bf7 Scaffolding for Shell Transitions
Initial rough implementation of Shell Transitions.

Shell Transitions can be enabled by setting ENABLE_SHELL_TRANSITIONS
via `adb shell setprop persist.debug.shell_transit 1`

The main structure behind this is:

- TransitionController in Core responsible for handling the
collection of transition participants and communicating with
the TransitionPlayer in Shell.

- Transitions in Shell responsible for starting transitions
and playing associated animations.

This initial version only supports task open/show/close and does
a simple fade. The flow is:
1. activityStarter calls to Transitions.requestStartTransition
2. Transitions will prepare to start and then call
   WindowOrganizerController.startTransition().
2. Various operations in Core call TransitionController.collect()
   to track participants. This collect() acts as a replacement for
   adding to mOpening/ClosingApps.
3. The legacy executeAppTransition() is wired into
   TransitionController.setReady() for now. This signal
   is used to ready a BLASTSyncEngine.
4. When all participants are done drawing, TransitionController
   will commit any showing visibility changes and then will construct
   a TransitionInfo object summarizing all the changes needed for
   animation. This gets sent to Transitions.onTransitionReady()
5. Transitions then plays the transition animation and on
   completion will call WindowOrganizerController.finishTransition()
   which will tell TransitionController to do any finishing
   work (like commiting deferred hide changes).

Bug: 161980187
Test: enable the flag and try opening/closing tasks. Also added
      TransitionControllerTests
Change-Id: I80c3a241fc12004a894c26523a1e5828e0c533ff
2020-09-30 11:36:35 -07:00
Bill Lin
2b3bd57805 Move Pip codes from SysUI to WMShell lib (9/N)
Bug: 161118569

Test: make SystemUI
Test: make ArcSystemUI
Test: make WMShellUnitTests
Test: lunch cf_x86_tv-userdebug & make
Test: atest CtsSystemUiTestCases:BasicPipTests
Test: atest CtsSystemUiTestCases:CustomPipActionsTests
Test: atest CtsSystemUiTestCases:FlickerPipTests
Test: atest CtsSystemUiTestCases:PipNotificationTests
Test: atest SystemUITests
Test: atest WMShellUnitTests
Test: manual test PIP demo AP
Test: manual test TV PIP function
Test: manual test disabled PIP
Test: adb shell input keyevent 171(KEYCODE_WINDOW)
Test: adb shell am start -n android.systemui.cts.tv.pip/.PipTestActivity
    -a android.systemui.cts.tv.pip.PipTestActivity.enter_pip
Test: adb root;adb shell am start \
    -n com.android.systemui/com.android.wm.shell.pip.tv.PipMenuActivity
Test: adb shell dumpsys activity service com.android.systemui
Change-Id: I0ec0e9b9bfc4795a10483acd225f14bde9c72407
2020-09-30 08:54:52 +08:00
Adrian Roos
f694efaa6a Merge changes Ia40a682c,I3118310a
* changes:
  DisplayImeController: reapply visibility when leash changes
  DisplayImeController: Refactor for testability
2020-09-28 16:57:51 +00:00
Adrian Roos
a3eedb3fa8 DisplayImeController: reapply visibility when leash changes
Fixes an issue where the DisplayImeController did not re-apply the visibility
if it receives a new leash.

This lead to focusable IME dialogs not being visible sometimes upon relaunching
the IME target activity, such as during rotation.

Fixes: 162875596
Bug: 160672060
Test: Enable Braille keyboard, open Settings, click on search box, switch to Braille keyboard, on the confirmation dialog rotate the screen; verify the dialog does not disappear.
Change-Id: Ia40a682ca8a9ba669454892e2b453f736c55929c
2020-09-28 17:12:42 +02:00
Evan Rosky
9335d2bfbb Reset Fullscreen Task Surface via SyncTransactionQueue
Split-screen dismisses itself on the SyncTransactionQueue to
prevent glitches/jank. The result, however, is that when one
of the split tasks gets unsplit, it becomes organized. Just
before it becomes organized, though, its windowcrop gets
updated on the sync transaction. Then onTaskAppeared gets
called. Then the sync transaction is applied once drawing
completes.

To resolve this, put the fullscreen transaction on the
syncTransactionQueue as well. In the future, everything that
shell does should probably be serialized in this way (eg.
PiP).

Bug: 169330989
Test: Open app, put it into split, expand the app to fullscreen,
      rotate device and observer no half black screen.
Change-Id: I3a7d3d8650a475b4aa4208bf6be9285e530514a0
2020-09-24 17:24:36 -07:00
Tony Huang
f9f0f791f1 Fix some one handed tests failed
IOverlayManager might be null when tests, change ctor to use mock
one to fix failed tests.

Bug: 167943723
Test: atest WMShellUnitTests
Change-Id: I122d95b258e8fab8993e72aba597b184f126a9e1
2020-09-18 13:25:49 +08:00
Evan Rosky
275bd1b606 Merge "Organize Fullscreen tasks" 2020-09-11 01:56:00 +00:00
[1;3C
b5550919ff Organize Fullscreen tasks
Fix a bug where taskinfo changes weren't recording the
changes.

Add FullscreenTaskListener which is very basic and just
shows surfaces on appear. Fullscreen works fine with
this much because the surfaces are always at 0,0
anyways.

Bug: 162499076
Test: Existing tests pass, phone works like normal
Change-Id: I606bc1cbc85c33c4fc40baf6b3080a1eaa37550c
2020-09-10 16:03:47 -07:00
Nataniel Borges
8d77cf0a06 Merge "Refactor flickerlib dependencies" 2020-09-10 13:50:52 +00:00
Tony Huang
1ed148d3e7 Migrate OneHanded to WM shell (4/n)
Move OneHanded related codes, res and tests to WM shell.

Some tests add ignored currently due to permission issue.
Add another bug to trace it.

Also fix animation issue caused by wrong logic.

Bug: 161980408
Fix: 168074363
Test: manual check one handed function
Test: atest WMShellUnitTests
Test: atest SystemUITests
Test: make ArcSystemUI; make ArcSystemUITests
Test: make CarSystemUI; make CarSystemUITests
Change-Id: Ib25661d010278202ffe15fd9c4962e76e6698c21
2020-09-09 03:04:56 +00:00
Hongwei Wang
f820ea88ad Make WindowOrganizer and TaskOrganizer non-static
This is to allow unit test against TaskOrganizer, WindowOrganizer for
interations between Shell and WM core.

To test on WM side
```
when(mWindowOrganizer.getWindowOrganizerController())
    .thenReturn(mockedWindowOrganizerController);
when(mockedWindowOrganizerController.getTaskOrganizerController())
    .thenReturn(mockedTaskOrganizerController)

doSomeTest();

verify(mockedWindowOrganizerController).somethingHappended();
verify(mockedTaskOrganizerController).somethingHappended();
```

To test on Shell side
```
ShellTaskOrganizer organizer = new ShellTaskOrganizer(
        mockedTaskOrganizerController)

doSomeTest()

verify(mockedTaskOrganizerController).somethingHappended();
```

Removed also
- Singleton pattern in TaskOrganizer and DisplayAreaOrganizer as it's
  redundant to what's in WindowOrganizer
- static getController methods in both TaskOrganizer and
  DisplayAreaOrganizer as we prefer non-static for testability
- static methods in TaskOrganizer in general
- static methods in WindowManagerProxy in general

Bug: 161711455
Bug: 149338177
Test: make sure everything still works
Test: atest WmTests:WindowOrganizerTests \
            WmTests:DisplayAreaOrganizerTest
Change-Id: I978d20c7b87e73d0f6d22f7ab08188e4d12d745c
2020-09-02 18:13:48 +00:00
Nataniel Borges
28823f1d5c Refactor flickerlib dependencies
Previously the flickerlib had some pixel specific code, now it's
general. All pixel specific code either should migrate to FlickerTests
or to flickerlib-helpers

Test: atest FlickerTests
Change-Id: Ibca99f2bf68a511f73130439f6334a01e47a8671
2020-09-01 10:52:13 +02:00