Commit Graph

15366 Commits

Author SHA1 Message Date
Vishnu Nair
02a5b03909 Merge "Add focus support for SurfaceControlViewHost" 2020-09-16 15:26:26 +00:00
TreeHugger Robot
29c1e03816 Merge "Remove unnecessary null checking on ViewRootImpl#mWindowAttribute" 2020-09-16 12:39:22 +00:00
Ryan Lin
28a10589ef Merge changes Ic12d6d90,Iecd5e1bc
* changes:
  Implement transitn animation while switching the mode
  Change magnification animation callback (2/2)
2020-09-16 01:13:03 +00:00
Vishnu Nair
204c023ae2 Add focus support for SurfaceControlViewHost
This change introduces a new call for clients to request focus on their
embedded views. In order to accomplish this, the owner of the
SurfacePackage sends an input token that can identify the input channel
of the embedded window. This token is forwarded as part of the focus
request.

WindowManager will authenticate the calling window and the relationship
between the host and the embedded window. Once authenticated, the
request will be forwarded to InputDispatcher. InputDispatcher will grant
the focus to the SurfaceControlViewHost if the host window is currently
focused or transfer focus back to the host window if the
SurfaceControlViewHost is focused. Otherwise the request is dropped.

In addition, SurfaceView, the host in this scenario, now overrides the
onFocused function to transfer focus to and from the embedded view.

Test: atest SurfaceControlViewHostTests
Bug: 151179149

Change-Id: Ia95545a60d73db4c03679bce9747d2e275806838
2020-09-15 14:48:13 -07:00
Jeff Sharkey
4b5b0174d0 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570 am: 487d394296
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: Id01f468b43fd5b2aada78608010625b392c1b647
2020-09-15 21:01:48 +00:00
Chavi Weingarten
4c2a7b1dfe Merge "Send ScreenCaptureListener to native screen capture requests." 2020-09-15 20:51:25 +00:00
Ming-Shin Lu
8b9d7baa41 Remove unnecessary null checking on ViewRootImpl#mWindowAttribute
From static analysis, as ViewRootImpl#mWindowAttribute is now a final
object from CL[1] and the object is created when ViewRootImpl initialized
so the object reference should not be changed, it won't be necessary to do
the null check again for some code points.

[1]: I0d749c1abb38520fe8fc477d22d6523f470e9abc

Fix: 168335781
Fix: 168319140
Test: build and check launching app without any exception.

Change-Id: I30e1efb8e52704fbd8c97dc375e7ac253c6a90a8
2020-09-15 17:23:06 +00:00
ryanlwlin
6c4ffacb47 Change magnification animation callback (2/2)
We send callback when the animation is canceled/reversed due to
the new quest while animating.

Bug: 161669184
Test: atest com.android.systemui.accessibility
      atest com.android.server.accessibility.magnification
Change-Id: Iecd5e1bcf0ac097d4271ff0d277872b1dab0c63d
2020-09-15 13:35:33 +08:00
Jeff Sharkey
487d394296 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: I79488866c538bf9e76d0a6429e30262978f6fdab
2020-09-15 00:13:08 +00:00
Jeff Sharkey
da7478b570 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: I9b79dbf3e9983523db11599d8ae289b05aabf80c
2020-09-14 23:42:34 +00:00
Jeff Sharkey
741c0a78cc Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: I7da537200efe31e803234bd1a0236843064186c8
2020-09-14 23:10:42 +00:00
chaviw
bc10049654 Send ScreenCaptureListener to native screen capture requests.
Allow for asynchronous screenshot by sending a ScreenCaptureListener to
handle screenshot callbacks. All existing calls are still synchronous
since the SurfaceControl method will block the caller until the results
from SurfaceFlinger are ready.

Test: power + volume down
Test: adb shell screencap
Bug: 162367424
Change-Id: I6cb5641dc19f32f262e3120949fc30ea104cff89
2020-09-14 11:22:07 -07:00
Jeff Sharkey
a8cec413b6 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: I245b8d9cac722da76ea67983738a3cbb9deb68df
2020-09-14 10:00:07 -06:00
Jeff Sharkey
6516a83886 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: Ifce5239991e3b78dd4757712e3b88093ad7161f0
2020-09-14 10:00:02 -06:00
Jeff Sharkey
705f6bec2d Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: I53003332717baf57dc088b2f6b969cdb1863f65e
2020-09-14 09:59:01 -06:00
Treehugger Robot
f1e4da1e19 Merge "Update language to comply with Android's inclusive language guidance" am: 558a921d81 am: 927f0f7453 am: 1ff037880a am: 6671acef6e am: 8513ac2afc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1382388

Change-Id: I78e18d9c1490523aeeac4c720f4588bdacd45d2c
2020-09-11 23:50:25 +00:00
Treehugger Robot
8513ac2afc Merge "Update language to comply with Android's inclusive language guidance" am: 558a921d81 am: 927f0f7453 am: 1ff037880a am: 6671acef6e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1382388

