Commit Graph

28 Commits

Author SHA1 Message Date
[1;3C
30233c6fbd Reset Task surface to fullscreen when appeared
Some other modes leave the task surface in a bad state, so if
fullscreen gets onTaskAppeared, reset everything to fullscreen

Bug: 168278812
Test: Open an app, put it into pip, close pip by dragging to X,
      open the app from recents.
Change-Id: Icf4df30eb44fa0a589e7d0bd9be1eb2e72fc492a
2020-09-11 14:26:24 -07: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
TreeHugger Robot
fe4f84bbe0 Merge "Remove Session#getDisplayFrame" 2020-09-10 05:29:20 +00:00
Louis Chang
80ffe3f0ae Merge "Replace StackInfo with TaskInfo" 2020-09-10 00:49:16 +00:00
Riddle Hsu
ccaeffc03f Remove Session#getDisplayFrame
The frame won't be changed if there is no IWindow#resized or
IWindowSession#relayout. So it can be retrieved from these methods
directly instead of another binder transaction.

And because some parameters are usually used together for layout,
the parameters are consolidated into a new ClientWindowFrames.
That reduces changing the interface in the future if the frame
related information needs to be changed.

Also refine the resize handling in ViewRootImpl to make it easier
to read.

There should be no behavior change by this modification.

Bug: 161781274
Test: WmTests, DialogFrameTests

Change-Id: I9f711ad2023442046fa8582944320b98e7c4ecfa
2020-09-10 00:26:11 +08: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
Louis Chang
bfc9e59361 Replace StackInfo with TaskInfo
Bug: 148895075
Test: existing test pass
Change-Id: I97a12397b61f4ee67810dc4ae0423de07d4befa8
2020-09-03 10:13:57 +08: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
Jerry Chang
10ec5e479e Migrate splitscreen to WM shell lib (4/n)
Moves systemui.stackdivider package to wm.shell.splitscreen package.

Bug: 161116823
Test: atest SystemUITests
Test: atest SystemUIGoogleTests
Test: atest CarSystemUITests
Test: manual verified split screen behavior
Change-Id: Ib62450b78da454a7dc93a88272c87b8c12fcc1d8
2020-09-02 13:12:54 +08: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
Jerry Chang
dcf3bf17b7 Decouple DividerView from SystemUI
Moves FlingAnimationUtils to wm shell library as a common utils for both
wm shell and SystemUI.

There are some basic interpolators needed for wm shell library. Since
they are relative basic and already been put into different packages,
duplicates them directly to wm shell library.

Bug: 161116823
Test: atest SystemUITests
Test: manual check divider animation
Change-Id: Iffabb7eff829cad69ef3d273b803f8fbd3ab6685
2020-09-01 10:24:38 +08:00
Winson Chung
eb1aa3d9a5 Extending SysUI proto dump to WMShell
Bug: 161980310
Test: adb shell cmd statusbar tracing start/stop
      adb pull /data/user_de/0/com.android.systemui/files/sysui_trace.pb

Change-Id: Ie99eac753905ee9938a84571943c85b0a2ad29ee
2020-08-27 07:11:36 +00:00
Winson Chung
b754f5281b Add some protologs for window organizers & shell
- Refactor out base protolog impl so that shell can have it's own
  implementation which takes a different viewer config (from the resources
  directly instead of a separate file in /system/etc)
- Setup the protolog transform for shell classes
- Add some basic protologs for displayarea/task organizer controller
  & shell task org (for now only text logging)

Bug: 161980327
Test: adb shell wm logging enable-text WM_DEBUG_WINDOW_ORGANIZER
Test: adb shell dumpsys activity service SystemUIService WMShell enable-text-logging WM_SHELL_TASK_ORG
Test: atest ProtoLogImplTest \
            ProtoLogViewerConfigReaderTest \
            WmTests:ProtoLogIntegrationTest \
            LogDataTypeTest \
            protologtool-tests
Change-Id: I4c3fd6aaea04987c26ac56e9baf9fc8ab75a3f34
Signed-off-by: Winson Chung <winsonc@google.com>
2020-08-25 10:07:55 -07:00
Ben Lin
abaefa0c67 Migrate from PipMenuActivity -> PipMenuView.
Bug: 161710689
Test: Build and run
Change-Id: I879502085daefd3dbfbe437410a29c3353c5cf1a
2020-08-24 15:42:56 -07:00
Hongwei Wang
abff40bc85 Merge "Add flicker test for WM Shell" 2020-08-21 00:52:09 +00:00
Hongwei Wang
bbf561ac3a Add flicker test for WM Shell
Separated folders in libs/WindowManager/Shell/tests
- unittest, for unit tests
- flicker, for this flicker tests
- propose to add functional/ folder for functional tests

Note also
- Copied over EnterPipTest from existing flicker tests as proof of
concept
- TODO: need to figure out the next step for the flicker test library
itself as it's currently packaged in com.android.server.wm

Bug: 161561007
Test: atest WMShellFlickerTests
Test: atest WMShellUnitTests
Change-Id: Ic06e7cb0f98151591ccb9f5217260939349a9aa5
2020-08-20 16:13:57 -07:00
Jerry Chang
ad61a28f27 Migrate splitscreen to WM shell lib (2/n)
Removes Divider from SystemUI component list since it is no longer
needed after the split screen feature migrated to WM shell library.

Provides optional controller of split screen for sysui components to
use. Different varients of SystemUI could leverage dagger module to
decide whether to load the controller or not.

Implements WMShell component in SysUISingleton scope to help delegating
sysui specific events to WM shell controllers.

Detached DisplayImeController's initialization step from split screen
feature with the reason that some of SystemUI varients might not have
split screen feature.

Bug: 161116823
Test: atest SystemUITests
Test: atest SystemUIGoogleTests
Test: atest CarSystemUITests
Test: manual verified spliscreen behavior
Change-Id: I4220b5ce53bc7b793b95cfca34100e808b9f052c
2020-08-20 15:30:14 +08:00
Winson Chung
4421f2888d Add mechanism to register single task organizer
- Create a single task organizer in SysUI which registers as an organizer
  for multiple windowing modes internally in TaskOrgController.

Bug: 161980327
Test: atest WindowOrganizerTests
Test: atest SplitScreenTests
Test: atest PinnedStackTests
Test: atest ShellTaskOrganizerTests
Change-Id: Ic9dfbd6bcd75d9317e5a3aeb695afdff7e869d35
2020-08-18 23:36:59 -07:00
Jerry Chang
c7ab3115b7 Migrate wm package in sysui to WM shell lib (4/n)
Seperate display listener registration out of constructor to prevent
circular initialization problem. Use builder to make sure
DisplayImeController and DisplaySystemBarsController will be initialized
properly.

Fix: 161963879
Bug: 161655636
Test: make CarSystemUI
Test: atest CarActivityViewDisplayIdCrashTest
Change-Id: I1104f7bc506d1194d8a2c016106647663d4d24ed
2020-07-29 16:24:06 +08:00
Jerry Chang
8a94cc7096 Clean up dependencies to SystemWindows
There're some classes reaching to DisplayController and IWindowService
through SystemWindows, decouple SystemWindows from these classes and
inject needed instances directly. Update to use view.getContext instead
of injecting context from SystemUI.

Bug: 161655636
Test: atest WindowManagerShellTests
Test: atest SystemUITests
Change-Id: Ic6da21d6e407d222660b86bfb0f975c4f784b7f5
2020-07-22 14:58:33 +08:00
Jerry Chang
919d1d280e Migrate wm package in sysui to WM shell lib (1/n)
Bug: 161655636
Test: atest WindowManagerShellTests
Test: atest SystemUITests
Change-Id: I42f13ee7fbb14ba3b7f33ed5654ec72454dc6dba
2020-07-22 11:46:04 +08:00
Ben Lin
be8b9eb16d Add ability to change PiP menu icon locations on the fly.
This CL does:
- Add a PipMenuIconsAlgorithm, allowing calculation on the fly for
correct locations of individual icons
- Make it so that when PIP changes its bounds, it updates the location
of the action items accordingly (if needed)

Bug: 160825579
Test: enter PIP, icons are still where they are
Change-Id: I8618f7c5c36c8e09613c126c1ebb20b60e95de58
2020-07-17 23:43:32 +00:00
TreeHugger Robot
caba160489 Merge "Migrate PIP resources from SystemUI to WM shell lib (3/N)" 2020-07-17 05:20:12 +00:00
Bill Lin
78c4babe4d Migrate PIP resources from SystemUI to WM shell lib (3/N)
Note: packages/SystemUI/res/values-sl/strings.xml contain blocked
      keywords, left the strings file unchanged
Test: make SystemUI
Test: make ArcSystemUI
Test: make WindowManager-Shell
Test: atest SystemUITests
Bug: 161118569
Change-Id: I1c70d4e92befdc2e53723eec66fe1e6477b9ea14
2020-07-17 11:33:39 +08:00
Jerry Chang
aa943b2039 Compiles wm shell against the platform APIs instead of SDK
WM Shell should be compiled against the platform APIs and thus should
leave sdk version empty. The value of platform_apis will be ignored when
module's type isn't android_app, remove it as well.

Bug: 161116823
Test: manual verified it could access to @hide APIs
Test: make WindowManager-Shell
Test: atest WindowManagerShellTest
Change-Id: I145b0d6352a6e10a2f4051a561e65c282374fa7c
2020-07-16 14:42:21 +08:00
Andrii Kulian
db4f5466b9 Move WindowManager Shell from packages/ to libs/
Test: Build
Change-Id: I03833b0aff5836cc00b8371907f9059aa1acc5b1
2020-01-21 11:48:19 -08:00