Commit Graph

18440 Commits

Author SHA1 Message Date
Riddle Hsu
28b34045f2 Make sure updateSurface is called for rotation change
The condition to call updateSurface requires relayout request.
And keep the previous requested force-next-relayout to avoid
the value set from performConfigurationChange being replaced,
or before performing traversal, there is another resize event
that erases the pending relayout request.

Bug: 231282871
Test: Set allow home rotation.
      No flickering when rotating 180 degree.
Change-Id: I0fd6701ebe0c17e0e319b1360d48132e0c256358
2022-05-16 17:04:11 +00:00
Nick Chameyev
343260adfa Merge "Synchronize display change with the Shell" into tm-qpr-dev 2022-05-12 16:55:06 +00:00
Chavi Weingarten
4c6707b9da Merge "Lock in Surface#destroy" into tm-dev am: 1559113427 am: a8b7ca659a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18283681

Change-Id: I9dba571b7f37842edb0f719829f3c99968883fd8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 21:26:59 +00:00
Nader Jawad
1f5355a4c8 Merge "Fix memory leak with RenderNodeAnimator" into tm-dev am: b9a8ed8b70 am: b27c97ac73
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18290468

Change-Id: Ica7c4813ed4722ef490f26026155194ce965ab2a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 21:15:02 +00:00
Galia Peycheva
dfa55958fe Merge "Fix return value in View#getUnrestrictedPreferKeepClearRects" into tm-dev am: 32667b28c6 am: 0a574afe01
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18247863

Change-Id: I3dfb211ee14cc02561a65f85b368d94369007e63
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 20:47:29 +00:00
Chavi Weingarten
1559113427 Merge "Lock in Surface#destroy" into tm-dev 2022-05-11 20:06:51 +00:00
Nader Jawad
b9a8ed8b70 Merge "Fix memory leak with RenderNodeAnimator" into tm-dev 2022-05-11 16:49:16 +00:00
Galia Peycheva
32667b28c6 Merge "Fix return value in View#getUnrestrictedPreferKeepClearRects" into tm-dev 2022-05-11 07:42:19 +00:00
Nader Jawad
528b0d2824 Fix memory leak with RenderNodeAnimator
Update View logic to cancel all RenderNodeAnimators
when it is detached from a window.
Updated HWUI Animation logic to enable a cancellation
flag to cancel all animators operating on a RenderNode
whenever the staging parameters are pushed to RenderThread

Fixes: 229136453
Test: Added core test to RenderNodeAnimatorTests
Change-Id: Id674e8474757bfc8dfe30394dde29da49d139bfc
2022-05-10 14:02:40 -07:00
chaviw
40e361cb78 Lock in Surface#destroy
Previously, destroy just directly called release, which was already
locked. Now, destroy invokes some functions in native. This means if
another thread is calling release during the destroy call, it could
cause crashes.

Test: Hard to repro bug
Bug: 223412469
Change-Id: Ie6415f505bbc86505e3fe3ea2a0bea96a3e78ad3
2022-05-10 12:40:58 -05:00
Nick Chameyev
0e1d4e23cb Synchronize display change with the Shell
This CL adds synchronization of applying of the window
container transaction with split-screen layout changes after
the display size change. This is needed for the unfold
animation to have the split screen layout ready
for the first frame of the unfold animation on foldable
devices.

The flow is similar to the display rotation synchonization,
now it is triggered on both physical display change and
rotation.

Bug: 204925795
Test: folding/unfolding, rotating with a split layout
  when Shell transitions enabled/disabled
Change-Id: I30f391dae69cf38768daf49361660d87165f886d
2022-05-10 09:50:34 +00:00
Galia Peycheva
0e8339adc5 Fix return value in View#getUnrestrictedPreferKeepClearRects
Bug: 232052675
Test: m
Change-Id: I8e1bb15276f8e3bf19e78f1f8b9fe2b98c4f843e
2022-05-10 09:39:58 +02:00
Rupesh Bansal
278e8f3bf2 Merge "Add documentation for LayoutParams.preferredRefreshRate" into tm-dev am: 336fcab788 am: b217bbb695
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17955874

