Commit Graph

65 Commits

Author SHA1 Message Date
Winson Chung
5c0e676957 Merge "Remove single task display path" 2020-10-21 17:09:17 +00:00
Winson Chung
d660f73a42 Remove single task display path
Test: atest TaskStackChangedListenerTest
Test: atest RecentTasksTest
Bug: 165794879
Change-Id: I4c86e58026be7bcbbd8a2568b396a281668b9385
2020-10-21 17:08:55 +00:00
Tiger Huang
9e2c966d61 Merge "Don't dispatch legacy insets to client" 2020-10-21 15:23:27 +00:00
Tiger Huang
2bf8c796c5 Don't dispatch legacy insets to client
The server won't dispatch the legacy content insets, stable insets, and
visible insets to the client. The insets would be computed from the
insets state by the client.

This CL also fixes the insets scaling issue in compatible mode.

Bug: 149813814
Fix: 169940916
Fix: 165412978
Test: atest WindowAddRemovePerfTest InsetsAnimationControlImplTest
            ActivityRecordTests DisplayPolicyLayoutTests
            InsetsPolicyTest InsetsStateControllerTest
Change-Id: I83570973f587a6abf887752494f750b46e3e484d
2020-10-21 20:20:21 +08: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
Roman Kalukiewicz
24403f7ef2 Add @Nullable annotation to the parameter of Object.equals() methods.
Those annotations could be inferred by some tools (like Kotlin), but the
https://checkerframework.org/ doesn't check inherited annotations
complaining about all equals() invocations that get nullable argument.

The change was generated by running

find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /'

in the frameworks/base directory and by automatically adding and
formatting required imports if needed. No manual edits.

Bug: 170883422
Test: Annotation change only. Should have not impact.
Exempt-From-Owner-Approval: Mechanical change not specific to any component.
Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
2020-10-15 10:48:01 -07:00
Winson Chung
13d990e697 Merge "Return the existing tasks when registering an organizer" 2020-10-14 15:45:19 +00:00
Chris Li
d93fff6c0f Support ignoring orientation request on DisplayArea level
1. Move the mIgnoreOrientationRequest to DisplayArea so that one can set
it on DisplayContent and DisplayAreaGroup to ignore orientation request
from non-app windows.
2. Have the DisplayContent to return SCREEN_ORIENTATION_UNSPECIFIED when
it is SCREEN_ORIENTATION_UNSET so that the display respects sensor
rotation.
3. Move the logic of using last orientation back to TDA, otherwise when
TDA returns UNSET because ignore is set, DC may incorrectly uses the
last orientation.

Bug: 170725334
Bug: 155431879
Test: manual: test with setting TDA and DC to ignore
Test: atest WmTests:TaskDisplayAreaTests
Test: atest WmTests:WindowOrganizerTests
Test: atest WmTests:DisplayAreaTest
Test: atest WmTests:DisplayContentTests
Change-Id: Ie92b059c453204799a58efd39dc9b23f7d62816d
2020-10-13 22:15:09 -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
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
Chris Li
3dbefb99c4 Add option to always ignore orientation request
(2/n Orientation on DisplayAreaGroup)

When the option is set to true, the TDA will ignore all the
fixed-orientation request from apps.

This can be used on duo display device, so that the logical display will
not be rotated when launching a fixed-orientation app on one of the
display.

Bug: 155431879
Test: manual: test with dual-display-area policy
Test: atest WmTests:TaskDisplayAreaTests
Test: atest WmTests:WindowOrganizerTests
Change-Id: I3f0ea1415523926195b51fe28744974a9b64d803
2020-09-22 17:01:39 -07:00
Tiger Huang
6ef3b6e137 Remove the legacy insets mode
This CL also refines the color view logic which checks the system bar
appearance instead of system UI flags.

Bug: 149813814
Test: atest InsetsAnimationControlImplTest InsetsControllerTest
            InsetsStateTest InsetsPolicyTest InsetsStateControllerTest
