If a view is detached before being removed (which seems common with some
recycler list views) then no content capture view removed event is sent
(notifyAppearedOrDisappearedForContentCaptureIfNeeded does nothing
if mAttachInfo is null).
Fix: 200166989
Test: Manual verification using AiAi logging
Change-Id: Ic04af005bb4ad425ba8398439f1f47bb6bcb334c
The opaque flag is necessary for the compositor to blend the layers
correctly and prevent translucent pixels from showing the layer
underneath during animations.
Test: manually punch holes in apps and verify opaque apps don't show the layer underneath
Test: automated tests to follow
Bug: 198924563
Change-Id: I1116c51b2efd4e9c0fe2acbca080291f3950245c
Because the background attribute used to have a different use some apps still set it and it means we could run transitions with unexpected background colors
Test: Existing
Fixes: 200763116
Merged-In: Id42f52760cb9a681c6c33f3c261d7db5e2f71af3
Change-Id: Id42f52760cb9a681c6c33f3c261d7db5e2f71af3
Because the background attribute used to have a different use some apps still set it and it means we could run transitions with unexpected background colors
Test: Existing
Bug: 200763116
Change-Id: Id42f52760cb9a681c6c33f3c261d7db5e2f71af3
We need to make sure the served view is up-to-date, otherwise we might
erroneously reject or allow a request to show the IME via WindowInsetsController.
Fixes: 190217891
Bug: 200051968
Test: atest WindowInsetsControllerTests#\
testShowIme_immediatelyAfterDetachAndReattach
Merged-In: Ib41412d5d5636bdc236aa94c4ee4702686b6d10f
Change-Id: Ib41412d5d5636bdc236aa94c4ee4702686b6d10f
(cherry picked from commit e6b4e24b30)
Query the surface flinger property
ro.surface_flinger.primary_display_orientation to determine the
primary display's install orientation. If the window is on the
primary display, then update the transform hint passed on to the
client.
Bug: 196167822
Test: check initial buffer transforms on displays with a different
install orientation
Change-Id: Idf010cd6be73172ba708820f87046c3ba3cf8001
Update to feel less flickery with the new task transition animation
We want to try and have the navbar transition right when the animation is in between the two tasks
Bug: 200674544
Test: Existing tests
Change-Id: If99965c4b4776c902a3c6b32a3fcdb0b65811407
The transform hint can be used by a buffer producer to pre-rotate
the rendering such that the final transformation in the system
composer is identity. This can be very useful when used in
conjunction with the h/w composer HAL in situations where it cannot
handle rotations or handle them with an additional power cost.
Bug: 196167822
Test: atest AttachedSurfaceControlTest
Change-Id: Idb7fcf58ecbcc22cd43c226ee4faad958c265e72
There is case when a TaskFragment is resizing while one of its children
is open/close. In such case, both the TaskFragment and its child will be
included in the transition, but we don't want to animate both of them.
Use the new flag to determine if the child need to be animated.
Bug: 196173550
Test: test with demo app
Change-Id: Ib5ad32501e046e5b612f6d5ae2faed6266d99f3d
Introduces an API to drop input events on this SurfaceControl. This
policy will be inherited by its children. The caller must hold the
ACCESS_SURFACE_FLINGER permission.
Options include:
ALL: SurfaceControl and its children will not receive any
input regardless of whether it has a valid input channel.
OBSCURED: SurfaceControl and its children will not
receive any input if the layer is obscured, cropped by its parent or
translucent.
These policies are used to enable features that allow for a less trusted
interaction model between apps. See the bug for more details.
Test: atest libgui_test InputDispatcherDropInputFeatureTest
Bug:197364677
Merged-In: Ifcb4133306a43874e74e8fb0f42b60842daf6f25
Change-Id: Ifcb4133306a43874e74e8fb0f42b60842daf6f25
To be used for new task transtion animations
(go/android-new-task-motion) to set a background color behind the
animations instead of showing the wallpaper.
Test: atest FlickerTests:TaskTransitionTest
Bug: 199507257
Change-Id: I7fabfdcaf90be63c11eb3b18d65259c620570cab
It is possible the existing text is changed that triggers a new
translation. We cache the translation response when onShowTransltion
is called. We should keep the translation response is updated if this
is a new translation result.
Bug: 200232741
Test: atest CtsTranslationTestCases
Test: manual. The issue app works fine.
Change-Id: Iaf7423cd35d4484e33de84e478256b77a000f390
go/a11yDragAndDrop
Add AccessibilityAction#ACTION_DROP to potential drop targets.
Add A11yAction#ACTION_CANCEL to the source of the drag.
Developers will be required add the A11yAction#ACTION_DRAG action
(androidX can do this)
Send AccessibilityEvents when appropriate. These events will be
sent when a drag is performed via a11y actions, or via touch events
with a11y enabled.
Drop and cancel events are mutuall exclusive.
To avoid a scenario where a user starts a drag via an a11yAction but
doesn't drop or cancel, the system will cancel the event after a minute
timeout.
Corner cases:
1) A user cannot start a drag on another view without first cancelling
the current one
2) An ACTION_DRAG on a View won't be successful if the last touch point
was in that View
For a11y, we send window events directly from the View to avoid source
merging in ViewRootImpl. (Specifically for the start events, where the
event gets sent from the common ancestor of the source and target
instead of the source)
Bug: 26871588
Test: atest DragDropControllerTests CtsWindowManagerDeviceTestCases:CrossAppDragAndDropTests AccessibilityDragAndDropTest
Use Android's official sample drag and drop apps. Drag within window and across split screens
Use ReceiveContentDemo target app with sample app
Change-Id: Ie8554d25ab6c43b08d2dacb8c8907b1636bd72b4
For all possible states a device can assume, the DisplayManagerService
provides the DisplayInfo associated with that layout of the logical
display. WindowManager applies each possible rotation to these
DisplayInfo. This, in turn, is used to calculate the possible max
WindowMetrics on the device.
Done:
* Display stack builds collection of DisplayInfo, for all
possible display states (folded, unfolded on jumbo)
* Display stack pushing set of DisplayInfos to WindowManager
* WindowManager calculates max bounds for all possible
(display layouts x rotations)
Not started:
* WindowManager calculates insets for each rotation
Bug: 181127261
Test: atest DeviceStateManagerGlobalTest
Test: atest DeviceStateManagerServiceTest
Test: atest LogicalDisplayMapperTest
Change-Id: I3a407262e755cb57c506b7255eb5c067523381d3
The system will add requested view reference into cache but it is
possible the requested translation view is a viewgroup, we don't add
this into view reference list that cause the translation doesn't work
on ViewGroup.
Bug: 200233857
Test: atest CtsTranslationTestCases
Test: manual. Use a sample code to request translation for a
viewgroup and make sure it is added into view reference list.
Test: manual verify with issue client app, it works.
Change-Id: Ie593a1a436fd046373412ae2955a78057d22b892
This change make the snapshot starting window holds the requested
visibilities when created from the task. Such that, when the window get
back from the background, the insets state in the window state can have
the correct visibilities.
Test: check getInsetsStateWithVisibilityOverride as described in the bug.
Bug: 196637509
Bug: 185729224
Change-Id: I54ab0791b169331c22cd89f7e6da640322bf7dd3
WindowContext relies on WindowTokenClient#onConfigurationChanged after
calling WMS#attachWindowContextToDisplayArea.
However, it took some time to wait for onConfigurationChanged callback
from the server side so that we may get a stale value right after
creating WindowContext.
This confuses developers especially when the foreground activity is in
size compat mode or freeform because the process config is overridden
by activity's config.
This CL makes #attachWindowContextToDisplayArea return DA's configuration
and applies to WindowContext direcly.
It also benefits WindowProviderService because it can obtain DA's
configuration before onCreate() based on [1] and this CL.
Bug: 190019118
Bug: 190745506
Bug: 198298520
Test: manual - 1. launch an Activity in size compat mode
2. create a WindowContext and verify if WindowMetrics
matches DA bounds.
Test: atest WindowContextTest WindowContextTests
Test: atest WindowContextControllerTest ContextGetDisplayTest
[1]: dd4a748af0
Change-Id: I8dd3987b731662502bc01e9d2ed67e718ada5f46
Hold the surface control lock in PositionUpdateListener
callbacks before checking if the SurfaceControl will
be null. UI tread might release it after the checks
causing crashes.
Also fix a case where the ViewRootImpl may be null
in the positionChanged callback.
Bug: 199261027
Test: run steps in bug
Test: go/wm-smoke
Change-Id: I5a4cac35fe14356389b29268fddf9703b25c03aa
(cherry picked from commit 2cafd8b44d)
New API provides all maximum WindowMetrics, for all
possible rotations in each DeviceState. This information
allows launcher apps to determine different device
layouts ahead of time, without having to reload the
grid model on every device state change (fold/unfold).
Done:
* WindowManager calculates bounds for the given display, in
possible rotations
* Defining API surface
Not started:
* WindowManager calculates insets for each rotation
* Display stack builds collection of DisplayInfo, for all
possible display states (folded, unfolded)
* Display stack pushing set of DisplayInfos to WindowManager
Bug: 181127261
Test: atest FrameworksCoreTests:WindowMetricsTest
Test: atest FrameworksCoreTests:WindowInsetsTest
Change-Id: Ic4580f9c1ee919e5e93cd96b8f11c743fa42f9f1
A11yAction#ACTION_DRAG_START.
This allows the system to run a11y-specific code
and still accept drags via touch events when a11y is
enabled.
Test: builds
Bug: 26871588
Change-Id: I40e8f1adf5b773c8fa02173cbd96aa5e9ed54a4d
Currently, we only allow translation for the resumed Activity. It
works fine for full screen Activity. On foldable devices, we may
have two Activity in the same time. It is possible one Activity is
on the paused state but there is still new incoming message, we
should also allow the message can be translated.
Bug: 199264898
Test: atest CtsTranslationTestCases
Test: manual. Use one Activity targetsdk prior to Q then receiving
broadcast to start Ui translation on paused state in split mode.
Change-Id: I6720b41d9995c9ced2e3b2b87eb95540101d15a0