Commit Graph

83 Commits

Author SHA1 Message Date
Chavi Weingarten
c843f827df Merge "Removed separate SurfaceControl for Blast" 2020-10-14 23:42:46 +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
chaviw
4a10b38ad4 Removed separate SurfaceControl for Blast
If Blast was enabled, WindowStateAnimator would create a container layer
and then a blast layer as a child. This caused some issues with
reparentChildren and relative Z, so instead of trying to continously fix
those issues, just use one layer. If blast is enabled, it will create a
single SurfaceControl with type blast. Otherwise, it will create a
BufferQueueLayer.

This means that we have to be careful with setting any properties on
the layer since the blast adapter could also be modifying the layer.
This is in the right direction since we will move all transactions for
the layer to the client, eventually.

Test: YT and Chrome with and without Blast
Change-Id: I43efc37663696ba8e54d341a03531f0048ee6a14
2020-10-13 17:48:57 -07:00
TreeHugger Robot
7c4bea4b70 Merge "Revert "Use out pipBounds to save reentry size"" 2020-10-13 22:47:49 +00:00
Jorge Gil
5f6523cdf4 Revert "Use out pipBounds to save reentry size"
This reverts commit a6e524e127.

Reason for revert: should not use current pipBounds as reentry bounds when the bounds are temporarily expanded due to active menu

Bug: 170748861

Change-Id: I26a2ce4d9fb70db051b941ff09cdb423513b9ffc
2020-10-13 21:06:38 +00: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
5570588154 Merge "Use out pipBounds to save reentry size" 2020-10-12 16:55:50 +00:00
jorgegil@google.com
a6e524e127 Use out pipBounds to save reentry size
Currently, when an out PIP transition happens we combine:
(1) the last user resized bounds, plus
(2) the out pipBounds fraction (mLastReportedBounds)
Using both we create the reentry bounds used to restore
on reentry.

This is actually unnecessary since ag/12307605 and
ag/12309037 both landed. They landed as separate
efforts fixing different issues almost at the same time,
so we didn't realize that getting the last user  resized
bounds was no longer necessary with the safe
mLastReportedBounds (i.e. pipBounds) passed into
onPipTransitionStarted.

The pipBounds argument is equal to the last user resized
size with the current fraction applied, so there's no need
to re-calculate it, we can just use it directly.

Bug: 169373982
Test: enter/exit pip and resize multiple times to verify the
reentry size is correct.

Change-Id: I2517d10bfbc8ca9c15b08b32089bdeeb1dd3aab6
2020-10-09 15:31:06 -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
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
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
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