Change-Id: I26d93b3508c84e436133085bd316ade54d00d76a
2020-09-18 15:13:12 +08: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
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
Bill Rassieur
02664711e9 Revert "Snap for 6792834 from edbf3411d2c91f38a1a5d93b9e5b338052..."
Revert "Snap for 6792834 from 5b681187dce32555f398c1b823b82be3a4..."

Revert "Snap for 6792834 from ff268453a3067874ebba3646e8e9fdbc04..."

Revert "Snap for 6792834 from 035f3eaa19b160a5f89cf5ba1328de6e34..."

Revert "Snap for 6792834 from 38626f86b924625d27d752950ce04045e6..."

Revert "Snap for 6792834 from a2cb05379b86f00033bd19912e1d6031f6..."

Revert "Snap for 6792834 from f1e69b45bde30a055d37260012df8e951b..."

Revert "Snap for 6792834 from 9215e252c9daaad53a18582afe5478eb6c..."

Revert "Snap for 6792834 from c9d246d88c86368fddcaa9f58d6eec740f..."

Revert "Snap for 6792834 from f0ebc39aedd8f83938f5053e87b1f42331..."

Revert "Snap for 6792834 from d6d5105b22925ff168be784af9fb044fdd..."

Revert "Snap for 6792834 from e8dc6bf8735df45be9eb7867921243d83d..."

Revert "Snap for 6792834 from de2e193ad770855a0cdc7b96d91a13929b..."

Revert "Snap for 6792834 from 5e0116a4a17307df9c303b1ea4f8857dc7..."

Revert "Snap for 6792834 from 1529174442dc31e0036c58fba7a90184ee..."

Revert "Snap for 6792834 from 14f7794f2150fc246f5c5003dc4d953019..."

Revert "Snap for 6792834 from 1a8f386df1be8e4692c00dda348f4addfb..."

Revert "Snap for 6792834 from d5d749da0ba5e53684535fae5eb76c085f..."

Revert "Snap for 6792834 from bc7dc6f5c75789d25879762854a071bd1b..."

Revert "Snap for 6792834 from d5031fd6172a4ee4a774ca7ad3df331300..."

Revert "Snap for 6792834 from bdbd076341f75ed0416f4cda0a98fc6f54..."

Revert "Snap for 6792834 from 201eaa68fcc0781df6f7713901fd5a0862..."

Revert "Snap for 6792834 from 7fcd3459496d859d2d03dcd23d9d5db563..."

Revert "Snap for 6792834 from 82eecc9b3c895d356fca70f4b8def94600..."

Revert "Snap for 6792834 from 95c6fcdbcd91cf6e409f8e50f8d33be247..."

Revert "Snap for 6792834 from 4b73f247850059a4312525662991d73359..."

Revert submission 12462888-release-request-aa3875fd-ef4c-4f66-9a1c-b0b05058d091-for-git_main-busytown-release-6792834

Reason for revert: Bad snap due to branch misconfig.