Change-Id: Icb0ab4bed8a74674fcfbdd7c8e0885a2994ec0cb
2020-09-11 18:17:49 +00:00
Treehugger Robot
6671acef6e Merge "Update language to comply with Android's inclusive language guidance" am: 558a921d81 am: 927f0f7453 am: 1ff037880a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1382388

Change-Id: I4ec82de3182802b71ebe8c5a9ac2b9bdaaa58cdf
2020-09-11 17:29:36 +00:00
Treehugger Robot
1ff037880a Merge "Update language to comply with Android's inclusive language guidance" am: 558a921d81 am: 927f0f7453
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1382388

Change-Id: I03a1373dcc1cdcf0d73536d98d5205317183cdef
2020-09-11 16:48:39 +00:00
Chavi Weingarten
854bcaa60b Merge "Revert "Send ScreenCaptureListener to native screen capture requ..."" 2020-09-11 16:10:26 +00:00
Lais Andrade
e5c953b7ec Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

BUG: 162536543
Test: N/A
Change-Id: Ied240c486df4072ca6301511aa3419f746404afa
2020-09-11 14:31:20 +00:00
Hyundo Moon
6b19ee1578 Merge "Make KeyEvent#isMediaSessionKey() as public" 2020-09-11 13:07:52 +00:00
Chavi Weingarten
797bdc9929 Revert "Send ScreenCaptureListener to native screen capture requ..."
Revert "Update screen capture functions to accept a ScreenCaptur..."

Revert submission 12404049-async_screencapture

Reason for revert: 168149157, 168154840
Reverted Changes:
I54c34003c:Send ScreenCaptureListener to native screen captur...
I9cbc833f8:Update screen capture functions to accept a Screen...

Change-Id: Ibd2b1e6588aa45fe228ea7c4c43dbf7a5402aaa5
Bug: 168154840
Bug: 168149157
2020-09-10 23:03:53 +00:00
TreeHugger Robot
fe4f84bbe0 Merge "Remove Session#getDisplayFrame" 2020-09-10 05:29:20 +00:00
Hyundo Moon
9b6f93c57a Make KeyEvent#isMediaSessionKey() as public
Bug: 168144655
Test: m update-api -j;
Change-Id: I701368b5d6413e94ac3c25b4cd352a0b8315af53
2020-09-10 08:01:36 +09:00
TreeHugger Robot
52c7758fbd Merge "Request focus using setFocusedWindow" 2020-09-09 20:22:15 +00:00
Rob Carr
5efdce4bab Merge "WSA/ViewRootImpl: Move resize detection to client" 2020-09-09 19:40:22 +00:00
Tiger Huang
d541d1d4fd Update requested state after applying pending frames am: dfc8abb1ff
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12526908

Change-Id: I40156abe8952ae5b9ed36b3bc6ae5b854380e14e
2020-09-09 19:30:32 +00:00
Winson Chung
30931373de Merge "Remove sysui from having to manually notify pip visibility" 2020-09-09 16:29:15 +00:00
Riddle Hsu
ccaeffc03f Remove Session#getDisplayFrame
The frame won't be changed if there is no IWindow#resized or
IWindowSession#relayout. So it can be retrieved from these methods
directly instead of another binder transaction.

And because some parameters are usually used together for layout,
the parameters are consolidated into a new ClientWindowFrames.
That reduces changing the interface in the future if the frame
related information needs to be changed.

Also refine the resize handling in ViewRootImpl to make it easier
to read.

There should be no behavior change by this modification.

Bug: 161781274
Test: WmTests, DialogFrameTests

Change-Id: I9f711ad2023442046fa8582944320b98e7c4ecfa
2020-09-10 00:26:11 +08:00
Winson Chung
8e51146233 Remove sysui from having to manually notify pip visibility
- Set directly from the system when we enter/leave pip so there's
  no chance this gets out of sync

Bug: 167682726
Test: adb shell input keyevent 171 (ensures this still triggers the menu)

Change-Id: I73b4c5b6faebd505bf8e17b4c817b4d600025894
2020-09-08 23:04:22 -07:00
Ryan Lin
96eefda22e Merge "Change magnification animation callback (1/2)" 2020-09-09 02:46:25 +00:00
Robert Carr
60af51835d WSA/ViewRootImpl: Move resize detection to client
Part of the chain of moving surface size ownership to the client
and making relayout asynchronous. We were already sending Surface
size to the client so it's easy to just use that and avoid
sending an extra result flag.

Bug: 161937501
Test: Existing tests pass
Change-Id: I18a96616d2cf082197fbbd434a737ed77ba40e9c
2020-09-09 01:27:15 +00:00
ryanlwlin
e4d954337f Change magnification animation callback (1/2)
To handle the transition issue, we would like to add this callbck
both in full-screen and window magnification.

Bug: 161669184
Test: atest FullScreenMagnificationControllerTest
Change-Id: I590871386f885827126a1f21937780d3e6e918d0
2020-09-09 08:38:44 +08:00
Winson Chung
d9b9d038b8 Merge "Allow enabling/disabling batching in BatchedInputEventReceiver" 2020-09-08 21:58:04 +00:00
Chavi Weingarten
932d71679f Merge "Send ScreenCaptureListener to native screen capture requests." 2020-09-08 19:05:58 +00:00
Winson Chung
0e32990cff Allow enabling/disabling batching in BatchedInputEventReceiver
- Use the batched receiver when handling back only after the
  gesture is recognized (fewer updates)
