Commit Graph

423 Commits

Author SHA1 Message Date
wilsonshih
285feba168 Mirror TaskSnapshotSurface to WMShell(2/N)
- Let WMShell able to draw task snapshot surface.
- Create new class StartingWindowInfo to pass needed data from WM to
Shell.
- Rename TaskSnapshotSurface -> TaskSnapshotWindow in WMShell.
- Mirror and modify a new TaskSnapshotWindowTest in WMShell.

Bug: 131727939
Test: atest WindowOrganizerTests ActivityRecordTests
TaskSnapshotWindowTest StartingSurfaceDrawerTests
Test: build and flash, check shell able to show/remove
TaskSnapshotWindow

Change-Id: I70dec8ce2bf1ed7d876657324e51357690c8b396
2020-12-17 11:00:07 +08:00
Jerry Chang
2c8ea7b021 Fix showing black background when resizing the divider bar.
Reports resizing state to WM core so that app client could apply bigger
visible bounds while resizing splits. Also moves DividerHandleView to
more generic package.

Fix: 172704238
Test: manul check divider behavior
Test: atest WMShellUnitTests
Change-Id: I1656c86de9a0b5dfe5e6da57ccc9d5f6e467843a
2020-12-17 07:39:24 +08:00
Mady Mellor
a5b6b7655f Merge "Intercept back press for TaskView" 2020-12-16 16:07:04 +00:00
Sergey Nikolaienkov
ecad63042b Fix Pip tests after Pip Menu migration to a Window
Instrumentation tests on TVs used to use UiObject2.click() method to
interact with UI elements. This was inject input events that would
prompt input framework to enable the touch mode on the device. This was
wrong as TV devices are not expecting to work in the touch mode.
Migration of Pip menu from an Activity to a Window exposed this issue,
which caused multiple TV Pip tests to fail.
With this CL we change the way we interact with UI: we only are using
DPad navigation, which also means that we have to "track" the focused
element.

Bug: 174818743
Test: atest WMShellFlickerTests:TvPipBasicTest
Test: atest WMShellFlickerTests:TvPipMenuTests
Test: atest WMShellFlickerTests:TvPipNotificationTests
Change-Id: I335f8fd8d9c840f751d207c5e60b6af582118fee
2020-12-16 10:34:34 +00:00
Ming-Shin Lu
460e9b6bce Merge "Move TaskSnapshot into android.window package" 2020-12-16 05:48:03 +00:00
jorgegil@google.com
b630bb2802 Prevent duplicate call to update movement bounds on rotation
When rotating the display while in PIP mode, there's 1 call
to reset the shelf offset back to zero which triggers a call
to PipController.updateMovementBounds(fromShelfAdj=true).
Then, another call is made immediately to
PipController.updateMovementBounds(fromRotation=true).

While both are useful when called independently, we now
avoid calling the first on rotation, otherwise it'll try to
offset the pre-rotation PIP bounds and use those bounds as
the post-rotation bounds instead of calculating the new bounds
using the rotated display and the previous snap fraction.

Bug: 174669093
Test: PIP position is preserved when rotating the home screen
Change-Id: I071ace219bd26a5c8078b60c77a8b2442470305c
2020-12-15 15:12:03 -08:00
Mady Mellor
81260f05a2 Intercept back press for TaskView
This existed as part of MultiWindowTaskListener but got
lost at some point when that went away.
Adds a test to ensure TaskView sets to intercept.

Test: atest TaskViewTest
Fixes: 172362619
Change-Id: Ia84865b783966ded1257bd1cf3552a2255419234
2020-12-15 14:45:38 -08:00
Wale Ogunwale
fe982c0bef Merge "Added support for RootTaskDisplayAreaOrganizer" 2020-12-15 14:15:21 +00:00
Hongwei Wang
b8d35d1053 Provide vsync id for PiP animation
The vsync-id is attached to every SurfaceControl.Transaction within
PipAnimationController and therefore it's available to onAnimationStart,
onAnimationEnd as well as onAnimationUpdate.

What's next: may need to provide vsync id for PiP animation running in
Launcher process as well.

Bug: 166302754
Test: atest PipAnimationControllerTest
Change-Id: I5d413320f435e65d7e3e375bb2266e1bba23e0d7
2020-12-14 13:43:32 -08:00
Wale Ogunwale
062b17a171 Rename splitscreen package to legacysplitscreen
Split-screen implementations moving forward would be based on app-pairs
and main/side stage models. So, renaming existing package to avoid
confusion.