Reverted Changes:
I950c3960b:Snap for 6792834 from de2e193ad770855a0cdc7b96d91a...
Ie6452b91a:Snap for 6792834 from c9d246d88c86368fddcaa9f58d6e...
I6b98cb766:Snap for 6792834 from 7fcd3459496d859d2d03dcd23d9d...
Ie5e19aaef:Snap for 6792834 from edbf3411d2c91f38a1a5d93b9e5b...
I35385da96:Snap for 6792834 from 4b73f247850059a4312525662991...
I1a59949e5:Snap for 6792834 from d5031fd6172a4ee4a774ca7ad3df...
I2c40ffbc2:Snap for 6792834 from f0ebc39aedd8f83938f5053e87b1...
I24c147f50:Snap for 6792834 from ff268453a3067874ebba3646e8e9...
Iabb2fe4c1:Snap for 6792834 from 5e0116a4a17307df9c303b1ea4f8...
I92bfbb5d5:Snap for 6792834 from 0ad493cce4f8f187dc37671b45d5...
I2e92b2d5d:Snap for 6792834 from f1e69b45bde30a055d37260012df...
I0fdb356fa:Snap for 6792834 from a2cb05379b86f00033bd19912e1d...
I9b19f9bdc:Snap for 6792834 from 95c6fcdbcd91cf6e409f8e50f8d3...
Ie88e387a6:Snap for 6792834 from 9215e252c9daaad53a18582afe54...
Idc1ae35dd:Snap for 6792834 from 201eaa68fcc0781df6f7713901fd...
Ib16deadd9:Snap for 6792834 from 1a8f386df1be8e4692c00dda348f...
I744f889d3:Snap for 6792834 from d5d749da0ba5e53684535fae5eb7...
Ib6e060e44:Snap for 6792834 from bdbd076341f75ed0416f4cda0a98...
Iab587ff78:Snap for 6792834 from e8dc6bf8735df45be9eb78679212...
Ia1f4ef82f:Snap for 6792834 from 14f7794f2150fc246f5c5003dc4d...
Ief930c2b5:Snap for 6792834 from 5b681187dce32555f398c1b823b8...
Ia71445b6a:Snap for 6792834 from 38626f86b924625d27d752950ce0...
Ia95c82cfc:Snap for 6792834 from 1529174442dc31e0036c58fba7a9...
If1e1b5e35:Snap for 6792834 from bc7dc6f5c75789d25879762854a0...
I98959e228:Snap for 6792834 from 1e7f83c953b7571dceabd5d7f6a2...
I321c4cb8b:Snap for 6792834 from d6d5105b22925ff168be784af9fb...
I3ed2d46ee:Snap for 6792834 from 035f3eaa19b160a5f89cf5ba1328...
Id4a7f102c:Snap for 6792834 from 82eecc9b3c895d356fca70f4b8de...

Change-Id: I4b944b89f3c581fbd67f5952d9ec413d02756abc
2020-08-27 02:20:22 +00:00
Winson Chung
4421f2888d Add mechanism to register single task organizer
- Create a single task organizer in SysUI which registers as an organizer
  for multiple windowing modes internally in TaskOrgController.

Bug: 161980327
Test: atest WindowOrganizerTests
Test: atest SplitScreenTests
Test: atest PinnedStackTests
Test: atest ShellTaskOrganizerTests
Change-Id: Ic9dfbd6bcd75d9317e5a3aeb695afdff7e869d35
2020-08-18 23:36:59 -07:00
Andrii Kulian
6e61790d80 Require permission to create trusted displays
Bug: 162627132
Test: atest VirtualDisplayTest#testTrustedVirtualDisplay
Test: atest
frameworks/base/packages/SystemUI/tests/src/com/android/systemui/bubbles
Test: atest DisplayTest
Test: atest VirtualDisplayTest#testTrustedVirtualDisplay
Test: atest VirtualDisplayTest#testUntrustedSysDecorVirtualDisplay

Change-Id: Id06b2013ef5fdeadf321f14f8b611c733031d54d
2020-08-12 01:12:54 +00:00
Chris Li
e619eef586 Add Feature FULLSCREEN_MAGNIFICATION for DisplayArea
The Feature excludes window types in WindowState#shouldMagnify(). DAs of
this Feature will be used by the AccessibilityController.

Bug: 154719717
Test: atest WmTests:DisplayAreaPolicyBuilderTest
Change-Id: Iae0fbf03ad35c06338855cf3f1db02d246d03085
2020-07-17 16:16:02 -07:00
Jorim Jaggi
543db32125 Pass in callsite of SurfaceControl constructor explicitly (1/3)
Creating a new Throwable (and filling in the stack trace) can take
up to 150us. Since we do this on the critical path when sending
over SurfaceControl via binder multiple times, this is too much.
Instead, add an option to pass in callsite manually.

