Commit Graph

62 Commits

Author SHA1 Message Date
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
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
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
b91eb3cdbd Merge "Import translations. DO NOT MERGE ANYWHERE" 2020-11-21 02:26:15 +00:00
Bill Yi
c19062102a Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Ibda03e416260efefa40a2d662b45fa03aee35486
2020-11-20 07:52:33 -08:00
Bill Yi
3d6151257d Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I61ae0a3a1d32304c3ba001315f59af611638514e
2020-11-20 07:24:09 -08:00
TreeHugger Robot
a0522a60fd Merge "Revert "Import translations. DO NOT MERGE ANYWHERE"" 2020-11-20 05:08:56 +00:00
TreeHugger Robot
b38a884912 Merge "Revert "Import translations. DO NOT MERGE ANYWHERE"" 2020-11-20 04:55:15 +00:00
Jason Chang
9fa8702d0c Merge "Fix change One-handed mode screen size from 50% to 40% but also keep adb command mechanism for UX tuning" 2020-11-20 03:51:53 +00:00
Bill Yi
98537ca3aa Revert "Import translations. DO NOT MERGE ANYWHERE"
This reverts commit 6652772648.

Reason for revert: Incorrect import

Change-Id: I7202b60632640d44202c5246c6408a6f54892e68
2020-11-20 03:16:26 +00:00
Bill Yi
5e4e11b20c Revert "Import translations. DO NOT MERGE ANYWHERE"
This reverts commit 6ced8e47a4.

Reason for revert: Incorrect import

Change-Id: Ie5f63ad2562f38cebd36dae986c530d07de088ca
2020-11-20 03:01:27 +00:00
TreeHugger Robot
0718e79de0 Merge "Import translations. DO NOT MERGE ANYWHERE" 2020-11-19 18:16:38 +00:00
Bill Yi
6ced8e47a4 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I23c6083fd728447f86a1b272ae53c4c57be47bd4
2020-11-19 04:00:09 +00:00
Bill Yi
6652772648 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I5ac32a47f2a98d5430814f615555fe2d6aaf58e9
2020-11-19 03:59:40 +00:00
TreeHugger Robot
5bc9594c6b Merge "Add divider view support for app-pairs" 2020-11-18 12:12:18 +00:00
Jason Chang
fc4f7c948d Fix change One-handed mode screen size from 50% to 40% but also keep
adb command mechanism for UX tuning

Provide both config.xml and adb command mechanism.

Bug: 169724216

Test:
adb shell setprop persist.debug.one_handed_offset_percentage 60
adb shell pidof com.android.systemui |xargs -i adb shell kill -9 {}
or adb reboot

adb shell setprop
persist.debug.one_handed_translate_animation_duration 150
adb shell pidof com.android.systemui |xargs -i adb shell kill -9 {}
or adb reboot

Test: manual
Test: atest WMShellUnitTests
Change-Id: I9502cbe8e496f484fdeb8041b5618c47aba0f1d1
2020-11-18 17:43:41 +08:00
Mariia Sandrikova
2b54b5d709 Merge "Make positioning in letterbox mode configurable." 2020-11-17 22:45:44 +00:00
Mariia Sandrikova
49fc5569f0 Make positioning in letterbox mode configurable.
Changes:
- Allow to specify in config_letterboxPortraitGravity and config_letterboxLandscapeGravity desired alignment for letterboxed apps.
- Add ADB commands to allow overriding these config values for testing
- Move positioning logic for letterbox mode from WM Core to WM Shell.

Test: atest LetterboxTaskListenerTest LetterboxConfigControllerTest
Test: go/wm-smoke
Test: manual with adb shell dumpsys activity service SystemUIService WMShell (get)set-letterbox-portrait-gravity / (get)set-letterbox-landscape-gravity
Fix: 170216257, 170215849
Change-Id: I8e6392faab05bec1bf61b9691f3bd9b8b09b9621
2020-11-17 20:15:31 +00:00
TreeHugger Robot
4583161d0a Merge "Import translations. DO NOT MERGE ANYWHERE" 2020-11-17 19:43:31 +00:00
Xin Li
75b98e92aa Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I3970b3166afdfafe655d85d6b0e960c3e58cb5cd
2020-11-17 17:45:36 +00:00
Xin Li
b7618f25f4 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I60840416d367892f951ba919e5976b251a333445
2020-11-17 17:44:59 +00:00
Jerry Chang
0545edfa3d Add divider view support for app-pairs
Add divider bar for app-pairs. AppPairLayout and divide policy records
and handles the layout in pair.

Bug: 172704238
Bug: 172704672
Test: manul check the behavior of the splits and divider bar.
Test: AppPairTests, AppPairsPoolTests, AppPairsControllerTests

Change-Id: I688c7001d056fe8dd9a192885e1f9fd5f004dc11
2020-11-17 11:22:19 +08:00
TreeHugger Robot
324710c1ba Merge "Import translations. DO NOT MERGE ANYWHERE" 2020-11-16 17:22:35 +00:00
Bill Yi
0df907672a Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Ibe7ac1aa6c164371992dd2c162d4243ae31ad1b1
2020-11-16 11:17:54 +00:00
Bill Yi
003e100558 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I0ee0fe11d014ea62f3a8d41af393b2ae3a9b93fc
2020-11-16 10:51:59 +00:00
Wale Ogunwale
40901fa082 Merge "App-pairs baseline commit" 2020-11-13 14:35:57 +00:00
Bill Yi
6433688129 Merge "Import translations. DO NOT MERGE ANYWHERE" 2020-11-13 14:19:46 +00:00
Wale Ogunwale
fe8c73b18d App-pairs baseline commit
- AppPairs: Main interface used to pair and unpair tasks.
- AppPairsController: Main controller for app-pairs and implements
AppPairs interface.
- AppPair: Manages a singal instance of an app-pair consisting of a
root task and 2 other tasks that are paired together.
- AppPairPool: Helper object pool for AppPair class so we don't have to
wait for a root task creation from system_server when we need an
app-pair.
- adb shell commands for pairing and unpairing tasks

