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
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
- 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
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
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
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
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
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
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
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
Notify DisplayAreaOrganzier when the registered DisplayArea has changed.
Also added the ability to unregister a DisplayAreaOrganizer
Test: DisplayAreaOrganizerTest
Bug: 152114574
Change-Id: I9e8c537f8fe6aa7f5b007ef73535294be62dd806
Pass DisplayAreaInfo to the client to communicate information about a
specific DisplayArea.
Test: Builds
Bug: 152114574
Change-Id: Iec53ec57d1e5e892d66a1da0bd48b75f91965d20
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
- 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
- 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
Bug: 153576019
Test: Checks if Maps will move into the ActivityView when Home is pressed (in AAOS)
Change-Id: I040bf008a2f41130d6f118f359c9cefffb5acfc4
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
- 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
- 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
- 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
Similar to task organizer this allows for the organization of display
areas.
Test: they pass!
Bug: 147406652
Bug: 152113464
Bug: 152117221
Change-Id: Id0dbec20f0aedc5162f4ff7be81b2dafb0c8f3c9
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
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