Bug: 159056748
Change-Id: I46c339c15a07192d61c4c546e46f260684a47120
Exempt-From-Owner-Approval: Large scale refactor
2020-06-26 13:40:07 +00:00
TreeHugger Robot
f2f21c64ed Merge "VirtualDisplayTaskEmbedder: Post background color change callback" into rvc-dev am: 5c53f0af8b am: 0cba355c41 am: 3ed61b4280 am: 0273dad7a3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11726785

Change-Id: I247bc1c7f60db39da37a99db166f4f4993e492ce
2020-06-04 16:18:40 +00:00
TreeHugger Robot
5c53f0af8b Merge "VirtualDisplayTaskEmbedder: Post background color change callback" into rvc-dev 2020-06-04 15:28:56 +00:00
Robert Carr
e52f809126 VirtualDisplayTaskEmbedder: Post background color change callback
Otherwise we will end up calling SurfaceView#setResizeBackgroundColor
from a Binder thread and potentially cause a crash. This mirrors the
behavior of TaskOrganizerTaskEmbedder.

Bug: 157605189
Test: Existing tests pass
Change-Id: Iafe9e4c3eb4d32a52a6a1479aa9a2b295cd4ad6f
2020-06-03 15:41:34 -07:00
Evan Rosky
629f35b32d Merge "Use boundsChangeTransaction to improve split-screen enter/exit" into rvc-dev am: 82352f9db8 am: eabcec5bf2 am: 1c32099b52 am: af08a6eefd
Original change: undetermined

Change-Id: I173df952538a9ee3d998e3ee57e54d63c616119f
2020-06-02 00:03:51 +00:00
Evan Rosky
82352f9db8 Merge "Use boundsChangeTransaction to improve split-screen enter/exit" into rvc-dev 2020-06-01 22:55:20 +00:00
Evan Rosky
3613854d1b Use boundsChangeTransaction to improve split-screen enter/exit
Uses applySyncTransaction to synchronize all the surface
updates during split-screen enter/exit.

In Divider, all syncTransactions are serialized and runnables
can be posted to operate on the returned transactions so
they happen all at once.

This also required adding a "merge" functionality on
WindowContainerTransactions to handle racing between rotation
and other in-flight sync transactions (because they are
serialized, sometimes they got delayed).

Bug: 153579514
Test: Enter/exit split-screen and observe no flickers
Change-Id: I57df13489247f3c4fb3ca59efa26867a872e447f
2020-06-01 11:33:27 -07:00
Winson Chung
beeed408b4 Merge "Mirror task visibility on task org leash" into rvc-dev am: 1298d2b760 am: 376ac8a830 am: bf3f0c2de8 am: a35b850544
Change-Id: I5d7a9bf0c588bb0ec71d6af72091cbcd98b25314
2020-05-29 21:52:18 +00:00
Winson Chung
1298d2b760 Merge "Mirror task visibility on task org leash" into rvc-dev 2020-05-29 21:06:03 +00:00
Winson Chung
14a657c944 Mirror task visibility on task org leash
- Depending on the navigation mode, the task is either visible or not
  when entering PIP, and if it is not visible, initially hide the leash
  so that SysUI can control it's visibilty to prevent a flash

Bug: 156941210
Test: Introduce artificial delay on sysui taskAppeared() and verify that
      we don't see the task when entering pip in gesture nav (and that
      it still works in 3 button)

Change-Id: I291afd209af118ac178f8a6421d7df25974315f0
2020-05-29 21:05:37 +00:00
Evan Rosky
a7d57de7cc Merge "Add boundsChangeTransaction for Task pending mode change" into rvc-dev am: 4911db037b am: 20d5f2b19a am: 5db3220bb8 am: 5f726d5349
Change-Id: I3a5e50fffa992c1c0e46b8a309c19cd8b5cc9dbd
2020-05-28 23:57:11 +00:00
Evan Rosky
0c86ced0aa Add boundsChangeTransaction for Task pending mode change
This associates a surfaceflinger bounds change with a task's
surface provided that task will become organized by the end
of a WindowContainer transaction. Without this, there's no
way to synchronize a new frame due to bounds-change with
said bounds-change if the bounds-change is a result of
changing windowing-modes (and thus becoming organized).