Bug: 175416931
Test: They pass!
Change-Id: I55ab1d27fb1c00ba7a58d685ea7eb2840efb9437
2020-12-14 12:13:11 -08:00
Wale Ogunwale
1bf5680b38 Added support for RootTaskDisplayAreaOrganizer
Allows shell to have information on the parent container for tasks so it
can do things like attach other surfaces to it. E.g. split-screen
divider.

Also, have DisplayAreaOrganizer ctor take an executor so incoming calls
from the binder threads can be posted to the main thread.

Bug: 175416931
Test: They pass!
Change-Id: Ia3d0b978cf43badd8c495b75708aa027fe9a2aa1
2020-12-14 11:36:44 -08:00
TreeHugger Robot
5cbcf7619f Merge "6-1/ Integrate SplitScreen rotation flicker tests" 2020-12-14 06:34:47 +00:00
TreeHugger Robot
bde6cfbd10 Merge "Clean up LetterboxTaskListerner and all related logic." 2020-12-13 17:36:25 +00:00
Ming-Shin Lu
b6c4b82ebf Move TaskSnapshot into android.window package
Bug: 166736352
Test: build pass
Test: atest CtsWindowManagerDeviceTests
Change-Id: I7f03524f018ceb64c109fd9d78abeb0ea98b6ea5
2020-12-13 15:28:56 +00:00
Mariia Sandrikova
2f37c38f33 Clean up LetterboxTaskListerner and all related logic.
This is the first step towards moving letterbox gravity logic from WM Shell to WM Core. It's important to do this even before the new implementation in WM Core is ready because surface repositioning in WM Shell causes visible flickering on rotation for all apps on devices with cutout.

Fix: 174632285
Bug: 175212232
Fix: 173440321
Test: atest WMShellUnitTests
Change-Id: I2b3706a1a46bb2c7ee4bb3789fb09b216e32f290
2020-12-13 15:17:11 +00:00
Bill Lin
60ae7ac35b 6-1/ Integrate SplitScreen rotation flicker tests
Enable the rotation tests and aling the structure of WMShell
Flicker test cases

Bug: 169271943
Test: atest WMShellFlickerTests:RotateOneLaunchedAppTest
Test: atest WMShellFlickerTests:RotateTwoLaunchedAppTest

Change-Id: Ieeafc42562e99c5aa26547625b13ec2af35871c1
2020-12-11 17:13:54 +08:00
Bill Lin
3e2cf2ea9c 5-1/ Migrate CTS split screen testNonResizeable tests
1. testNonResizeableNotDocked
2. testNonResizeableWhenAlreadyInSplitScreenPrimary
3. testNonResizeableWhenAlreadyInSplitScreenSecondary
4. Refine the test flow to be more effeciency

Test: atest WMShellFlickerTests:EnterSplitScreenTest
Test: atest WMShellFlickerTests:AppPairsTest
Bug: 161435597

Change-Id: I271a522f220a65b1be7de6599a9ed185f06888b3
2020-12-11 17:13:54 +08:00
Jerry Chang
18ea005b80 Merge "Add fling animation when snapping split divider bar" 2020-12-11 05:56:37 +00:00
Mady Mellor
c6eec7e57f Merge "Use shell executor for TaskView" 2020-12-11 03:38:29 +00:00
Evan Rosky
cf45363705 Merge "Some cleanup/rearrangement of shell transitions things" 2020-12-10 20:37:51 +00:00
Mady Mellor
6673b31638 Use shell executor for TaskView
Bug: 161980186
Test: atest TaskViewTest
Change-Id: I85764463ada847e2f0c8e82c5744212ee8bb2a9d
2020-12-10 12:19:09 -08:00
Jorge Gil
9e28c670db Merge "Don't save the default size as reentry state" 2020-12-10 20:01:10 +00:00
Evan Rosky
c5b5c7611f Some cleanup/rearrangement of shell transitions things
Some stuff changed underneath, so we can do a little bit
of housekeeping

