Commit Graph

17851 Commits

Author SHA1 Message Date
Philip Junker
83704e06b3 Merge changes from topic "keyLayoutAPI"
* changes:
  Add TestAPIs to test InputDevice#getKeyCodeForKeyLocation().
  Add API to get KeyCode produced by physical key location.
2022-01-24 18:39:18 +00:00
Nataniel Borges
2a7fc664a0 Merge "Add API for writing WM trace to file" 2022-01-24 17:41:59 +00:00
Nadav Bar
7d3df7b69f Merge "CaptioningManager: handle a case where caption calls enabled resource is not defined" 2022-01-24 13:45:11 +00:00
Tiger Huang
e99c5306cd Merge "Remove forwarded insets" 2022-01-24 08:03:20 +00:00
Shan Huang
7f10e2981c Merge "Implement OnBackInvokedDispatcher" 2022-01-24 05:14:29 +00:00
Tiger Huang
e45f1e5fac Remove forwarded insets
It was only used by ActivityView to forward IME insets, but ActivityView
is gone now. We should clean it up.

Bug: 161810301
Test: presubmit
Change-Id: Ib173112f2d668b0bb93ee2b5e639d236686846c1
2022-01-24 12:24:59 +08:00
Shan Huang
54b9c9d66e Implement OnBackInvokedDispatcher
Bug:209867448
Test: mp core services sysuig. atest FrameworksCoreTests:WindowOnBackInvokedDispatcherTest

Change-Id: Ib74250e93926854f07ebba6b9f680040aa98f9a4
2022-01-23 23:30:37 +00:00
Tiger Huang
697660ac69 Merge "Let the client set transform hint on its own" 2022-01-23 18:02:11 +00:00
Haoyu Zhang
8860e4044f Merge "Scribe in View: enable Handwriting" 2022-01-22 19:57:23 +00:00
Galia Peycheva
5c57f3bebf Merge changes from topic "keep_clear_areas"
* changes:
  Add keep clear rects API
  Add WMS support for keep-clear areas
2022-01-22 17:25:09 +00:00
Tiger Huang
5242af609e Let the client set transform hint on its own
This is a step to move the layout logic to the client side. We won't
invoke IWindowSession#relayout then.

Bug: 161810301
Test: atest WmTests
Change-Id: Ib5ac048a573907af0a81f3e228575d9458862cfd
2022-01-22 19:22:23 +08:00
Tiger Huang
c5ee8aa405 Merge "Pipe display install orientation 2/2" 2022-01-22 08:01:00 +00:00
Galia Peycheva
4e2adbd3c4 Add keep clear rects API
This allows the app to set views as keep-clear areas, which the system
will avoid laying out floating windows over, like Pip or Bubbles.

Bug: 209577354
Bug: 209578131
Test: atest CtsWindowManagerDeviceTestCases:KeepClearRectTests
Change-Id: I02f72376b709c0534bd678b7ce66cd95cab41832
2022-01-22 08:50:42 +01:00
Galia Peycheva
92edc518ff Add WMS support for keep-clear areas
Test: atest DisplayContentTests#testKeepClearAreasMultipleWindows
Test: atest WindowStateTests#testKeepClearAreas
Bug: 183746978
Change-Id: I974bf4254003467c8aa9a4f7aa618ab96985dd38
2022-01-22 08:50:02 +01:00
Peiyong Lin
4f8f656dca Merge "Raise SurfaceControlFpsListener to System API." 2022-01-21 20:30:59 +00:00
Nadav Bar
6785133405 CaptioningManager: handle a case where caption calls enabled resource is not defined
Change-Id: I9a54aef7f3cdbf7fa8e0d894b9c4c0223ff85605
Bug: 215444065.
Test: CaptioningManagerTest#testIsCallCaptioningEnabled
2022-01-21 21:58:31 +02:00
Philip Junker
704afe2077 Add TestAPIs to test InputDevice#getKeyCodeForKeyLocation().
Mention @RequiredPermission(..) where applicable / move it from javadocs.