Change-Id: I670aa79b5d9a7727e1b8532b035f00c003032649
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-09 17:00:57 +00:00
Rupesh Bansal
336fcab788 Merge "Add documentation for LayoutParams.preferredRefreshRate" into tm-dev 2022-05-09 15:52:20 +00:00
Shan Huang
78c429f948 Merge "Migrate IME to handle back with OnBackInvokedDispatcher." into tm-dev am: e3a61826eb am: 4472170cb9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17952046

Change-Id: Icf52d1afb13bdab55270c3e6319b4d889d114db0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-06 20:19:10 +00:00
Shan Huang
e3a61826eb Merge "Migrate IME to handle back with OnBackInvokedDispatcher." into tm-dev 2022-05-06 19:35:42 +00:00
Mark Punzalan
ded5484e2e Merge "Reset translation state when views disappear." into tm-dev am: 4442058508 am: 39f614d708
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18010158

Change-Id: Ie1489703530020d821fd18689c521e71652c9ccc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-06 19:30:26 +00:00
Mark Punzalan
4442058508 Merge "Reset translation state when views disappear." into tm-dev 2022-05-06 19:26:09 +00:00
Ahaan Ugale
a388f84abc Merge "Fix Autofill dialog does not work" into tm-dev am: f58911cf35 am: 6500b2efc4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17775843

Change-Id: I986d1a13099e5d0533e7543695bcd7789292309e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-06 15:43:25 +00:00
Rob Carr
dda57ab123 Merge "ViewRootImpl/SurfaceView: Listen for queue stalls" into tm-dev am: 7a0ee72bff am: f371225580
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17778270

Change-Id: I5c45dcd148e8dd97346433be70c10ba3fe52f627
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-06 15:41:46 +00:00
Rob Carr
fe7932e71e Merge "SurfaceView: Fix overlocking of mSurfaceLock" into tm-dev am: ec6577d13e am: 3d3692b21d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17808703

Change-Id: I732885cf4600f5e3a71e5d783e0aa840aa108ba2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-06 15:41:31 +00:00
TreeHugger Robot
86c9d56dc2 Merge "Update renderer surface if rotation is changed" into tm-qpr-dev 2022-05-06 13:58:05 +00:00
Ahaan Ugale
f58911cf35 Merge "Fix Autofill dialog does not work" into tm-dev 2022-05-05 16:27:54 +00:00
Rob Carr
7a0ee72bff Merge "ViewRootImpl/SurfaceView: Listen for queue stalls" into tm-dev 2022-05-05 15:11:39 +00:00
Rob Carr
ec6577d13e Merge "SurfaceView: Fix overlocking of mSurfaceLock" into tm-dev 2022-05-05 15:09:15 +00:00
Riddle Hsu
619760a5eb Merge "Move some IWindowManager methods to internal interface" into tm-qpr-dev 2022-05-05 05:49:25 +00:00
Mark Punzalan
c35960c314 Reset translation state when views disappear.
Views may be re-used (e.g., as in ListView and RecyclerView) so we need
to ensure they don't have the translated text when they appear again.

RecyclerView seems to recycle translated views even when
`hasTransientState() == true` which is the case when views are
translated. This should be fixed separately.

Bug: 223700458
Test: atest CtsTranslationTestCases
Test: atest CtsContentCaptureServiceTestCases
Test: atest CtsAutoFillServiceTestCases
Test: manual - New messages are translated correctly even if views are
re-used. Messages are translated correctly when scrolled onto the screen
and stay translated while on-screen.

Change-Id: I97cc418a801c006c857e971110ab811ad383343e
2022-05-05 05:31:38 +00:00
Xiaowen Lei
15e2cd9298 Merge "Add WM transit types for dream activity." into tm-qpr-dev 2022-05-04 22:45:17 +00:00
Robert Carr
74c760394a SurfaceView: Fix overlocking of mSurfaceLock
mSurfaceLock is used to ensure the Surface object stays valid over
the span of the calls to lockCanvas and unlockCanvasAndPost which could
come from any thread. In API Level 29 and below, updateSurface was
split in to two paths, a first path (which would acquire mSurfaceLock)
for when the Surface could be destroyed, and second path for geometry
updates only. The consolidation of these two paths in updateSurface
created an overlocking of mSurfaceLock, which is now acquired even
when mSurface won't be modified. In fact it's acquired whenever the
geometry changes. This means an application rendering thread which
creates delays between lock and unlock canvas could create undesirable
and needless delays on the main UI thread, if the SurfaceView geometry
updates. We also have some underlocking, where we aren't actually
locking when destroying the SurfaceView.