Bug: 169035082
Test: nothing changed
Change-Id: I70c668d5760cd6fb9ddfd56720e0b712bd7520fc
2020-12-10 10:36:45 -08:00
Mariia Sandrikova
e714b0389f Merge "Letterbox: show activity under insets when possible or needed" 2020-12-10 11:09:12 +00:00
Jerry Chang
5935f559b6 Add fling animation when snapping split divider bar
Bug: 172704238
Test: atest WMShellUnitTests
Test: manul check the fling behavior
Change-Id: Iead37be86d55de2ce357165a2f6ae910f36969cb
2020-12-10 13:28:49 +08:00
Bill Lin
1974bdc4ba Align SplitDivider layer name for AppPairs flicker test
Test: atest com.android.wm.shell.flicker.apppairs
Test: go/wm-tests-flicker should become green
Fixes: 175230170
Bug: 172704238
Change-Id: I210430a9f36fe8aca43bc0e97d29b5530c9dcb28
2020-12-10 13:26:36 +08:00
Mariia Sandrikova
41eff6820e Letterbox: show activity under insets when possible or needed
Activity handles insets on its own (e.g. under status bar or navigation bar). After task's surface is repositioned, intersection between an activity and insets can change but if it doesn't, the activity should be shown under insets to maximize visible area.

Also, an activity can use area under insets and insets shouldn't be cropped in this case regardless of a position on the screen.

Test: atest LetterboxTaskListenerTest
Fix: 174086576
Change-Id: I84cd28520ead3fb0099f15cc672167871c7d78a1
2020-12-09 01:45:39 +00:00
jorgegil@google.com
2c0e01b240 Don't save the default size as reentry state
Fixes issue where the "default" bounds of PIP can be calculated
differently even though the PIP has never been resized. This is
caused by a combination of changing the aspect ratio of PIP and
trying to restore the "reentry" state that is just the default
state.

Instead, we'll only calculate the PIP bounds using the reentry
size if the size was actually changed by the user, otherwise
we'll always calculate using the default size.

Bug: 169379707
Test: atest com.android.wm.shell.pip
Change-Id: I724b167870407f7f37eb9c8a587a98c7972441a4
2020-12-08 12:27:49 -08:00
Ben Lin
014f2975ce Re-implement pinch-to-resize gesture.
This removes ScaleGestureDetector and instead just do the calculation
inside the class itself. As user sets two input points on the PiP
surface, this signals the start of the gesture, and as user drags the
two fingers, it resizes the PiP to the maximum possible size. After the
user releases their fingers, then it auto-offsets/snaps to the right
position.

Bug: 166478885
Test: Start a pinch-to-resize while feature flag is on
Change-Id: I634bd14e97f0cf0cc7bf9c1a1b64a1f12130e0e9
2020-12-04 17:46:24 -08:00
Antonella Dellanzo
61406d1ed2 Merge "Removing duplicated code" 2020-12-04 09:21:35 +00:00
TreeHugger Robot
1fa042b64f Merge "Support dragging divider bar of app-pair to resize the splits" 2020-12-04 03:03:34 +00:00
Winson Chung
94132e14a9 1/ Initial preparation for separate shell main thread
- Add @BinderThread/@ShellMainThread/@SysUIMainThread annotations
  for some common shell classes and callbacks
- Add mechanism to inject shell-anim/shell-main/sysui-main/etc
  executors (removed AnimationThread static instance)
(Note: The shell main thread will still be the sysui main thread)

Bug: 161979899
Test: atest WMShellUnitTests

Change-Id: I4adfeaebe5b79fab7c9451eef7b54fcdf4d8d40a
2020-12-03 10:42:48 -08:00
Jerry Chang
0c9c2cfac1 Support dragging divider bar of app-pair to resize the splits
Update SplitLayout and DividerView to support dragging divider bar and
make them more generic to be able to share among different split impl.

Bug: 172704238
Test: manual check the behavior of divider bar
Test: atest WMShellUnitTests
Change-Id: I16ed1fd86bdff4d8544c5787c95315c59055ad04
2020-12-04 01:49:58 +08:00
TreeHugger Robot
6f3ed806b6 Merge "DisplayImeController: fix out-of-sync IME visibility" 2020-12-03 15:40:40 +00:00
Adrian Roos
a18650bef8 DisplayImeController: fix out-of-sync IME visibility
Fixes an issue where the DisplayImeController would disagree with
the InputMethodManagerService about the visibility of the IME.

Currently, the Insets component is supposed to execute the
visibility as dictated by IMMS; however, when the DisplayImeController
became the control target, previously it would just apply the IME
visibility that was last requested of it - regardless of the
changes to it that may have happened while it was not the control
target.

Eventually, IME visibility should be driven by the requested IME
inset visibility of the focused window, instead of the separate
dispatch we have now from IMMS.

