Commit Graph

18464 Commits

Author SHA1 Message Date
Chavi Weingarten
ce679a846b Merge "Add isClone to InputWindowHandle" into tm-dev am: 96f4a2afc2 am: ed3ec69be3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18030066

Change-Id: Iba68cfbf1350444c0a412e6588a38a474e0fc08e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 18:08:20 +00:00
Chavi Weingarten
96f4a2afc2 Merge "Add isClone to InputWindowHandle" into tm-dev 2022-05-24 16:57:32 +00:00
Shawn Lin
7c604236cc Merge "Replace DisplayManager.getStableDisplaySize with max Display.Mode" into tm-dev am: 15cb562bcd am: 02c07a76ba
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18485561

Change-Id: Ifab44e33ac17ab673954019236b74f1fe4bfa4e4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 04:11:22 +00:00
Shawn Lin
0f7cc0128b Replace DisplayManager.getStableDisplaySize with max Display.Mode
The DisplayManager.getStableDisplaySize is not the right way to get the
size we want for screen decorations and display team is going to get rid
of it.

Instead, we use the maximum display size supported by the display as the
base size to define the cutout and rounded corner configs.

Also fixed a bug that DisplayCutoutBaseView didn't update the
shoudDrawCutout config when display change.

Bug: 230227839
Test: 1. On foldable device, fold and unfold the device and check if the
         cutout is correctly drawn.
      2. On device supporting multiple resolutions, switch resolution
         between FHD & QHD and check if the cutout is correctly drawn.
Test: atest LocalDisplayAdapterTest DisplayCutoutTest
           ScreenDecorationsTest RoundedCornersTest
           DisplayCutoutBaseViewTest
Change-Id: I7a602b5abd7d6a21d17eae4f8e99414eaf765fa5
2022-05-21 14:56:30 +00:00
TreeHugger Robot
b3a0c13a88 Merge "Remove preferKeepClearAreaForFocusDelay, turn it into a flag" into tm-dev am: 12a7628e16 am: c3f7c80692
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18184947

Change-Id: I0b1f8272f51f60519011d3a98b1679fe83a3e6ce
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 16:34:16 +00:00
Robert Horvath
92dd353918 Merge "Fix reporting of unchanged keep clear areas" into tm-dev am: b8b8396a2c am: c50ee695d4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18179544

Change-Id: If727b02a714d241cf9691e2c1410f8048e83c348
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 16:33:13 +00:00
Naomi Musgrave
fa30ad6853 Merge "[Media Projection] Require valid token to set session" into tm-dev am: 55ecb4ec82 am: 986c517b77
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18356863

Change-Id: I94a9283d0f1c931a9aceda44dd28fdb63d049c89
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 15:53:40 +00:00
TreeHugger Robot
12a7628e16 Merge "Remove preferKeepClearAreaForFocusDelay, turn it into a flag" into tm-dev 2022-05-20 14:48:45 +00:00
Robert Horvath
b8b8396a2c Merge "Fix reporting of unchanged keep clear areas" into tm-dev 2022-05-20 14:32:14 +00:00
Naomi Musgrave
55ecb4ec82 Merge "[Media Projection] Require valid token to set session" into tm-dev 2022-05-20 13:39:48 +00:00
Robert Horvath
2a6ce367fe Remove preferKeepClearAreaForFocusDelay, turn it into a flag
TV PiP repositioning in response to keep clear area changes will be
debounced in SystemUI, so the client side delay in setting a keep clear
area with focus becomes obsolete.
Instead the config is turned into a flag for whether focused views
should automatically be marked as keep clear areas.

Bug: 231309309
Test: atest KeepClearRectsTests
Change-Id: I0ac61e671bb75e22a95b400c9bd8d84004379e43
Merged-In: I0ac61e671bb75e22a95b400c9bd8d84004379e43
2022-05-19 19:27:44 +00:00
TreeHugger Robot
f5a4b7fd86 Merge "Defines flag to disable touch feedback on display" into tm-dev am: beddca329f am: 02afba9572
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17607970

Change-Id: I4e7280b4493b9f602e5469125302dbe2dc596978
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-19 12:50:52 +00:00
TreeHugger Robot
beddca329f Merge "Defines flag to disable touch feedback on display" into tm-dev 2022-05-19 11:51:29 +00:00
TreeHugger Robot
3f618594b3 Merge "Avoid NPE on ScrollCaptureConnection callbacks" into tm-dev am: 6678f5566b am: 864d188295
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18463432