Test: Manual with test app
Bug: 206846658
Change-Id: Idc17d111eee7a7365af4e94a156e7c46c7ea8171
2022-05-04 21:51:55 +00:00
TYM Tsai
de9005c38f Fix Autofill dialog does not work
Apps have only one chance to get Autofill dialog support, it requires
attaching the autofillable view before the Activity has finished
laying out. This change moves the doing request to the view being
laid out, that is the same timing with what Autofill is doing about
the view is auto focused but under different conditions.

Bug: 226674898
Test: atest android.autofillservice.cts.dialog.LoginActivityTest
Change-Id: I9018b8db8673e3b917a303476666ae766fbe7891
Merged-In: I9018b8db8673e3b917a303476666ae766fbe7891
2022-05-04 19:12:42 +00:00
Darrell Shi
8176ed8b17 Add WM transit types for dream activity.
This change adds two WM transit types for opening and closing dream
activities, which allows the system to define transition in and out of
dreams, that are currently being overriden by other transitions.

Set the priority to be just below keyguard transit. The keyguard
occlude/unocclude already correctly handles the dream open/close
animation.

Bug: 222507937
Bug: 220311554
Test: atest WmTests:AppTransitionControllerTest
Test: manually on device by entering and exiting dreams over keyguard,
launcher, and settings. observed animation and relevant types of WM logs.

Change-Id: Iedfa279d56cd9d4c4679cb3b697ee74a98ef727b
2022-05-04 17:13:52 +00:00
Galia Peycheva
0cea5a316b Merge "Fix missing position updates to blur regions" into tm-dev am: f372925a29 am: 3145e89c1c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17989463

Change-Id: I115562417c27f3325ed88bab0e28889208ae1aab
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-04 16:55:15 +00:00
Galia Peycheva
f372925a29 Merge "Fix missing position updates to blur regions" into tm-dev 2022-05-04 16:09:27 +00:00
Riddle Hsu
4bf606c578 Move some IWindowManager methods to internal interface
The methods are only used in system server. It is unnecessary to
declare in aidl.

This also eliminates the confusion of missing permission check
for updateRotation().

Bug: 230863943
Test: atest WindowManagerPermissionTests
Change-Id: I703830650bab3a792982cada99aa1512430658a4
2022-05-04 22:53:17 +08:00
Robert Horvath
bb281dc5fc Merge "Fix re-registering PositionUpdateListener" into tm-dev am: 92d87441e8 am: 3bed2ee0bc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17957083

Change-Id: If211d4606f27ccc12a9dd2dcb7dec99c4946deff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-04 09:59:34 +00:00
Galia Peycheva
38cf61f704 Fix missing position updates to blur regions
The PositionUpdateListener sometimes gets called after the
FrameDrawingCallback, because there is no ordering guarantee between
these two callbacks. This causes the BlurRegions sent to SF to
not have up-to-date positions. For example, an empty Rect gets sent
as the blur region bounds, because the position update hasn't arrived
when the surface transaction is sent. When the position update arrives
it set the correct bounds, but it requires another draw to happen so
that the correct position is picked up.

This CL fixes this issue by saving the blur regions that were last sent
to SF in FrameDrawingCallback and sending another transaction when the
position update arrives. That transaction is merged into the previous
one for the same frame, so the final transaction sent to SF has correct
values.

The CL also moves the FrameDrawingCallback registering logic entirely in
the BlurAggregator in the first onPreDraw. This cleans up VRI

Bug: 197239228
Test: atest --iterations 100 BlurTest#testBackgroundblurSimple
Test: atest BlurAggregatorTest
Change-Id: Ia122df40fdf2aa124299461c2e2597b61fa92699
2022-05-04 08:36:04 +00:00
Robert Horvath
92d87441e8 Merge "Fix re-registering PositionUpdateListener" into tm-dev 2022-05-04 08:16:43 +00:00
Shan Huang
a6666f2221 Migrate IME to handle back with OnBackInvokedDispatcher.
We currently close the IME by having the target application forward KEYCODE_BACK to the IME process through InputMethodManager#dispatchInputEvent and having the IME handle the keycode in InputMethodService#onKeyDown. When apps opt in to OnBackInvokedDispatcher API, we will not dispatch KEYCODE_BACK to apps anymore. Thus we need to migrate IME to the new API for it to close on back invocation.