Bug: 167780081
Test: atest DisplayImeControllerTest ImeInsetsSourceProviderTest
Change-Id: I1f140af6bcccbcbe6efb2fde9a789ac4c7bd127f
2020-12-03 13:55:25 +00:00
Nataniel Borges
e4b1ddde99 Merge "Store and pull files from /sdcard/" 2020-12-03 10:53:17 +00:00
Nataniel Borges
2ed07b4ef9 Store and pull files from /sdcard/
Tradefed FilePullerLogCollector can no longer access the internal app directory (e.g. /storage/emulated/0/Android/data/com.android.server.wm.flicker/files).

This makes it unable to pull trace files, when a test fails. This CL makes flicker tests store their data on /sdcard/flicker which can be accessed by the Tradefed FilePullerLogCollector

Bug: 171026227
Test: atest WMShellFlickerTests
Change-Id: Ie2329cbc475ee1be35e6bb3e274c96a4db142ac5
2020-12-03 10:11:25 +01:00
Ben Lin
429355b910 Merge "TV-PiP: Migrate Menu to SystemWindows." 2020-12-02 22:07:10 +00:00
Antonella Dellanzo
769b84f85c Removing duplicated code
There's duplicated code in CommonAssertions of WMShell project and FlickerTests. We are keeping the one from FlickerTests and removing the one from WMShell to avoid problems of changing it in one place and forgetiing about the other project.

Test: atest WMShellFlickerTests
Change-Id: Ie87df793933d9cbe0ccd947514027650811a1819
2020-12-02 16:19:13 +01:00
Antonella Dellanzo
d921d9fa9e Marking split screen rotate tests as flaky
Adding the flakytest annotation to the tests SplitScreenRotateOneLaunchedAppTest and SplitScreenRotateTwoLaunchedAppTest as seems to crash the device every so often.

Test: atest WMShellFlickerTests
Change-Id: Ie0dcfb60618afbed84b043b1c467a4e74e6cba2e
2020-12-02 13:31:05 +01:00
Antonella Dellanzo
98ce694b1a Merge "Add presubmit tag for OpenAppToSplitScreenTest" 2020-12-02 10:34:14 +00:00
Antonella Dellanzo
4aed7225c0 Merge "Add test transition SplitScreenRotateTwoLaunchedAppTest" 2020-12-02 08:42:49 +00:00
Antonella Dellanzo
63d76ac51c Merge "Add new test transition SplitScreenRotateOneLaunchedAppTest" 2020-12-02 08:42:24 +00:00
TreeHugger Robot
63f0674b06 Merge "Handle app pair divider bar rotation" 2020-12-02 01:46:49 +00:00
Ben Lin
819f82ba1d TV-PiP: Migrate Menu to SystemWindows.
Bug: 169574665
Test: Run PiP on TV

Change-Id: Ia6d0e6f7c88c4cc59e21700b70d74e09cf8fc519
2020-12-01 16:51:25 -08:00
Mariia Sandrikova
5500c017b3 Merge "Apply insets to max bounds instead of parent bounds in letterbox mode." 2020-12-01 18:03:13 +00:00
Antonella Dellanzo
22316abb45 Add new test transition SplitScreenRotateOneLaunchedAppTest
Add a new test (only the transition) called SplitScreenRotateOneLaunchedAppTest. This test will open one app in splitscreen and in the transition will test rotate the device.

Test: atest WMShellFlickerTests
Bug: b/171049764
Change-Id: I92c36f92e49e8cf617fa682bde078c8aff5962a5
2020-12-01 09:48:20 +00:00
Antonella Dellanzo
f6d554e894 Merge "Move tests to Presubmit" 2020-12-01 09:00:58 +00:00
Jerry Chang
f5592d148b Handle app pair divider bar rotation
Add logic to rotate app pair divider bar and add more tests.

Bug: 172704238
Test: AppPairTests, AppPairsPoolTests, AppPairsControllerTests
Test: AppPairLayoutTests
Test: manual check the behavior of divider bar.
Change-Id: Icb51cfaea04b1a9fd04cbb2bc868897d8428d483
2020-12-01 12:11:41 +08:00
Mariia Sandrikova
398454ff68 Apply insets to max bounds instead of parent bounds in letterbox mode.
Applying insets directly to parent bounds don't always work because parent bounds may not be equal to max bounds. For example, this happens when "Developer options > Display Cutout > Hide" option is selected or in One-handed mode.

Fix: 174211584
Test: atest WMShellUnitTests
Change-Id: I7415629aab39e5aac6c038f27494b87667ef84d9
2020-11-30 22:04:53 +00:00