Commit Graph

154 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
Jorge Gil
6e506c34f7 Merge "Replace PipMotionHelper.mBounds with PipBoundsState" 2020-10-29 19:44:08 +00:00
Chris Li
97c97911c5 Merge "Return the existing DisplayAreas when registering an organizer" 2020-10-29 17:07:24 +00:00
TreeHugger Robot
46b043f746 Merge "Fix Pip dependenices on TV" 2020-10-29 16:43:07 +00:00
Sergey Nikolaienkov
0b495ea0c3 Fix Pip dependenices on TV
Fix crash in .tv.PipController: .tv.PipController creates a
PipNotification object before assigning mPipMediaController, but
PipNotification calls PipController#getPipMediaController() from its
constructor, receives null, and causes NPE when tries to subscribe to
it.
This CL fixes the crash by providing PipNotification with a
PipMediaController reference directly (as a constructor param).

Bug: 169575409
Bug: 165795012
Test: make && flash adt3-userdebug
Test: atest android.systemui.cts.tv.MicIndicatorTest
Change-Id: I0010863921607cc315acfcbe0cb9d181b79d26b2
2020-10-29 12:56:47 +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
jorgegil@google.com
67a01cf8ff Replace PipMotionHelper.mBounds with PipBoundsState
Bug: 169373982
Test: com.android.wm.shell.pip
Change-Id: Ib470fd5e4fad35bdfa95f58c6b18a8671a539e34
2020-10-28 21:36:15 -07:00
Jorge Gil
eed8af911a Merge "Add tests to verify last pip component name updates" 2020-10-28 20:34:17 +00:00
Chris Li
a9e67cd9aa Return the existing DisplayAreas when registering an organizer
A list of existing DisplayAreas of the given feature are returned when
registering the organizer, and the organizer will not receive
onDisplayAreaAppeared() for these DisplayAreas.

Fix: 162028888
Test: atest WmTests:DisplayAreaOrganizerTest
Test: atest OneHandedDisplayAreaOrganizerTest
Change-Id: I3f4c5921a31c06e5b6c0040397df15cdee6ebcdd
2020-10-28 12:09:09 -07:00
Sergey Nikolaienkov
63a37a3a29 Use PipMediaController in .tv.PipController
Make .tv.PipController rely on PipMediaController for media session
monitoring and managering.
Refactor .tv.PipControlsViewController to use PipMediaController to
retrieve the media buttons.
Make .tv.PipNotification subscribe to PipMediaController to receive
callbacks about media metadata updates.