This also records the original Task that a bounds-change
transaction was associated with along with the transaction.
This is needed anytime tasks are nested (eg. with home
task or with split-screen tasks).

Bug: 153579514
Test: See test entry for end of commit chain
Change-Id: If14ea07eca17ef9146537d5aae7122dd7c2dc045
2020-05-28 12:58:35 -07:00
Chris Li
27284de40a Migrate DisplayContent.mOverlayContainers to DisplayArea
(1/n DisplayArea Sibling Roots)

Instead of adding magnification window to the overlay containers in
DisplayContent, move it to be part of the policy created display
hierarchy.

DA.Root
   - DA for FEATURE_WINDOWED_MAGNIFICATION
      - BELOW_TASKS
      - TDA
      - ABOVE_TASKS (below TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY)
   - DA.Tokens for TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY
      - Magnification overlay windows
   - ABOVE_TASKS (DA.Tokens's for layers above
     TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY)

Fix: 156424590
Test: manual: magnification and screen rotation
Test: go/wm-smoke (manual)
Change-Id: I959c0a882b0a0e9a9dbb44ad62a3c65c1dfe3c06
2020-05-20 13:44:33 -07:00
Charles Chen
d4b479ad3d Merge "Add WindowMetricsHelper" into rvc-dev am: 5681f3e796 am: 8a1786f075 am: a02900fbf1 am: 242f71725b
Change-Id: I9558dc4196f1ffb9481b5c0330a401afdfc9acd6
2020-05-11 10:57:46 +00:00
Charles Chen
5681f3e796 Merge "Add WindowMetricsHelper" into rvc-dev 2020-05-11 10:17:37 +00:00
Yuncheol Heo
652e004d52 Merge "Migrate Tap exclusion logic to TaskEmbedder." into rvc-dev am: 73cc6b8f47 am: 9eeb721848 am: edb5fb4b6d am: aee0fb8ecd
Change-Id: Ib5f923d2198d7a4f6d8ecafcc713d48688a3ec30
2020-05-06 01:15:06 +00:00
Yuncheol Heo
8f5f53ca0f Migrate Tap exclusion logic to TaskEmbedder.
We want to pass the touches on ActivityView to the Activity inside ActivityView, not to be consumed by Activity hosting ActivityView.
To do that, we need to set a tap exclude region, so touches can go through.

Bug: 155424730
Test: Make sure the Activity inside ActivityView gets touch.
Change-Id: Ia9b2c7eba0c48512a633c798b1012e5fbec8422f
2020-05-05 14:41:43 -07:00
Charles Chen
49f329ca66 Add WindowMetricsHelper
This metrics now is used for calculating the value reported by
Display#getSize. It could be extended to have more function later.

Also replace getCurrentMetrics usages to make them report
Display#getSize value.

Bug: 148904274
Test: atest WindowMetricsHelperTest

Change-Id: I182b6e63f7c28752eee22839cb9e69f073046c3f
2020-05-04 11:41:13 +08:00
TreeHugger Robot
c8ce55ce24 Merge changes from topic "displayAreaOrganizer_migration"
* changes:
  The one handed UX of auto-stop one handed by conditions (10/N)
  TouchHandler to handle touch events inside & outside displayArea (9/N)
  Implement Timer for one handed to handle auto-exit (8/N)
  Implement DisplayArea Animation/Transition for one handed (7/N)
  Register DisplayAreaOrganizer for one handed (6/N)
  Create OneHandedSettingsUtil handle settings configs (5/N)
  Sysui-infra for one handed mode (1/N)
2020-05-01 06:34:30 +00:00
TreeHugger Robot
75c82108f6 Merge "Add the IME insets to virtual display for bubble" into rvc-dev 2020-05-01 03:58:14 +00:00
Bill Lin
f872831565 Register DisplayAreaOrganizer for one handed (6/N)
Introduce OneHandeDisplayAreaOrganizer and AnimationController

