The window matrix of the embedded window is not updated if the second
host SurfaceView doesn't have any offset. To esnure the window matrix
is up-to-date, we force to update the matrix when the embedded hierarchy
is initialized.
Bug: 229178859
Test: atest InlineFilteringTest#testFiltering_filtersByPrefix
atest android.accessibilityservice.cts
Change-Id: Ib23af520fcbaa1788e3ef22a1086b90a0801375c
Our initial attempt to allow updating the configuration of
SurfaceControlViewHost was insufficient when the SurfaceControlViewHost
is using a service context. This service context will always be
on the global configuration, and ViewRoot won't be able to override it.
We add some documentation suggesting the user use a window context,
and wire up SurfaceControlViewHost VRI so that they are the authority
on configuration (and propagate the change in to the context).
Bug: 215204813
Test: SurfaceControlViewHostTests. Manual in game overlay+split-screen
Change-Id: I24c0309593b7fddaeab8db355f63a5f6bd763562
If we destroy and recreate a SurfaceView in the same frame its
possible for positionChanged for the new surface to arrive
before positionLost for the old surface. In this case we
won't clear mRtLastReportedPosition, and so we won't set
any position at all on the new surface.
Bug: 229052731
Test: Existing tests pass
Change-Id: I896496afa5b05848f96b20697d33911cae9639a7
VRI can initiate syncs, but they can also happen from other places when
using SurfaceSyncer. When VRI initiates the sync, sometimes the buffer
needs to be synced. Other times, we just want to know the buffer has
drawn, but don't actually need to sync the buffer.
When a sync is initiated from outside VRI, using SurfaceSyncer, we
always want to sync the buffer. This change ensures that if the sync was
started from an outside request, it will set mSyncBuffer to true.
An additional part to clarify the sync logic, renamed mLastSyncId to
mSyncId and renamed isInSync to isInLocalSync to clarify that the
mSyncId only represents VRI initiated syncs.
Test: Internet Dialog syncs buffer
Fixes: 229098223
Change-Id: I99e9e6341a487d59c33a33a61e442be7909518c2
Before the new insets system, a window wouldn't receive visible insets
if it:
- has FLAG_LAYOUT_NO_LIMITS,
- is not TYPE_WALLPAPER or TYPE_SYSTEM_ERROR, and
- is not in multi-window mode.
This CL makes the visible insets compatible with the legacy insets
system.
Fix: 223536648
Test: atest InsetsStateTest
Change-Id: Ia73142cfae701d0532a9a397366c50aeef82abb2
The attachInfo from ViewRootImpl is not reliable
for DisplayArea manipulation or windowless window.
To fix this problem, we use the transform matrix of
InputWindowHandle, which could transform the bounds
from window coorindate to screen coordinate. We also
transfrom the bounds to logical display coordinates
with the associated display matrix.
Besides, we also record the magnification spec of the window,
which could get the bounds before magnification. We use
this value to decide the property 'visibleToUser'.
Bug: 200797785
Test: atest android.accessibilityservice.cts WindowInfoTest
atest com.android.server.accessibility
Change-Id: I0917b04fe8b027fb2bd932a6f0604ba1449ebc66
WindowInsets#getStableInsets should return system bar insets as if
system bars are visible, regardless of the window flags.
Fix: 228807465
Test: See if a window with FLAG_LAYOUT_NO_LIMITS or FLAG_FULLSCREEN can
receive all the system bar insets.
Change-Id: Ib8fff5ba78c8f52141a048027821ef182d2f7992
The getSfInstance usage on ViewRootImpl is target to reduce jank
when moving split divider, but legacy split is going to be depracated
and it didn't used on new split too so we can remove whole related
codes safely.
Bug: 222696368
Test: build pass
Change-Id: Icf9b543bdd1d4bee54efb3be852722f247d1bd47
Main motivation is to store a back callback's exact priority value in WM. This is required by the IME migration (ag/17076160) to compare the priority levels of IME window callback and focused window callback in BackNavigationController.
This also consolidates the WindowState#mSystemOnBackInvokedCallback and WindowState#mApplicationOnBackInvokedCallback fields into one field, as tracking two fields for one callback was error prone. We had to remember to clear the application / system field when the other field is set, and failing to do so has resulted in bugs such as b/222675481.
Bug: 224856664
Test: atest BackNavigationControllerTest
Test: atest WindowOnBackInvokedDispatcherTest
Test: m -j and test back behavior throughout the system on apps that
opted in and out.
Change-Id: Ic57113610d934f33d2c9ca4cef59f39a9b87e832
The very first state of touch mode is obtained from addToDisplay. It
should be applied in the first performTraversal regardless of mStopped.
In this way, when an app window is re-created at the background, the
touch mode state can still be up-to-date.
Fix: 227843343
Test: 1. Open Chrome and go to the homepage.
2. Change the theme via the 3-dot menu > Settings > Theme.
3. Go back to the homepage and see if any button is focused.
Expected behavior: no button looks focused.
Change-Id: I2681e2436dd265abe9cd9bdd56ee5799fa30d89b
This change will change the providedInternalInsets from a single insets
to a insets array. The one adding the insets can make use of the array
to apply different insets to the window when calculating the provided
insets by the window for different insets types.
With that, the task bar can provide zero insets for the tappable element
type when stashed.
Bug: 215411414
Test: DisplayPolicyTests
Change-Id: I84cd7ef6a2bc19229d3c09f752f65c83eb5c7dde
We could process an earlier scheduled MSG_RESIZED after
a later executed relayoutWindow. In this case we might
accidentally move the seqId backwards, which could mess
up our logic. While we are touching this area, we
take the opportunity to ensure SyncHandlers execute
in the order they were added.
Bug: 161810301
Bug: 227561299
Test: Existing tests pass
Change-Id: I8e5ceea1ef34e4da94807582c89a33df95772c04
This reverts commit 253696fea3.
Reason for revert: remove from tm-dev
Bug: 206649452
Change-Id: I013f08dfba89eb89e7713dddc1f4f894e335df62
(cherry picked from commit 608a679783)
Test: m -j update-api. Build and flash and test back behavior throughout
the system.
Bug: 227500290
Change-Id: Ibdb13d02e044741d05d99f1cad96e43dc0129fe4
- Better logging
- Remove method form OnBackInvokedDispatcher interface (but not the
implementation)
- Add test for ag/17211289
Bug: 222675481
Test: BackNavigationControllerTests#testUnregisterCallbacksWithSystemCallback
Change-Id: I6a3ae30da7e29dddda116acd8fa0c9af4b9faa6e
To make it easier for developer to migrate away from KEYCODE_BACK
without having to walk up the view hierachy in order to find an
OnBackDispatcher, introduce findOnBackInvokedDispatcher.
Bug: 227301455
Test: android.view.cts.OnBackInvokedDispatcherTest#testGetDispatcherOnView
Change-Id: I7f3e76df596d306fa26d72df8115d5b15d7ac564
In case the insets animation frame will not be scheduled by render
thread when the host window was not visible to user, added
ViewRootInsetsControllerHost#isVisibleToUser to check when invoking
applySurfaceParams to schedule the next frame, if the host was not
visible means we don't have to synchronize with the window host and
just apply the surface transaction on the UI thread directly.
Fix: 206992027
Test: manual as steps
1) Receive any incoming message
2) Tap on inline reply to show the keyboard
3) Tap on the voice input button on the keyboard
4) when permission dialogue prompts on the screen, expecting both
notification shade panel collpse animation and IME hiding animation
are working fine without any stucked frame.
Change-Id: I266587d5a3f136149d116214e2a49de92466ec2e
Caption is covering the app region and will take gesture and tap events
when the user interact with the caption. This change will make sure the
app can receive the caption as a part of the tappable element insets and
gesture insets to avoid the caption overlaps with interactive elements
inside the window.
Bug: 219987804
Bug: 209717743
Test: atest, see the bugs
Change-Id: I6e48f8df6eb8f73a2f62f34109f4d80d09021929
It's prefered to keep the API deprecated since the API was previously
deprecated and made a noop. Undeprecating it would lead to inconsistent
behavior across android versions. With the API not working on some
versions which can easily look like a bug from a developer's
perspective.
Instead we create a new API for the animation background effect refering
to an animation backdrop instead of a background. This also required
updating other API references of background in this context to backdrop.
Bug: 226122431
Test: atest CtsWindowManagerDeviceTestCases:ActivityTransitionTests
Merged-In: I4493d22a33606d639d498b6dc0f6f1bfa3d7f135
Change-Id: I4493d22a33606d639d498b6dc0f6f1bfa3d7f135