Bug: 169575409
Bug: 165795012
Test: make WindowManager-Shell; make SystemUI
Change-Id: I397f93eb4433116ba4f476bda7374b07d97e082d
2020-10-28 12:32:33 +00:00
Sergey Nikolaienkov
c18512fef5 Introduce PipMediaController.MetadataListener
Introduce MetadataListener interface to the PipMediaController (required
by .tv.PipNotification.
Remove unused field mActivityManager and unused IActivityManager
constructor parameter.

Bug: 169575409
Bug: 165795012
Test: make WindowManager-Shell; make SystemUI
Change-Id: I6988d9aa95edd6152d807300520803116f193a3b
2020-10-28 12:31:30 +00:00
TreeHugger Robot
805dcb4435 Merge "Move PipMediaController from pip/phone/ to pip/" 2020-10-28 10:44:04 +00:00
TreeHugger Robot
d03da61327 Merge "Fix tv.PipController constructor" 2020-10-28 09:11:29 +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
TreeHugger Robot
3026b03ea5 Merge "Remove TV specific methods from Pip interface" 2020-10-27 20:05:05 +00: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
Sergey Nikolaienkov
898168cb24 Fix tv.PipController constructor
Bug: 165795012
Test: make WindowManager-Shell
Change-Id: I39ab474ab003e1f2e3476495ba7459d1cf4f79c6
2020-10-27 18:43:06 +00:00
Sergey Nikolaienkov
4d90a2aeae Remove TV specific methods from Pip interface
Remove TV "legacy" methods from Pip interface:
  - addListener(...) that takes .tv.PipController.Listener objects
  - getMediaController()
  - getPlaybackState()
Leave both methods in .tv.PipController with package-private access
level.

Bug: 165795012
Bug: 169575409
Test: make WindowManager-Shell
Change-Id: I335d7d098b1a7af2c7958cd234553e7fde6557ac
2020-10-27 18:42:34 +00:00
Winson Chung
1d77565af7 Merge "2/ Add support for dragging shortcuts and tasks" 2020-10-27 16:08:04 +00:00
Winson Chung
8c1fc3ea3a 2/ Add support for dragging shortcuts and tasks
- Add mechanism for creating PendingIntents to launch apps in the same
  way as starting through LauncherApps service
- Require callers starting a task launch to either be the recents
  component or have the START_TASKS_FROM_RECENTS permission

Bug: 169894807
Test: atest LauncherAppsTest
Test: atest DragDropControllerTest
Change-Id: I2f9f622b4ef7a8aba06b0854a1549a2c07cf38e1
2020-10-26 14:33:05 -07:00
Wale Ogunwale
188d801038 Changed createRootTask task to be completely async
Currently some of the information about a task created by createRootTask
is returned with the method and the rest like leash is return in
onTaskAppear. Mixing both async and sync infromation return styles
complicates the mental model for this. So, we will have this be
completely aync for now.

Also, fixed an issue where the windowing mode for organizer created
task was not set correctly before the organizer gets the first task
appear signal.

Bug: 169266958
Test: Split-screen works!
Change-Id: Ia4180d5a42838bf566fbf75f40466dfd8237e0f1
2020-10-26 13:18:09 -07:00
Mariia Sandrikova
771dfa640b Merge "Move letterbox task positioning to LetterboxTaskListener." 2020-10-26 18:03:53 +00: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
07e95a8b35 Merge "Synchronize destination bounds after rotation in MotionHelper" 2020-10-26 15:37:01 +00:00
Winson Chung
fb314e008e Merge "1/ Add basic infra for global drag handling in the Shell" 2020-10-23 23:59:19 +00:00
Jorge Gil
1be6b7f462 Merge "Move display state into PipBoundsState" 2020-10-23 21:43:01 +00:00
Winson Chung
c932060175 1/ Add basic infra for global drag handling in the Shell
- Add private window flag INTERCEPT_GLOBAL_DRAG_AND_DROP (protected by
  MANAGE_ACTIVITY_STACKS permission) to be considered as a part of the
  normal flow for global drag and drops even if the window is not
  visible.  In addition, the window with the flag receives the clip
  data on DRAG_STARTED and the drag surface on DROP.  If the window
  consumes the drop, then it will relinquish cleanup of the drag surface
  from the system.
- Add MIMETYPE_APPLICATION_ACTIVITY for an app to report that they are
  starting a global drag of an activity. The associated data must
  include an intent with the pending intent and user to launch the
  activity for.
- Add a test drag handler on the shell end to receive the drag, setup a
  drag layout, and just launch the intent (for now).

Bug: 169894807
Test: atest DragDropControllerTest
Test: atest DragDropTest

Change-Id: I7f5cdca3cf515b693a8f1e507e90e22a670b5fa6
Merged-In: I7f5cdca3cf515b693a8f1e507e90e22a670b5fa6
Signed-off-by: Winson Chung <winsonc@google.com>
2020-10-23 20:00:19 +00:00
Issei Suzuki
1e2b859350 Merge "Replace old app transition type to new transition type (1/N)" 2020-10-23 17:19:28 +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
Hongwei Wang
8aaed30dca Merge "Enter PiP directly if the transition is handled in Launcher" 2020-10-23 16:09:31 +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
Hongwei Wang
0065703423 Enter PiP directly if the transition is handled in Launcher
Added also a AIDL method Launcher would issue when the entering pip
animation is completed on Launcher side and WM should update the task
surface when doing cleanup.

Bug: 143965596
Test: see ag/12838262
Change-Id: I5396f9637b4760df014f63b46543d4f399229bba
2020-10-22 22:36:40 -07:00
Hongwei Wang
477e968c66 Merge "Add FLAG_IMMUTABLE to PendingIntent" 2020-10-22 23:07:05 +00:00
Wale Ogunwale
f780c31a2b Merge "Revert "Have createRootTask return TaskAppearInfo"" 2020-10-22 20:30:11 +00:00
Hongwei Wang
ad92df4731 Add FLAG_IMMUTABLE to PendingIntent
Bug: 171497806
Test: manually enter PiP from YouTube
Change-Id: If2c02345f43e2d301a92ab1a94c62e04d3b2fee5
2020-10-22 13:22:54 -07: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
Chris Li
ed1460ec62 Merge "Task level letterboxing for cold start with ignore orientation request" 2020-10-22 20:08:06 +00:00
Sergey Nikolaienkov
5eec4cefd1 Merge "Fix WMShellFlickerTest on TV" 2020-10-22 18:29:30 +00:00
Wei Sheng Shih
e11ad96453 Revert "Have createRootTask return TaskAppearInfo"
Revert "ARC++ changes to mirror changes to createRootTask"

Revert submission 12855635-create-root-task

Reason for revert: b/171369770
Reverted Changes:
Iabf090caa:ARC++ changes to mirror changes to createRootTask
I5948e6234:Have createRootTask return TaskAppearInfo
Fixes: 171369770
Bug: 169266958

Change-Id: Iee1cf0b30e368987931f928de8c691640e18286a
2020-10-22 11:23:56 -07:00
Issei Suzuki
aa5118f23d Replace old app transition type to new transition type (1/N)
- Rename TransitionType to TransitionOldType, and define a new
  TransitionType.
- Calls prepareAppTransition which takes a new TransitionType when app
  transition related event happens.

The TransitionOldType and related logic will eventually removed. Until
migration finishes, we keep both.

Bug: 166736358
Test: Pass existing tests, since no new logic is enabled.

Change-Id: I984f68d5ecfae56fbfe7d91babbfddcf34378f6c
2020-10-22 19:49:12 +02:00
Jorge Gil
41ee1aa407 Merge "Move aspect ratio state into PipBoundsState" 2020-10-22 17:30:07 +00:00
Wale Ogunwale
089dda160c Merge "Made ShellTaskOrganizer thread safe" 2020-10-22 13:52:27 +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
Chris Li
53f705fbea Task level letterboxing for cold start with ignore orientation request
1. Return false for handlesOrientationChangeFromDescendant() when
ignoring orientation request, so Task will be letterboxed on cold start.
2. When Task is letterboxed, CompatDisplayInsets should use the Task
size instead.
3. ShellTaskOrganizer places FULLSCREEN Task to (0,0), which doesn't
work well with task level letterboxing.

Bug: 170725334
Bug: 155431879
Test: atest WmTests:SizeCompatTests
Test: manual: adb shell wm set-ignore-orientation-request true
Change-Id: Ifdc30fd5e52df5db11bef80d1a124e017ce146b6
2020-10-22 02:37:25 +00:00
Wale Ogunwale
c21aca86d8 Made ShellTaskOrganizer thread safe
- Post callbacks from WM Core on executor.
- Added lock to protect critical sections.

Bug: 171384876
Test: They pass!
Change-Id: Ia1808b66104c2a1e6efb9f43c31e6a3a2f67a952
2020-10-21 15:15:10 -07:00
jorgegil@google.com
0c19166c77 Synchronize destination bounds after rotation in MotionHelper
Make sure that the bounds state is updated with the final
destination bounds after a rotation *before* sending the
pip animation finished & cancelled callbacks.
This ensures that the MotionHelper bounds are synchronized
correctly at the end of the rotation to the post-rotation
bounds and not the pre-rotation bounds by
PipTouchHandler#onPinnedStackAnimationEnded.

Bug: 171352429
Test: Enter PIP, rotate, move PIP - the window doesn't jump
to the pre-rotation bounds when trying to move it.

Change-Id: I36eb192210ec58ac3448c423f43b959ce29eff1f
2020-10-21 13:18:53 -07:00
TreeHugger Robot
71fa2c0d31 Merge "Move ACTION_MENU/ACTION_CLOSE intent registraction to PipController" 2020-10-21 15:29:39 +00:00