Commit Graph

67 Commits

Author SHA1 Message Date
TreeHugger Robot
56af862615 Merge "Reset WindowContainerTransaction when rotation changed callback" 2020-10-08 06:05:19 +00:00
TreeHugger Robot
0e4965517e Merge "Respect feature flag when providing OHM controller" 2020-10-08 05:38:48 +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
TreeHugger Robot
d24f91538e Merge "Disallow multiple listeners in the shell task org for the same win mode" 2020-10-06 19:01:30 +00: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
Jerry Chang
d8cb9140a9 Respect feature flag when providing OHM controller
Bug: 170188471
Test: atest SystemUITests
Test: atest WMShellUnitTests
Change-Id: I222a7c0a0f34771df3cfbd99f14ff79b2c5aaa73
2020-10-06 18:42:26 +08:00
TreeHugger Robot
d8ba97d66c Merge "Annotating To-Pip CUJ" 2020-10-06 04:10:16 +00:00
Hongwei Wang
86c8af2d1e Merge "Improve PIP enter transition w/ gesture nav (2/N)" 2020-10-06 04:09:06 +00:00
Louis Chang
672024518f Merge "Renaming Stacks APIs to RootTasks" 2020-10-06 03:41:45 +00:00
vadimt
2c2d5b0798 Annotating To-Pip CUJ
Test: checking that the APIs are called
Bug: 169220924
Change-Id: Ica34053dcd26869fe005663e6d07c32be42d49f3
2020-10-05 18:38:21 -07:00
Ben Lin
a7578af121 Merge "Refactor/Clean up on PiP dismiss code." 2020-10-06 00:51:35 +00:00
Louis Chang
d1b79549d2 Renaming Stacks APIs to RootTasks
This CL is aimed to refine the AM/ATM API surface. The other
stack naming internally spread in AM and ATM will be covered
in later CLs.

Also Consolidate #removeStack() with #removeTask().

Bug: 157876448
Test: existing tests

Change-Id: I1254f972dab3bbe66a736a0402eebce9d0fb1496
2020-10-06 08:39:18 +08:00
Ben Lin
8e9a380681 Refactor/Clean up on PiP dismiss code.
- Moved all Dismiss-magnet related logic into PipDismissTargetHandler
- Removed Dismiss fraction related code

Bug: 170151121
Test: Manual
Change-Id: Ic0a6d3926264b877f2c122552a740c93ab45400c
2020-10-05 14:14:37 -07:00
Hongwei Wang
cf1d1b853a Improve PIP enter transition w/ gesture nav (2/N)
Allow Launcher to query destination bounds of PiP window from SysUI.
Add also the callback notifies SysUI that the swipe-pip-to-home
operation is finished.

PipTaskOrganizer would ignore the entering transition if
swipe-pip-to-home should happen in Launcher.

Next: handle the swipe-pip-to-home transition in Launcher

Bug: 143965596
Test: N/A
Change-Id: Ia8bbdfcd4ed92c7ed968be84f0bf991feac8598e
2020-10-05 12:18:28 -07:00
Wale Ogunwale
f1c1fd27b4 Added WindowManagerWrapper#setProvidesInsetsTypes
Allows launcher to set providesInsetsType on a window
Also, cleaned up ctor for ShellTaskOrganizer to reduce
duplicate code.

Bug: 169054709
Test: builds
Change-Id: I9e1f4a27b924013c0b6b17f0a5e10ac3411cbf4e
2020-10-02 15:32:22 -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
TreeHugger Robot
abd78597df Merge "Move Pip codes from SysUI to WMShell lib (9/N)" 2020-09-30 03:45:54 +00: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
Jerry Chang
cc6f1136be Hide IME adjust dims when exiting split mode
If the IME is showing while exiting split mode, the IME-adjust dims
won't be changed to hidden. This makes sure to hide the IME-adjust dims
when leaving split mode.

Fix: 168505685
Test: atest SystemUITests
Test: atest WMShellUnitTests
Test: manual check switching user while showing IME in split mode,
      there won't have overlapping dim remains on the screen.
Change-Id: I778df71616827c01f415231d8bbc20b037181d10
2020-09-29 21:02:20 +08:00
Jason Chang
e1f4f8e0dd Merge "Fix to support talkback function for tutorial message" 2020-09-29 06:26:29 +00:00
TreeHugger Robot
e86bb69506 Merge "Migrate recents.splitPrimaryTask to WM Shell library" 2020-09-28 23:44:02 +00: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
Adrian Roos
bfdfe0ec42 DisplayImeController: Refactor for testability
Bug: 162875596
Test: atest WMShellUnitTests
Change-Id: I3118310a391592fcc72ea6ef8b4b8adccce2f14f
2020-09-28 17:12:42 +02:00
Tiger Huang
b7d379147e Merge "Remove redundant logic about System UI visibility" 2020-09-28 13:30:22 +00:00
Jerry Chang
51beb146da Migrate recents.splitPrimaryTask to WM Shell library
There were some legacy ways to trigger split screen through
Recents.splitPrimaryTask. Decouples the API from Recents and migrates it
to WM Shell library.