Change-Id: I50b269fabe8f196c8d4c2e378247baeee2bed854
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-19 08:40:23 +00:00
TreeHugger Robot
6678f5566b Merge "Avoid NPE on ScrollCaptureConnection callbacks" into tm-dev 2022-05-19 06:43:31 +00:00
yuanjiahsu
fc06fc5cb1 Defines flag to disable touch feedback on display
Define FLAG_TOUCH_FEEDBACK_DISABLED to disable touch sound and haptic feedback when creating virtual display.

Bug: 185558698
Test: atest FrameworksCoreTests:ViewRootImplTest, manual testing
Change-Id: Ida67f4027f2636e004218595b3bf088c06194522
2022-05-19 06:01:55 +00:00
Riley Jones
7a8fa9b1f2 Merge "Fix for out-of-bound error regarding NoCopySpan objects" into tm-dev am: 92e59dde2f am: fcd285b64a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18441236

Change-Id: Id21bbba7751a8dcef3c9c0660320ea4daec8d405
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 22:51:30 +00:00
Shan Huang
76bf9ac13c Merge "Transfer IME callbacks when app's focused root view changes." into tm-dev am: f15480984d am: 40f337eabe
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18417321

Change-Id: Ic40a07c262f39693bec1aef68dddfbd7f0a5bcff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 21:59:27 +00:00
Mark Renouf
ac9cef964f Avoid NPE on ScrollCaptureConnection callbacks
State is checked at the front half of some calls, but is
dispatched onto the UI thread. If the connection is closed
in this time, the queued call will NPE when the field it
uses is cleared.

This adds a simple null check in two places, and test for both.

Bug: 232375183
Test: atest ScrollCaptureConnectionTest
Change-Id: Ida7fbf0a21c206db8d774dc247b6ab5257dacabe
2022-05-18 19:25:05 +00:00
Riley Jones
484f7b4d64 Fix for out-of-bound error regarding NoCopySpan objects
Bug: 169417148
Change-Id: I2e4a0a3745bb3a53d8f22d4090cdf4d93e19116b
Merged-In: I2e4a0a3745bb3a53d8f22d4090cdf4d93e19116b
2022-05-17 21:37:27 +00:00
Naomi Musgrave
e3f6b7e16a [Media Projection] Require valid token to set session
When MediaProjection sets the session details in
MediaProjectiondManagerService, clear and re-set the
calling identity (since we have entered the system server
across the aidl boundary).

Additionaly, verify that the call originated from a valid
MediaProjection session. In the current model for
MediaProjection, signature-level permission
MANAGE_MEDIA_PROJECTION is held by the component that shows the
acceptance dialog to the user. The user allowing some app to
capture with MediaProjection is represented by
the IMediaProjection token (see MediaProjectionManagerService#
isValidMediaProjection).

Bug: 230748205
Test: Manual
Change-Id: Iace8eb7eea6c7a99fba7ea726481461a11bd1c90
2022-05-17 22:11:33 +01:00
Shan Huang
6a770ceb14 Transfer IME callbacks when app's focused root view changes.
Previously when curRootView changes IMM, the back callbacks are not
moved to the new focused ViewRootImpl. As a result if IME is up during
the focus change, the back callback would fail to unregister when
IME tries to hide itself.

Test: atest InputMethodServiceLifecycleTest
Test: atest CtsInputMethodTestCases:InputMethodServiceTest
Test atest CtsInputMethodTestCases:KeyboardVisibilityControlTest
Bug: 232660571
Bug: 232331013

Change-Id: Id30e51c74afbcce1f22d87af77e8404b4f0ae7d2
2022-05-16 22:51:06 +00:00
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
Robert Horvath
e18af6e995 Fix reporting of unchanged keep clear areas
ViewRootRectTracker#computeChangedRects returns all tracked Rects if
there are changes to the Rects since the last call to that method, or
null if there aren't.
When ViewRootImpl checked for changed Rects, if only one of either set
of restricted or unrestricted keep clear rects changed,
then #computeChangedRects returned null for the other, which was
subsequently reported as an empty list. If there were keep clear rects
previously reported, this would mistakenly clear them.

This change separates the check for changes and retrieving the list of
latest Rects. If either set of Rects has changed, now it's always the
latest Rects that get reported.

Bug: 231532058
Test: Manual with app with restricted & unrestricted keep clear areas
Test: atest KeepClearRectsTests
Change-Id: Ida51420d0f0e7935a5dc9f3eab902857927c33f5
2022-05-10 16:13:45 +02: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