Commit Graph

33 Commits

Author SHA1 Message Date
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
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
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
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
Charles Chen
5681f3e796 Merge "Add WindowMetricsHelper" into rvc-dev 2020-05-11 10:17:37 +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
75c82108f6 Merge "Add the IME insets to virtual display for bubble" into rvc-dev 2020-05-01 03:58:14 +00: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
Linus Tufvesson
db1f2ec052 Make ActivityViews backing virtual display private
Bug: 150310377
Test: atest CtsWindowManagerDeviceTestCases:ActivityViewTest
Test: Used bubbles test app to verify that it's still happy when using
private VDs

Change-Id: I02c6840b1f908a5177c217494de0110f5ce78f7e
2020-04-16 15:50:48 +01:00
Winson Chung
1df39e2cf6 Send task description changed though task org taskInfoChanged
- This removes the need for a separate task stack listener and aligns
  with other task info change properties
- Also implement equals/hashCode for the token so we can use it in
  containers

Bug: 148977538
Test: atest TaskOrganizerTests

Signed-off-by: Winson Chung <winsonc@google.com>
Change-Id: Ie035e6389fdbdc374c1a4b4a684758efa0cb7a9e
2020-04-11 00:01:05 -07:00
Winson Chung
cb437ade00 Merge changes I7d2ca2a2,I9f1fc593 into rvc-dev
* changes:
  Fix a couple issues with previous CL (keeping tasks hidden)
  Keep task hidden until task appeared
2020-04-10 03:03:21 +00:00
Winson Chung
1b5d055f2e Keep task hidden until task appeared
- If the task is previously not visible or has no visible children at
  the point when we start controlling it in the task org, hide the task
  until we send taskAppeared to ensure that the task org can reparent
  and show it otherwise we could see a flash of the task.

  This happens mainly from two cases:
  - when starting a new task with a given win mode, we show it and wait
    for first draw before notifying the task org
  - when transitioning into pip from swipe up, the activity is hidden
    and when it requests to enter pip is made visible again

  Since we are hiding the task w/ the pending transaction, we also need
  to defer all task org callbacks until that's applied to ensure proper
  lifecycle of the calls.
- Also skip app transitions for task org tasks for now

This reverts commit d2fb07e4f6.

Bug: 152809695
Bug: 152134460
Test: Open a bubble, ensure that we don't see the task in fullscreen
      first.  Enter pip, ensure that we don't see flash of the task
      before SysUI can fade it in.
Test: atest PipAnimationControllerTest
Test: atest TaskOrganizerTests
Test: atest SplitScreenTests
Change-Id: I9f1fc5931df1d69a7086c02b633347162cda94bf
2020-04-09 15:55:03 -07:00
Yuncheol Heo
8ecd6a377b Merge "Move multi window mode to the caller." into rvc-dev 2020-04-09 16:06:01 +00:00
Yuncheol Heo
5d62e75560 Move multi window mode to the caller.
Bug: 153576019
Test: Checks if Maps will move into the ActivityView when Home is pressed (in AAOS)
Change-Id: I040bf008a2f41130d6f118f359c9cefffb5acfc4
2020-04-08 16:43:52 -07:00
Andrii Kulian
44b3c569f4 6/n Manage multiple task display area in the policy
Delegate task display area creation and container management to the
display area policy implementation. This should allow creating and
handling device-specific task display area arrangements.

Bug: 152116619
Test: WM CTS and unit tests
Change-Id: Ic1182d064e7d8387f701f04fb267e2bb6d4da0c5
2020-04-07 21:30:26 -07:00
Winson Chung
d2fb07e4f6 Revert "Keep task hidden until task appeared"
This reverts commit cbd8793a44.

Reason for revert: b/153273664
Bug: 153273664

Change-Id: Ic3a0778e896afd5e3fdbc234a5b3521257222dcd
2020-04-06 18:17:21 +00:00
Winson Chung
cbd8793a44 Keep task hidden until task appeared
- If the task is previously not visible or has no visible children at
  the point when we start controlling it in the task org, hide the task
  until we send taskAppeared to ensure that the task org can reparent
  and show it otherwise we could see a flash of the task.

  This happens mainly from two cases:
  - when starting a new task with a given win mode, we show it and wait
    for first draw before notifying the task org
  - when transitioning into pip from swipe up, the activity is hidden
    and when it requests to enter pip is made visible again

  Since we are hiding the task w/ the pending transaction, we also need
  to defer all task org callbacks until that's applied to ensure proper
  lifecycle of the calls.
- Also skip app transitions for task org tasks for now

Bug: 152809695
Bug: 152134460
Test: Open a bubble, ensure that we don't see the task in fullscreen
      first.  Enter pip, ensure that we don't see flash of the task
      before SysUI can fade it in.
Test: atest PipAnimationControllerTest
Test: atest TaskOrganizerTests
Test: atest SplitScreenTests

Change-Id: If51e98cd007faef35e99acd31b27b20eebbea010
2020-04-03 19:59:05 -07:00
Winson Chung
06200523a1 Move always-on-top to the callers
- This was accidentally included in ag/10788780, where only the bubbles
  AV should be using an always-on-top MW task

Bug: 152808872
Test: Start auto in emulator and ensure the task is not always on top

Change-Id: If0de9d5856b15dbca7661bf97a88b10fd63ec9db
2020-04-01 09:55:39 -07:00
Wale Ogunwale
adf116ec95 Add TestApi interfaces for window organizers
Enables testing the API surfaces from CTS.

Bug: 149338177
Test: they pass!
Change-Id: I7e1f2852585a10c20d299bd87e9a87f828d06d6a
2020-04-01 13:25:23 +00:00
Winson Chung
a1f869d10e Add task organizer based task embedder
- Split TaskEmbedder into its current VirtualDisplay implementation
  and an implementation that uses task org to create and manage
  the task
- Use the task org embedder implementation in separate bubble task view
- Skip task org tasks from triggering task resizing
- Add task org callback for back press on task root if requested

Bug: 148977538
Test: atest CtsWindowManagerDeviceTestCases:ActivityViewTest
Test: atest WmTests:TaskOrganizerTests
Change-Id: Id422bb2547197c617f914ed7cf5085e02a1c3fb5
2020-03-30 23:29:08 +00:00
Wale Ogunwale
dec3408b50 Introduce DisplayArea organizer
Similar to task organizer this allows for the organization of display
areas.

Test: they pass!
Bug: 147406652
Bug: 152113464
Bug: 152117221
Change-Id: Id0dbec20f0aedc5162f4ff7be81b2dafb0c8f3c9
2020-03-24 06:30:13 -07:00
Wale Ogunwale
568f9f41c6 Introduce WindowOrganizer
WM currently only allows the organization of tasks, however we will soon
be allowing the organization of DisplayAreas. To help with the code
structure, we are introducing WindowOrganizer interface which will
contain common APIs for all types of windows organizers (e.g.
applyTransaction) and also be the interfaece for getting the controller
for other organizers.

Test: they pass!
Bug: 147406652
Bug: 152113464
Bug: 152117221

Change-Id: Id2797b288ce92430206c25345d60e7b0e3be98c8
2020-03-23 08:59:18 -07:00
Wale Ogunwale
5794658be0 Move some window related files to android.window package
Window management files on the client side have normally been dumped in
either android.view or android.app package. This CL starts to
centralized them in android.window package so there is better
separation.

Test: they pass
Bug: 147406652
Bug: 152113464
Bug: 152117221
Change-Id: I4d64bd256e9b3581af0ccf9396f7dd2454132719
2020-03-22 09:47:43 -07:00