This implementation forwards OnBackInvokedCallbacks from the IME process
to the app process. This is necessary because all callbacks need to
exist in the app process for them to be considered by hardware back keys. While back gestures go through WM to resolve callbacks from the focused window, hw keys are directly sent to the focused window's ViewRootImpl, bypassing server side back nav logic.

Bug: 228358882
Test: atest CtsInputMethodTestCases:KeyboardVisibilityControlTest
Test: atest CtsInputMethodTestCases:InputMethodServiceTest
Test: atest CtsInputMethodTestCases
Change-Id: Ie207b63b11a56c9b2173f26b734a27b13ebccc60
2022-05-04 05:31:08 +00:00
Mateusz Cicheński
e969bf7d7d Merge "Add a description to the params of keep clear rects APIs." into tm-dev am: f829b1332f am: 6c19b582f1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17772404

Change-Id: If013bf89382b0e2234d7e436e22129f74af9544c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-03 19:19:01 +00:00
Mateusz Cicheński
f829b1332f Merge "Add a description to the params of keep clear rects APIs." into tm-dev 2022-05-03 18:09:16 +00:00
Jernej Virag
8c5597aa23 Merge "Trace Window relayout reasons" into tm-dev am: cfbbd755ff am: f80a3ee1a1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18090282

Change-Id: Ib0bc7b2d229e36bcd8747a805f525e4b9c5f459e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-03 07:45:32 +00:00
Jernej Virag
cfbbd755ff Merge "Trace Window relayout reasons" into tm-dev 2022-05-03 06:45:30 +00:00
TreeHugger Robot
c2fe26367f Merge "Removed extraneous comment delimiter from the getDefaultFocusHighlightEnabled method." into tm-dev am: f4adad3636 am: df483c2f45
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17896368

Change-Id: I665d56fde4cd42154a17ce5974e25d51a1d1e564
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-02 22:57:12 +00:00
Jacqueline Bronger
e6be24496c Merge "Handle PiP params changes in onTaskInfoChanged" into tm-dev am: 936456aebc am: b6a40eb62f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17523158

Change-Id: I7de138ba21dd7327d9470cc9d31e98e99c8a55c0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-02 22:54:52 +00:00
Robert Horvath
9b1ccc06aa Merge "Rate limit calls from apps to reportKeepClearAreaChanged" into tm-dev am: c11507f96c am: 5f5f4eb076
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17982492

Change-Id: I46c7cc288e6b777b91db6da3df76b37133460e47
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-02 22:54:36 +00:00
TreeHugger Robot
2eafd3da04 Merge "Adds perfetto tracing to ScrollCaptureConnection" into tm-dev am: f9ccda5c78 am: c06cd36243
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18070157

Change-Id: I431eb8a7f8d301caca4e3400ab6ad152cde30804
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-02 22:48:35 +00:00
TreeHugger Robot
2ec8bed6a1 Merge "Fix colorSpace lose during screen rotation." into tm-dev am: 0be3f09073 am: 4defc7f61e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18092563

Change-Id: I80ffb989ef411664623da5d83ba7d6c279334d48
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-02 22:48:20 +00:00
Taran Singh
e616c7c0be Merge "Fix InputConnection creation callback" into tm-dev am: d5bb81348c am: 38d073d25f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17896003

Change-Id: I00dd54de32bd23dbd853fe62fce038c3a736fda8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-02 22:41:30 +00:00
TreeHugger Robot
70d2cb1f7b Merge "Allow rapid request/release of pointer capture" into tm-dev am: 5b22099c1c am: ee96617663
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17523884

Change-Id: Ib55604e43b9757a53246f728650dec747864c595
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-02 22:37:38 +00:00
Leon Scroggins
fce0e2d655 Merge "Propagate HDR information to screenshot animation." into tm-dev am: 866f67dc94 am: a3b81cf306
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17992944

Change-Id: I327c82a0a416f06d7d643e479b2aafbd7c0f893d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-02 22:36:19 +00:00