- Remove some unused code

Bug: 167732711
Test: Back gesture still works
Change-Id: I2b12574a4d6c7f997a8cdc70825ef1bd03669fd8
2020-09-08 18:46:08 +00:00
Matt Casey
55689cf778 Merge "Set the default screenshot delay to 0ms" 2020-09-08 17:25:39 +00:00
chaviw
3510924a6d Send ScreenCaptureListener to native screen capture requests.
Allow for asynchronous screenshot by sending a ScreenCaptureListener to
handle screenshot callbacks. All existing calls are still synchronous
since the SurfaceControl method will block the caller until the results
from SurfaceFlinger are ready.

Test: power + volume down
Test: adb shell screencap
Bug: 162367424
Change-Id: I54c34003c0786b585dd20530a06dbd4b266e178c
2020-09-08 09:59:50 -07:00
Tiger Huang
dfc8abb1ff Update requested state after applying pending frames
When there is an insets animation, we will stop updating insets source
frames until the animation is done. The previous logic didn't update the
frames within the requested state while the animation is done. And the
frames was relied by InsetsPolicy while playing transient bar animation.
If the frames don't match the display, the insets would be wrong, and
the animation wouldn't be played correctly.

Fix: 161134197
Test: atest InsetsControllerTest
Merged-In: Id8f3c1956fbfe3ad16f167ff76297dde6c634e81
Change-Id: Id8f3c1956fbfe3ad16f167ff76297dde6c634e81
(cherry picked from commit 23c75281ef)
2020-09-07 16:09:08 +08:00
Tiger Huang
0e9c2ea160 Merge "Notify visibility change if source visibility is changed" 2020-09-04 08:36:55 +00:00
Miranda Kephart
bf82822698 Set the default screenshot delay to 0ms
Bug: 165267251
Test: manual -- ensured that the time needed to hold is 0ms if the
screenshot_keychord_delay debug value is not set, and that the
delay can still be changed using

adb shell device_config put systemui screenshot_keychord_delay <ms>

Change-Id: Iab989ecf14ef379658130adbced241e084554e63
2020-09-03 15:51:31 -04:00
Tiger Huang
fd94351305 Notify visibility change if source visibility is changed
This makes view root dispatch the up-to-date WindowInsets to the app.

Fix: 166619182
Test: Steps in the bug (comment#12)
Change-Id: I8c47e3be84357f65084a7d9994f7d7b68f15611e
2020-09-03 23:01:21 +08:00
Tiger Huang
7053288de1 Merge "Make FLAG_LAYOUT_NO_LIMITS compatible" 2020-09-03 07:14:31 +00:00
Tiger Huang
f6a91b70a0 Merge "Remove redundant comment in Javadoc" 2020-09-03 07:09:34 +00:00
Vishnu Nair
3e5d102ef6 Request focus using setFocusedWindow
This change introduces two new SurfaceControl apis, one to request focus
to a particular window and the other to transfer focus to an embedded
window if the host window is currently focused.

WindowHandleInfo is updated to specify focusability instead of the
currently focused window. This will provide more information to
InputDipatcher on what all the focusable windows are on screen and
in the future allow it to determine a new focus target.

Lastly, after updating all the WindowHandles in InputMonitor, we switch
over to calling setFocusedWindow to specify the desired focused window.
There should be no functional changes with this cl.

Test: atest inputflinger_tests
Test: atest CtsWindowManagerDeviceTestCases
Test: atest FlickerTests

Bug: 151179149
Change-Id: Iefda51ce73247b208115e64f9f8159a182d93ded
2020-09-02 16:13:13 -07:00
Xin Li
c8c8e8e8be Merge RP1A.200720.011
Bug: 167588565
Merged-In: Iec7a26ecd68aca9c7a38cc8f441197a8237b0c8c
Change-Id: Ia8f5f008bc1f77115b644ab996aedc892fab68e7
2020-09-02 12:34:37 -07:00
Tiger Huang
8784870821 Merge "Compare with oldSoftInputMode after restoring softInputMode" into rvc-qpr-dev am: 6a1829d14a am: b95d91a1ba
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12500989

Change-Id: I3fd81eb8a739cc2bb55f23ab49a4ab27d62bced6
2020-09-02 18:05:55 +00:00
Tiger Huang
63b0b6e6bb Make display frame compatible am: 677078e872
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12500988

Change-Id: Ie735f38e26cd6fa5c71aef0dbf70e87072b1ae4c
2020-09-02 12:19:24 +00:00
Tiger Huang
b95d91a1ba Merge "Compare with oldSoftInputMode after restoring softInputMode" into rvc-qpr-dev am: 6a1829d14a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12500989

Change-Id: I603f8ba6efa2b4536da8a039c06aefac63f57501
2020-09-02 12:18:58 +00:00