Test: atest OneHandedDisplayAreaOrganizerTest
Test: atest OneHandedManagerImplTest
Test: atest OneHandedUITest
Test: atest OneHandedSettingsUtilTest
Test: atest SystemUITests
Test: atest DisplayAreaPolicyBuilderTest
Bug: 150747909
Change-Id: I654090adf404214056ef37d83bacd3f65fffc1ff
2020-04-30 15:58:50 +08:00
Yunfan Chen
b83940c9e7 Add the IME insets to virtual display for bubble
This patch will add a fake IME window to virtual display when IME is
showing and covering a bubble window. Without the fake window, the
bubble will not receive the correct IME insets.

To do that, this patch:
1. Added an interface in ActivityView to get VirtualDisplay when needed,
   in order to create the display context.
2. Modify the visibility update. When the target is not a client
   controlled target, we ignore the client visibility. We also call
   visibility update when the control target updated.
3. With the modified infra, add the window with correct param and
   context.

Bug: 150780413
Test: atest WmTests:DisplayPolicyLayoutTests
Test: atest InsetsStateTest
Test: atest InsetsPolicyTest
Test: go/wm-smoke
Test: See reproduce steps in the bug

Change-Id: I52691b5c7f81261de580bb4fc762e88486e78141
2020-04-30 16:21:11 +09:00
Chavi Weingarten
5a4a5682a2 Merge "Remove getLeash from WindowContainerToken" into rvc-dev 2020-04-30 00:16:21 +00:00
chaviw
8d8b31b833 Added featureId to DisplayAreaInfo
This is something clients will need if they register to listen to
DisplayAreas for several features. This will help distinguish the
DisplayAreaInfos.

Test: Builds
Bug: 152114574
Change-Id: If1d14aee070388274afb6a43bc1c631d79fb4b38
2020-04-29 13:47:26 -07:00
chaviw
7de50009a3 Remove getLeash from WindowContainerToken
If the WindowContainer was revoked from a registered organizer, the
client could still call getLeash to system server and control the leash
for the WindowContainer. Instead, pass the leash back to the client in
onTaskAppeared and onDisplayAreaAppeared. Once the WindowContainer is
revoked from the client, the leash will reference the old
WindowContainer SurfaceControl and will not be able to control the
WindowContainer anymore.

Test: Split screen
Test: DisplayAreaOrganizerTest
Test: WindowOrganizerTest
Bug: 154558563
Change-Id: I1f6eb987a2a3fecfef912a3009ee52989c85ff4b
2020-04-29 09:36:35 -07:00
chaviw
5ef1e93671 Added takeScreenshot API to WindowOrganizer
Added requests to take screenshot of a Window that's organized
by the client. The resulting screenshot will be attached to a
SurfaceControl and reparented to the requested window's parent. The
client will be responsible for showing, setting z order, etc. They can
also re-parent to another place in the hierarchy. The default is to
parent to the window's parent since that's usually where a screenshot is
placed.

Test: Builds
Bug: 152114574
Change-Id: I5c829e029f3528fdb382842e9f0474097e01cb2e
Merged-In: I5c829e029f3528fdb382842e9f0474097e01cb2e
2020-04-27 16:45:27 +00:00
chaviw
9d07e62689 Added onDisplayAreaChanged and unregister for DisplayAreaOrganizer
Notify DisplayAreaOrganzier when the registered DisplayArea has changed.

Also added the ability to unregister a DisplayAreaOrganizer

Test: DisplayAreaOrganizerTest
Bug: 152114574
Change-Id: I9e8c537f8fe6aa7f5b007ef73535294be62dd806
2020-04-22 15:43:56 -07:00
chaviw
d1a2393f6c Add DisplayAreaInfo
Pass DisplayAreaInfo to the client to communicate information about a
specific DisplayArea.

Test: Builds
Bug: 152114574
Change-Id: Iec53ec57d1e5e892d66a1da0bd48b75f91965d20
2020-04-22 14:29:18 -07:00