Bug: 179812917
Test: atest KeyboardLayoutChangeTest
Test: atest android.hardware.input.cts.tests -m
Change-Id: I183734d3bb80a6f0c69f27629bfaaa577e4fab59
2022-01-21 17:59:08 +01:00
Philip Junker
71355cd52a Add API to get KeyCode produced by physical key location.
The physical key location is provided as a location keyCode pointing to a location on a US keyboard layout.

Bug: 179812917
Test: atest KeyboardLayoutChangeTest
Test: atest android.hardware.input.cts.tests -m
Change-Id: Ie1b424a0e0bfea2bc15b0b3a644f2f718f16094e
2022-01-21 17:56:10 +01:00
Vishnu Nair
80d665bbbc Pipe display install orientation 2/2
This is a step to move the layout logic to the client side. We won't
invoke IWindowSession#relayout then, and the client should be able to
set the transform hint on its own.

Bug: 161810301
Test: presubmit
Change-Id: Ib12a76fcc9906b3d9c487fb89bbe4520c682379a
2022-01-22 00:16:32 +08:00
Nataniel Borges
d9edbe7a50 Add API for writing WM trace to file
Currently the API supports only starting or stopping the trace, and writes to file when the trace is stopped. However, in some scenarios we would like to maintain the trace active, and just dump the trace.

Bug: 205138504
Test: all API, check if files are created under /data/misc/wmtrace
Change-Id: Ia1d38ebcfd5a9d45e25bc7a29146aca54d4bdaf3
2022-01-21 12:06:12 +01:00
Peiyong Lin
399e06d648 Raise SurfaceControlFpsListener to System API.
Previously the SurfaceControlFpsListener is a hidden API which only
allows platform code access. This patch renames it to follow the
callback convention and raises it to be a system API in order to allow
system applications to access the FPS count of a task and its children.
The FPS count access is guarded by a permission ACCESS_FPS_COUNTER.

To follow the API convention and properly check the permission, the
register/unregister callback APIs are moved to WindowManager and
permission check is done in the System Server.

Minor: Rename to SurfaceControlFpsCallback to TaskFpsCallback in order
to follow the API naming convention.

Bug: b/199920468
CTS-Coverage-Bug: b/199920468
Test: atest TaskFpsCallbackTest
Change-Id: I6b0a0ad6500278b3da09059e9c2ede28d9a743aa
2022-01-21 09:18:08 +00:00
Ady Abraham
5b299e3914 Merge "Fix negative frame time nanos." 2022-01-21 04:19:05 +00:00
Haoyu Zhang
57620822d3 Scribe in View: enable Handwriting
Bug: 209854913
Test: atest FrameworksCoreTests:HandwritingInitiatorTest
Change-Id: I8449b3d9e713e226a2cd2b772103e79bf65b88c9
2022-01-20 16:31:04 -08:00
TreeHugger Robot
ce65b04d56 Merge "Revert "Revert "Migrate unsafe parcel APIs in framework-minus-apex""" 2022-01-20 11:33:39 +00:00
Shan Huang
5b44dd8b79 Merge changes from topic "shanh-back-api"
* changes:
  Provide OnBackInvokedDispatcher from Activity, View and Dialog
  Introduce IOnBackInvokedCallback and OnBackInvokedDispatcher
2022-01-20 07:20:51 +00:00
Shan Huang
c0999600ee Provide OnBackInvokedDispatcher from Activity, View and Dialog
Test: mp core sysuig services
Bug: 195946584

Change-Id: Ia882ec621154ea1daa780c8976b900e4c8f44a7d
2022-01-20 01:33:56 +00:00
Shan Huang
14b38d5a00 Introduce IOnBackInvokedCallback and OnBackInvokedDispatcher
Test: mp core, m -j update-api
Bug:195946584

Change-Id: I7997c69fca69cc8875410d8240caf48feef34378
2022-01-20 01:06:53 +00:00
Rachel Lee
cc9c644106 Fix negative frame time nanos.
On scheduling delays, frame time nanos changes.

