Commit Graph

18293 Commits

Author SHA1 Message Date
Rob Carr
23e043e977 Merge "SurfaceControlViewHost: Allow updating of WindowContext used for SCVH" into tm-dev 2022-04-19 15:47:26 +00:00
Ryan Lin
6a435bb6bb Merge "Fix InlineFilteringTest#testFiltering_filtersByPrefix" into tm-dev 2022-04-19 02:35:08 +00:00
ryanlwlin
9f226ba4c4 Fix InlineFilteringTest#testFiltering_filtersByPrefix
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
2022-04-19 10:31:49 +08:00
Robert Carr
2fd500488a SurfaceControlViewHost: Allow updating of WindowContext used for SCVH
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
2022-04-18 22:11:10 +00:00
Robert Carr
1e780ab02d SurfaceView: Ensure position update listener sets at least once
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
2022-04-14 16:12:01 -07:00
Chavi Weingarten
700cdec45b Merge "Set mSyncBuffer to true when VRI did not initiate the sync request" into tm-dev 2022-04-14 14:19:43 +00:00
Ryan Lin
565d2b1b85 Merge changes from topic "nodebounds" into tm-dev
* changes:
  remove embeddedMatrix usage for PIP menu
  Change node bounds procedure based on SufaceFlinger Callback
2022-04-14 01:55:04 +00:00
chaviw
2e09cb3188 Set mSyncBuffer to true when VRI did not initiate the sync request
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
2022-04-13 15:41:45 -05:00
Tiger Huang
e467b6e722 Fix InsetsState#calculateVisibleInsets
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
2022-04-13 18:13:52 +08:00
TreeHugger Robot
36d012ca1c Merge "Extend providedInternalInsets to be type specific" into tm-dev 2022-04-13 01:53:07 +00:00
Yurii Zubrytskyi
bb014567f5 frameworks/base - Tiramisu is now 33
Removed deprecated at birth APIs

Test: build and boot
Bug: 225745567
Change-Id: I8a40f4a08e521a7c9632d7652ff1f51fb137b34d
2022-04-12 08:25:15 -07:00
ryanlwlin
7bdc82af7c Change node bounds procedure based on SufaceFlinger Callback
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
2022-04-12 22:24:21 +08:00
Jorim Jaggi
331f163d20 Merge "Fix doc issue linking internal class" into tm-dev 2022-04-12 12:50:54 +00:00
Jorim Jaggi
4e87d6ff0a Fix doc issue linking internal class
Fixes: 148043444
Change-Id: If43ebe0ec38cc00379d8db79481ef2c3116ce867
2022-04-11 22:25:56 +02:00
Tiger Huang
ed3f2e3803 Fix WindowInsets#getStableInsets
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
2022-04-11 17:53:21 +08:00
Tony Huang
9074b73ec7 Merge "Remove getSfInstance usage from ViewRootImpl" into tm-dev 2022-04-08 06:41:24 +00:00
Shan Huang
be460cbac4 Merge "Create OnBackInvokedCallbackInfo to wrap callback and its priority." into tm-dev 2022-04-08 04:07:53 +00:00
Tony Huang
a825a5c0d9 Remove getSfInstance usage from ViewRootImpl
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
2022-04-07 18:15:27 +08:00
TreeHugger Robot
579f8a6234 Merge "Allowing SurfaceViewHost to show up in layout inspector" into tm-dev 2022-04-07 09:28:47 +00:00
Riddle Hsu
a3348272e7 Merge "Pass background color from transition info to remote animation" into tm-dev 2022-04-07 08:41:17 +00:00
Shan Huang
b353af0387 Create OnBackInvokedCallbackInfo to wrap callback and its priority.
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
2022-04-07 05:11:42 +00:00
Tiger Huang
88fdb7aa46 Merge "Update touch mode regardless of mStopped" into tm-dev 2022-04-07 02:17:08 +00:00
Sunny Goyal
87ec28b2ed Allowing SurfaceViewHost to show up in layout inspector
Bug: 191298629
Test: Verified on device
Change-Id: I83c74423b6f33f45cdd93926badb2cad32c7a86d
2022-04-07 00:37:17 +00:00
Shan Huang
d47a172963 Merge "Dispatch KEYCODE_BACK to the full input pipeline in compat callback." into tm-dev 2022-04-06 17:38:38 +00:00
Tiger Huang
df309af84e Update touch mode regardless of mStopped
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
2022-04-06 18:26:27 +08:00
Yunfan Chen
72e2997f31 Extend providedInternalInsets to be type specific
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
2022-04-06 16:55:54 +09:00
Rob Carr
169f3d8c61 Merge "ViewRootImpl: Ensure seqId only increases" into tm-dev 2022-04-06 04:53:55 +00:00
Haoyu Zhang
ef233d0fad Merge "Scribe: fix handwriting is not initiated in WebView" into tm-dev 2022-04-06 00:18:12 +00:00
Robert Carr
25bdf74a0b ViewRootImpl: Ensure seqId only increases
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
2022-04-05 16:52:28 +00:00
Naomi Musgrave
65474b0f43 Revert "Temporary flag for Launcher to debug their usage of sandboxed display APIs"
This reverts commit 253696fea3.