Removes SplitScreen.onDockedTopTask and SplitScreen.onRecentsDrawn
because we have SplitScreenTaskOrg to instantiate new deivider bar and
resize primary/secondary split after entering split screen mode.

Fix: 169056724
Test: atest SystemUITests
Test: atest WMShellUnitTests
Test: manual trigger splitPrimaryTask api and check
Change-Id: I68979e2e32c7ff36d35ae451c81dcf09e2dc5ef6
2020-09-28 11:45:24 +08:00
Tiger Huang
a9b8fa272c Remove redundant logic about System UI visibility
This CL removes
- mSeq
- System UI flags used to communicate between WMS and System UI
- redundant AIDL methods
- redundant fields and methods
- redundant tests
- PolicyControl

This CL also
- refines the format in DisplayPolicy#dump
- sends a boolean to InputManager to indicate if System UI is in a low
  profile mode instead of sending the legacy system UI visibility

Bug: 149813814
Fix: 169105126
Test: presubmit
Test: dumpsys window displays
Test: See if the layout of ImmersiveModeConfirmation is as expected
Change-Id: I8c8df509355bebc9b560af57d5458614557bcd2f
2020-09-28 02:04:21 +08:00
Evan Rosky
89d86a31e6 Merge "Reset Fullscreen Task Surface via SyncTransactionQueue" 2020-09-25 16:28:33 +00:00
Jason Chang
736ceb0198 Fix to support talkback function for tutorial message
1) Enable tutorial's touchable WindowManager.LayoutParams
2) Set window container transaction to align the latest windows bounds
information

Bug: 168178198

Test: manual
Test: atest SystemUITests
Change-Id: I48720bb3b344d984421b591876a503ce59d1f4c2
2020-09-25 15:47:11 +08:00
TreeHugger Robot
f2a595df2f Merge "Remove legacy involveSplitScreen API" 2020-09-25 01:44:10 +00: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
Jerry Chang
50d7af9763 Remove legacy involveSplitScreen API
The onSplitScreenInvoked was used to notify system ui to reset the
divider position before entering split screen. With
SplitScreenTaskOrganizer, WM Shell library could know the exact time
when entering/leaving split screen mode now, so removes the API and
deals with the divider bar position in WM Shell library scope directly.

Resets mRatioPositionBeforeMinimized when dismission split screen since
the informaiton is no longer needed, it will leverage the creation flow
of DividerVew to assign the default target to the new divider bar.

This change will also make sure to reset the divider bar target even
when users are not triggering split screen from recents app shortcut.

Fix: 168869136
Test: atest WMShellUnitTests
Test: atest SystemUITests
Test: manual check the split screen behavior
Change-Id: Icd84a8c1559d0f5f0f99b22445410112fa517efe
2020-09-24 10:26:56 +08:00
Jason Chang
34990bab42 Merge "Fix TalkBack doesn't inform users whether the screen has entered or left the one-handed mode" 2020-09-22 11:50:51 +00:00
Heemin Seog
efff36c387 Merge "Adjust window focusable by view controller" 2020-09-18 23:07:44 +00: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
Sunny Goyal
f709bd25d8 Fixing gradle build for SystemUI
Test: Verified build locally
Change-Id: If850fd6381f1453814653c4feec85059cf788598
2020-09-17 19:30:09 +00:00
Winson Chung
d2b6017684 Link wm shell command to enable protolog in shell
- Pass through unhandled logging commands to SysUI to simplify
  enabling/disabling logging for the shell.

Bug: 168497382
Test: adb shell wm logging enable-text WM_SHELL_TASK_ORG
Test: adb shell wm logging enable-text WM_DEBUG_RECENTS_ANIMATIONS
Change-Id: I37942eaee82fdcf545212b18375f3d3e2638b8ee
2020-09-15 12:18:50 -07:00
[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
Jason Chang
ea9cc9bc38 Fix TalkBack doesn't inform users whether the screen has entered
or left the one-handed mode

Add start/stop one-handed mode text to an AccessibilityEvent
enabling Talkback talks.

Bug: 157121791

Test: manual
Test: atest SystemUITests
Change-Id: I29fa8d7221ecb661df90a3c929e36815aa989ae2
2020-09-11 19:54:11 +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
Heemin Seog
91d05ae638 Adjust window focusable by view controller
Some adjustments to note:
1. remove previous focusability changes per view controller
2. disallow calling insetsController.show/hide without window focus
3. update tests to depend on window focus
4. update DisplaySystemBarsController to refer to parent class for ime
insets

Bug: 163135884
Test: manual, atest :carsysui-presubmit
Change-Id: If5adf599bc2c676ad296f89566534c1fdc9f2492
2020-09-10 18:08:22 +00: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