Bug: 215299245
Bug: 198191703
Test: atest ChoreographerTest
Change-Id: Ia813971380276a93e0feabc3705dbe7515cc24ae
2022-01-19 15:33:47 -08:00
Lais Andrade
41fd16dfb7 Merge "Deprecate boolean settings for haptic feedback and vibrate when ringing" 2022-01-19 17:24:40 +00:00
Prabir Pradhan
08d0c47646 Merge "Introduce SimpleBatchedInputEventReceiver" 2022-01-19 11:24:21 +00:00
Bernardo Rufino
1a5cb387d6 Revert "Revert "Migrate unsafe parcel APIs in framework-minus-apex""
This reverts commit 331be9a643.

Reintroducing ag/16366278 since it seems unrelated to b/214053959 (more details on b/214053959#comment55).

Original commit message:

Migrate unsafe parcel APIs in framework-minus-apex

Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()

This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).

A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.

Bug: 195622897
Change-Id: I272432e6e082a973f7a50492ec35d79c2b577c93
Test: TH passes
2022-01-19 11:13:18 +00:00
Jacky Kao
1700cab5f8 Merge "Adds APIs to let live caption can access the data in the DB (2/n)" 2022-01-18 23:26:52 +00:00
Rachel Lee
34f56bf78a Merge "Implement Java Choreographer multi frame timeline." 2022-01-18 20:30:18 +00:00
Lais Andrade
a01a1f6993 Deprecate boolean settings for haptic feedback and vibrate when ringing
Deprecate HAPTIC_FEEDBACK_ENABLED in favor or HAPTIC_FEEDBACK_INTENSITY,
and VIBRATE_WHEN_RINGING in favor or RING_VIBRATION_INTENSITY.

Introduce hidden flag
VibrationAttributes.FLAG_BYPASS_USER_VIBRATION_INTENSITY_OFF
to represent HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING in the
vibrator service. This is applied by:

- PhoneWindowManager, that converts HapticFeedbackConstants into
(VibrationEffect, VibrationAttributes).

- CellBroadcastAlertAudio, that triggers alerts using AudioAttributes
with flags FLAG_BYPASS_INTERRUPTION_POLICY (that translates to same flag
in VibratorManager, to bypass DnD) and FLAG_BYPASS_MUTE (that translates
to this new flag, to bypass the new alarm intensity settings).

The new flag is erased from request that are not from privileged apps,
similar to the other bypass flag. The public
HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING has also been
deprecated in T with a documentation explaining the removal of platform
support.

Remove SysUI dependencies on the deprecated settings, it should use the
USAGE_TOUCH attribute and rely on the vibrator service to apply the user
settings.

Keep other SysUI dependencies that needs to run in older Android
versions (like Launcher3).

Bug: 185351540
Test: VibrationSettingsTest + manual
Change-Id: I0372e4db19e09523795d7e79b9f7a15ae48a8cd9
2022-01-18 18:57:10 +00:00
Taran Singh
461e6477ba Merge "Scribe in IMF: CursorAnchorInfo#getEditorBoundsInfo 3/N" 2022-01-18 18:56:18 +00:00
Pablo Gamito
ab4a170645 Merge changes from topic "showBackground-api"
* changes:
  Support backgrounds during animations in shell
  Add API to show background behind animating windows
2022-01-18 15:55:59 +00:00
Taran Singh
14d8e9450e Scribe in IMF: CursorAnchorInfo#getEditorBoundsInfo 3/N
Add a new field EditorBoundsInfo in CursorAnchorInfo
and implement it.

Bug: 203086136
Test: atest CurosrAnchorInfoTest

Change-Id: I7f225fa1236534bbd18920f8ce8293df23ea2ce7
2022-01-18 02:24:15 -08:00
shawnlin
113c28722b Add an public api to create a DisplayCutout with path for test only
Currently, there is no way to construct a DisplayCutout with cutout
path.
Androidx and camera app need an way to create a DisplayCutout with path
data for testing and they can only access public API. For test purpose,
we add a public API for it.