Reason for revert: remove from tm-dev
Bug: 206649452

Change-Id: I013f08dfba89eb89e7713dddc1f4f894e335df62
(cherry picked from commit 608a679783)
2022-04-05 14:30:13 +00:00
Jon Eckenrode
3d1fe11556 Merge "Revised the API documentation of the getLocationOnScreen, getLocationInWindow, and getLocationInSurface methods of View." into tm-dev 2022-04-04 13:31:41 +00:00
Yunfan Chen
00c67a2569 Merge "Provide gesture and tappable element insets for caption" am: 268eff33ec am: 3cd3a85988 am: 0c0ed6f1c1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2052567

Change-Id: I5507131ce08964e99dca2bfa4b416ff7010481a6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-04 03:59:51 +00:00
Yunfan Chen
3cd3a85988 Merge "Provide gesture and tappable element insets for caption" am: 268eff33ec
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2052567

Change-Id: I1e6bf195c6783ba547915653fb3451598cfeb972
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-04 03:30:58 +00:00
Shan Huang
69a3984aae Remove OnBackInvokedDispatcherOwner interface.
Test: m -j update-api. Build and flash and test back behavior throughout
the system.
Bug: 227500290

Change-Id: Ibdb13d02e044741d05d99f1cad96e43dc0129fe4
2022-04-01 20:27:34 +00:00
Vadim Caen
d0923a2197 Merge "Split animation methods out of OnBackInvokedCallback" into tm-dev 2022-04-01 20:13:30 +00:00
Vadim Caen
c627777dda Split animation methods out of OnBackInvokedCallback
This makes OnBackInvokedCallback SAM compatible

Bug: 227789359
Test: atest \
        CtsWindowManagerDeviceTestCases:android.server.wm.BackNavigationLegacyTest \
        CtsWindowManagerDeviceTestCases:android.server.wm.BackNavigationTests \
        WmTests:com.android.server.wm.BackNavigationControllerTests \
        FrameworksCoreTests:android.window.BackNavigationTest \
        FrameworksCoreTests:android.window.WindowOnBackInvokedDispatcherTest \
        CtsViewTestCases:android.view.cts.OnBackInvokedDispatcherTest
Change-Id: Iab86b0488f1b3048eb02042191acaeb6a645a0bc
2022-04-01 20:09:26 +00:00
Gaurav Bhola
be5abebe9f Merge "Add the insets visibilities requested by the focussed window in topFocussedWindowChanged() api." into tm-dev 2022-04-01 19:57:58 +00:00
Prabir Pradhan
baf0f20718 Merge "Remove injectInputAfterTransactionsApplied from WMS" into tm-dev 2022-04-01 19:39:15 +00:00
Chavi Weingarten
c250d4054c Merge "Clean up buffer sync logic in SurfaceView." into tm-dev 2022-04-01 18:17:25 +00:00
Vadim Caen
9e3ac14976 Merge "Add View.findOnBackInvokedDispatcher" into tm-dev 2022-04-01 17:49:33 +00:00
Ming-Shin Lu
df8e2a5131 Merge "Fix insets animations being skipped when the host view was invisible" into tm-dev 2022-04-01 16:02:52 +00:00
Vadim Caen
a28e989921 Merge "Some cleanup logging and test for back navigation" into tm-dev 2022-04-01 15:57:59 +00:00
Vadim Caen
71297c8aab Some cleanup logging and test for back navigation
- Better logging
 - Remove method form OnBackInvokedDispatcher interface (but not the
   implementation)
 - Add test for ag/17211289

Bug: 222675481
Test: BackNavigationControllerTests#testUnregisterCallbacksWithSystemCallback
Change-Id: I6a3ae30da7e29dddda116acd8fa0c9af4b9faa6e
2022-04-01 15:57:49 +00:00
TreeHugger Robot
c5866bede0 Merge "Re-deprecate animation backgroundColor API" into tm-dev 2022-04-01 11:48:52 +00:00
Michael Wright
cf4d6368e1 Merge "Undeprecate LayoutParams.preferredRefreshRate" into tm-dev 2022-04-01 10:43:35 +00:00
Vadim Caen
b23c8c8e87 Add View.findOnBackInvokedDispatcher
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
2022-04-01 11:15:30 +02:00
Ming-Shin Lu
63a95a2795 Fix insets animations being skipped when the host view was invisible
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
2022-04-01 15:36:41 +08:00
Yunfan Chen
16e58e7322 Provide gesture and tappable element insets for caption
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
2022-04-01 05:20:03 +00:00
Pablo Gamito
2b770a7e86 Re-deprecate animation backgroundColor API
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
2022-03-31 23:27:01 +00:00
Sally Qi
acdf1d1252 Merge "Disable HDR dimming when screen rotates." into tm-dev 2022-03-31 23:19:06 +00:00