Test: adb shell commands for pair/unpair
      adb shell dumpsys activity service SystemUIService WMShell \
        pair taskId1 taskId2
      adb shell dumpsys activity service SystemUIService WMShell \
        unpair taskId
Test: AppPairTests, AppPairsPoolTests, AppPairControllerTests
Bug: 172704672
Change-Id: Ie0a70c1aa764ad83b763931501234c1960251ca4
2020-11-13 21:33:38 +08:00
Bill Yi
900019eed9 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Idec787e63b7c639d0926b08ecd6638acfc200e00
2020-11-12 16:06:32 -08:00
Bill Yi
9a0801dfa4 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I76acee8bb5fad886f9b181f81c86467ddca25423
2020-11-12 15:38:07 -08:00
Mady Mellor
ed1098532d Merge changes I36b9cedc,I79948a4b
* changes:
  Allow Bubble overflow to be opened without other active bubbles
  Flexible bubble sizing & fixed position
2020-11-12 00:26:43 +00:00
Mady Mellor
97fcd7a082 Flexible bubble sizing & fixed position
This will enable some stuff for taskbar & hopefully make customizations by
ARC++ easier??

- BubblePositioner now tracks the size of the bubble & bitmap within it.
  Have to use a multiplier to derive the size of a couple of things now
  (e.g. bitmap size)
- BubblePositioner now tracks the position of the bubble stack & allows
  a way to override / set a fixed position. If something is in fixed
  location, it is not draggable (however when expanded you can still
  drag individual bubbles to dismiss)
- BubblePositioner tracks some taskbar related info
- Rather than checking for "isLandscape" we want "showBubblesVertically"
  (e.g. device might not be landscape but should be vertical if taskbar)
- Fixes an animation issue where bubbles super-overshoot the y position
  when expanding vertically.

Bug: 167413172
Test: a lot of manual testing
Test: atest WMShellTest SystemUITests
Change-Id: I79948a4bd6b58fb3aa2f52e2553f3dfc31630cf1
2020-11-11 12:57:29 -08:00
Sergey Nikolaienkov
50118593eb Add TvPipMenuTests
Bug: 171520419
Test: atest WMShellFlickerTests:TvPipMenuTests
Change-Id: If74cb25f6c1c46704f35d2c8073c0fdb50c8d7eb
2020-11-06 10:56:31 +00:00
Tony Huang
ae7e2fb0bb Merge "Migrate Bubbles to wm-shell (5/n)" 2020-11-04 07:31:30 +00:00
Winson Chung
f97bf81d1e Merge changes I581de3ff,I7d777c59
* changes:
  5/ Validate and resolve shortcut & task activity infos
  4/ Add basic drag and drop policy & handler for the shell
2020-11-04 05:57:22 +00:00
Tony Huang
eb01a25c87 Migrate Bubbles to wm-shell (5/n)
Move bubbles package and related resources to shell package,
also copied some used codes and resources.

Bug: 161980186
Test: atest SystemUITests
Test: atest WMShellUnitTests
Change-Id: Ia108bd4149b3c3bf86631ba1a7a6bce0e76af78f
2020-11-04 11:01:56 +08:00
Winson Chung
93fd63d021 4/ Add basic drag and drop policy & handler for the shell
- Add basic policy for handling drags over home/fullscreen tasks
  /split tasks. For now, default to only allowing split to non-docked
  root task
- Refactor drag layout to have same lifecycle as the window instead of
  being per-drag session
- Resolve activity info for tasks as well as activity drag items
  (shortcuts to be resolved in a follow up CL)
- Fix crash due to sending drag events to all displays

Bug: 169894807
Test: atest DragAndDropPolicyTest

Change-Id: I7d777c59296e9ca9e1d169c8a021f9263af94d65
2020-11-02 14:53:56 -08:00
Ben Lin
beefdec180 Set PiP stashing to a set 32dp away from the edge of the screen.
Bug: 165793553
Test: Stash PIP
Change-Id: Ib6e0058a9e0c6b60605c6143e9407ce809abebf3
2020-10-30 18:19:17 -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
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
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
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
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
Wale Ogunwale
093aba3d8a Have createRootTask return TaskAppearInfo
We return TaskAppearInfo on TaskOrganizer#createRootTask so it doesn't
have to wait for taskAppeared signal to take action.

Also, added createRootTask(..., listener) method to ShellTaskOrganizer
so that a specific listener can be associated with a root task we are
creating.

Bug: 169266958
Test: split-screen works.
Change-Id: I5948e623481deadb0aa5fc99b9941914f44a68e2
2020-10-20 12:36:03 -07:00
Wale Ogunwale
0e6581c1e6 Support task listener by task id.
Allows for managing specific task regardless of windowing mode.
Converted TaskView which to use the new API.

Bug: 170153209
Test: All tests pass and bubbles works!
Change-Id: Ic5281bc9dd9124841834c88f2b85545107567417
2020-10-19 19:21:45 -07: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
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
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