Bug: 212191782
Test: atest DisplayCutoutTests
Change-Id: I3118b01447cb77df6245f76c9abcb01ef69e80ec
2022-01-18 15:32:29 +08:00
Prabir Pradhan
f38f5b0d96 Introduce SimpleBatchedInputEventReceiver
Create a BatchedInputEventReceiver that makes it easier to return
whether an event was handled.

Bug: 162194035
Test: build
Change-Id: I8d597189b786db6bb61f1d838a530cc573a42238
2022-01-17 08:14:09 -08:00
Pablo Gamito
4a7c927360 Add API to show background behind animating windows
For the new style of Material 3 activity transitions (go/t-activity-transitions) we fully fade in and out activity windows to a solid background color (that of the activity's theme). This means we need to provide a way for activity transitions to show a solid background color behind the animating windows to fill any space that would otherwise be black. This ability should be available both to system transitions but also to apps that want to create transitions in a similar style without necessarily using exactly the system one.

The API provides a way to specify if a background should be shown behind
the animation or not. If a background is requested it is up to the
transition handler to drawn this background appropriately based on the
type of transition and task/activity info.

Test: atest CtsWindowManagerDeviceTestCases:AnimationBackgroundTests
Bug: 202844659
Change-Id: Iddee6583fb1ad83e3ec238a89030b8c284e04d03
2022-01-17 13:26:54 +01:00
Jacky Kao
726d387e82 Adds APIs to let live caption can access the data in the DB (2/n)
1. Proposes the public APIs to get and the system APIs to set the
status of the captions and UI show/hide, and notify the status change.

2. Creates a new class, CaptioningManagerImpl, to get/set the value
of the secure setting keys through the A11yManagerService.

3. Adds a new permission, to protect the setter methods which can't
be used by 3rd party apps.

Bug: 136282740
Test: a11y CTS & unit tests
Change-Id: I591b98578dbb94ca8b5be8a553b81d23a143ee16
Ignore-AOSP-First: new permissions (not yet in AOSP)
2022-01-17 14:57:45 +08:00
Arthur Hung
35eef32446 Merge "Adjust MotionEvent.FLAG_CANCELED flag to public" 2022-01-17 01:50:16 +00:00
TreeHugger Robot
60c20f23cb Merge "Add API for checking if call captioning is enabled on the device" 2022-01-16 09:02:51 +00:00
Robert Carr
6f8235fc80 WindowlessWindowManager: Support touchable region
We just need to forward the WindowSession call to the internal
method we already support.

Bug: 213603716
Test: Existing tests pass
Change-Id: I692d321a96b5278c75bceb14d5b38459d360b4b9
2022-01-15 21:11:36 +00:00
Rachel Lee
5af0462a57 Implement Java Choreographer multi frame timeline.
Bug: 198191703
Test: atest ChoreographerTest
Change-Id: I822782874bc7167be9ad016681ce31b91a38b7ed
2022-01-14 17:34:31 -08:00
Rob Carr
8ebd7e1ff1 Merge "SurfaceControlViewHost: Add side-channel to SurfacePackage" 2022-01-14 21:40:42 +00:00
Sally Yuen
421de0afb8 Merge "Replace drag & drop constants with finalize ids" 2022-01-14 17:11:29 +00:00
Kriti Dang
1774563ec0 Merge "Runtime resolution changes" 2022-01-14 08:28:12 +00:00
Yunfan Chen
a805c7e55e Merge "Support given content insets for non-IME windows" 2022-01-14 07:11:27 +00:00
Nadav Bar
c751b74f48 Add API for checking if call captioning is enabled on the device
Change-Id: I690072f912ab86d5cdf4275fa9fb11f5d2e78b64
Bug: 210923707, 136282740.
Test: Make, atest CtsAccessibilityTestCases: android.view.accessibility.cts.CaptioningManagerTest
2022-01-13 23:52:52 +02:00