Commit Graph

17381 Commits

Author SHA1 Message Date
Adam He
a9ccf34714 Merge "Content Capture change to send window token on creating session." into sc-v2-dev am: b9eafd3c02 am: ba74f17220
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15875817

Change-Id: I00cab1e2fbd4c42dbc41aa57f26b570f7b93a4aa
2021-09-22 20:40:32 +00:00
Adam He
6d70c07884 Merge "Add Content Capture event TYPE_WINDOW_BOUNDS_CHANGED to notify window bounds." into sc-v2-dev am: 8e2e8608a1 am: 5148940766
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15856579

Change-Id: I67ce5198d7ee024ade71adcc7196c2481e24cc17
2021-09-22 20:40:15 +00:00
Adam He
ba74f17220 Merge "Content Capture change to send window token on creating session." into sc-v2-dev am: b9eafd3c02
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15875817

Change-Id: I60f1527336eb0b0251c2b577cf4fdc81d2de2f4c
2021-09-22 20:24:52 +00:00
Adam He
5148940766 Merge "Add Content Capture event TYPE_WINDOW_BOUNDS_CHANGED to notify window bounds." into sc-v2-dev am: 8e2e8608a1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15856579

Change-Id: Ic66995a013565492a45f6dc675ababc09ad91e60
2021-09-22 20:24:10 +00:00
Adam He
b9eafd3c02 Merge "Content Capture change to send window token on creating session." into sc-v2-dev 2021-09-22 20:13:53 +00:00
Adam He
d9e69e2b50 Content Capture change to send window token on creating session.
Bug: 189477723
Test: atest CtsContentCaptureTestCases
Change-Id: I70a0be583faae1a18c61e70c72a3d2a8e9e46438
2021-09-22 17:06:50 +00:00
Adam He
19f65ec098 Add Content Capture event TYPE_WINDOW_BOUNDS_CHANGED to notify window
bounds.

Bug: 189477723
CTS-Coverage-Bug: 189477723
Test: manual verification

Change-Id: I38cfdde21aed1827744f8db4eb61f62cc2413e78
2021-09-21 21:54:52 +00:00
Kaiqiang Wang
1ba3d33a9e Merge "Create Public API in AccessibilityManager to expose Audio description enabled status." 2021-09-21 20:27:43 +00:00
TreeHugger Robot
348a0e6e3c Merge "SurfaceControl: Add setDropInputMode api" into sc-v2-dev 2021-09-21 15:37:27 +00:00
Chris Li
859480ffc2 Merge changes Ib5ad3250,Iff58afdb into sc-v2-dev am: 83d5a591f2 am: 055d1d5a4e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15838390

Change-Id: I437593233fa28a2915ebb4323f2e8172542777ff
2021-09-21 05:42:45 +00:00
Chris Li
055d1d5a4e Merge changes Ib5ad3250,Iff58afdb into sc-v2-dev am: 83d5a591f2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15838390

Change-Id: Ib58e4c6785e050bd6444eb0fe835b096d5506729
2021-09-21 05:28:10 +00:00
Chris Li
83d5a591f2 Merge changes Ib5ad3250,Iff58afdb into sc-v2-dev
* changes:
  Flag whether a RemoteAnimationTarget has parent in animation
  Use TaskFragment bounds instead of TaskBounds for Activity animation
2021-09-21 05:18:46 +00:00
Chris Li
79ab7ea034 Flag whether a RemoteAnimationTarget has parent in animation
There is case when a TaskFragment is resizing while one of its children
is open/close. In such case, both the TaskFragment and its child will be
included in the transition, but we don't want to animate both of them.
Use the new flag to determine if the child need to be animated.

Bug: 196173550
Test: test with demo app
Change-Id: Ib5ad32501e046e5b612f6d5ae2faed6266d99f3d
2021-09-21 08:33:16 +08:00
Vishnu Nair
cbc4b97e31 SurfaceControl: Add setDropInputMode api
Introduces an API to drop input events on this SurfaceControl. This
policy will be inherited by its children. The caller must hold the
ACCESS_SURFACE_FLINGER permission.

Options include:
ALL: SurfaceControl and its children will not receive any
input regardless of whether it has a valid input channel.
OBSCURED: SurfaceControl and its children will not
receive any input if the layer is obscured, cropped by its parent or
translucent.

These policies are used to enable features that allow for a less trusted
interaction model between apps. See the bug for more details.

Test: atest libgui_test InputDispatcherDropInputFeatureTest
Bug:197364677

Merged-In: Ifcb4133306a43874e74e8fb0f42b60842daf6f25
Change-Id: Ifcb4133306a43874e74e8fb0f42b60842daf6f25
2021-09-20 23:22:31 +00:00
TreeHugger Robot
e3b6f72053 Merge "SurfaceView: Fix SurfaceControl synchronization issues" into sc-v2-dev am: bc617435cf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15819958

Change-Id: Ic87a3bcbbc888584c6ead7de2a8ee48b36854bb0
2021-09-20 23:08:03 +00:00
TreeHugger Robot
bc617435cf Merge "SurfaceView: Fix SurfaceControl synchronization issues" into sc-v2-dev 2021-09-20 22:59:15 +00:00
Pablo Gamito
dcf9fcfc42 Merge "Add API to specify background color for animations" into sc-qpr1-dev am: 14886c5085 am: bf8ed2a872 am: 0c0cf88818
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15836428

Change-Id: I91433509ccccc83297891eb553b12919fcfbc63e
2021-09-20 20:59:40 +00:00
Pablo Gamito
0c0cf88818 Merge "Add API to specify background color for animations" into sc-qpr1-dev am: 14886c5085 am: bf8ed2a872
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15836428

Change-Id: Ibe17e91bf2c847398db50f17248586fdc71ee9a7
2021-09-20 20:55:21 +00:00
Vishnu Nair
e2b63cb1f9 SurfaceControl: Add setDropInputMode api
Introduces an API to drop input events on this SurfaceControl. This
policy will be inherited by its children. The caller must hold the
ACCESS_SURFACE_FLINGER permission.

Options include:
ALL: SurfaceControl and its children will not receive any
input regardless of whether it has a valid input channel.
OBSCURED: SurfaceControl and its children will not
receive any input if the layer is obscured, cropped by its parent or
translucent.

These policies are used to enable features that allow for a less trusted
interaction model between apps. See the bug for more details.

Test: atest libgui_test InputDispatcherDropInputFeatureTest
Bug:197364677

Merged-In: Ifcb4133306a43874e74e8fb0f42b60842daf6f25
Change-Id: Ifcb4133306a43874e74e8fb0f42b60842daf6f25
2021-09-20 17:37:34 +00:00
Vishnu Nair
a3cd005f0f Merge "SurfaceControl: Add setDropInputMode api" 2021-09-20 17:33:07 +00:00
Pablo Gamito
2ccc829e71 Add API to specify background color for animations
To be used for new task transtion animations
(go/android-new-task-motion) to set a background color behind the
animations instead of showing the wallpaper.

Test: atest FlickerTests:TaskTransitionTest
Bug: 199507257
Change-Id: I7fabfdcaf90be63c11eb3b18d65259c620570cab
2021-09-20 19:30:17 +02:00
Mariia Sandrikova
bb3b0c9f87 Merge "[2/n] Display stack provides DisplayInfos" into sc-v2-dev am: c3c2b146d6 am: da40c46955
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15557290

Change-Id: I413dd6541f9628a710ce4bfe02d2a38a5e9cc1c8
2021-09-20 12:08:12 +00:00
Vishnu Nair
d100067fd6 SurfaceControl: Add setDropInputMode api
Introduces an API to drop input events on this SurfaceControl. This
policy will be inherited by its children. The caller must hold the
ACCESS_SURFACE_FLINGER permission.

Options include:
ALL: SurfaceControl and its children will not receive any
input regardless of whether it has a valid input channel.
OBSCURED: SurfaceControl and its children will not
receive any input if the layer is obscured, cropped by its parent or
translucent.

These policies are used to enable features that allow for a less trusted
interaction model between apps. See the bug for more details.

Test: atest libgui_test InputDispatcherDropInputFeatureTest
Bug:197364677

Change-Id: Ifcb4133306a43874e74e8fb0f42b60842daf6f25
2021-09-17 12:14:47 -07:00
Naomi Musgrave
aca03a172c [2/n] Display stack provides DisplayInfos
For all possible states a device can assume, the DisplayManagerService
provides the DisplayInfo associated with that layout of the logical
display. WindowManager applies each possible rotation to these
DisplayInfo. This, in turn, is used to calculate the possible max
WindowMetrics on the device.

Done:
* Display stack builds collection of DisplayInfo, for all
 possible display states (folded, unfolded on jumbo)
* Display stack pushing set of DisplayInfos to WindowManager
* WindowManager calculates max bounds for all possible
  (display layouts x rotations)

Not started:
* WindowManager calculates insets for each rotation

Bug: 181127261
Test: atest DeviceStateManagerGlobalTest
Test: atest DeviceStateManagerServiceTest
Test: atest LogicalDisplayMapperTest
Change-Id: I3a407262e755cb57c506b7255eb5c067523381d3
2021-09-17 14:56:33 +00:00
Kaiqiang Wang
76279d4147 Create Public API in AccessibilityManager to expose Audio description
enabled status.

1) Move ENABLE_ACCESSIBILITY_AUDIO_DESCRIPTION_BY_DEFAULT from
Settings.Global to Settings.Secure.
2) Add isAudioDescriptionEnabled public API to read the
Settings.Secure.ENABLED_ACCESSIBILITY_AUDIO_DESCRIPTION_BY_DEFAULT.

Test: local test
Test: atest AccessibilityManagerTest
Bug: 160823970
CTS-Coverage-Bug: 197311729
Change-Id: Iecf006bc8a1315414b37b6d644fc607b3d2aa03b
2021-09-16 23:26:21 +00:00
Yohei Yukawa
e8424ef600 Deprecate MissingMethodFlags to preserve invocation order
This CL effectively replaces my previous CL [1], which made
unimplemented methods in InputConnection not fatal errors, with a
simplified implementation that still gracefully take care of
unimplemented methods without causing app crashes.

Instead of propagating missing method information from the IME client
to the IME process, this CL will simply catch AbstractMethodError in
the IME client process.  Doing so enables us to

 1. preserve the strict invocation order of InputConnection APIs, and
 2. achieve the same goal with fewer lines of code.

The additional cost of throwing (and catching) AbstractMethodError
every time the IME calls an unimplemented InputConnection API can be
justified as it is really an exceptional scenario, and avoiding it
would require extra maintenance cost as seen in
InputConnectionInspector.

The above overhead (and complexity) due to AbstractMethodError can be
avoided by adding default implementations to those InputConnection
APIs, but doing so requires API signature update hence API council
approval to go ahead, which is to be discussed in Bug 199934664.

 [1]: I3c58fadd924fad72cb984f0c23d3099fd0295c64
      19a80a1e80

Bug: 27407234
Bug: 27642734
Bug: 27650039
Bug: 194110780
Test: atest CtsInputMethodTestCases
Change-Id: I9e801e92496a6e16cee37664870c97ed096f1413
2021-09-15 10:03:20 -07:00
Yunfan Chen
6911a5553f Merge "Make requested visibility available in snapshot starting window" into sc-v2-dev am: ca4709e72b am: 39002ce562
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15799656

Change-Id: If9ca745f47d51bb69840a70899f2ffff0442ddc2
2021-09-15 08:53:12 +00:00
Yunfan Chen
049e2a46aa Make requested visibility available in snapshot starting window
This change make the snapshot starting window holds the requested
visibilities when created from the task. Such that, when the window get
back from the background, the insets state in the window state can have
the correct visibilities.

Test: check getInsetsStateWithVisibilityOverride as described in the bug.
Bug: 196637509
Bug: 185729224
Change-Id: I54ab0791b169331c22cd89f7e6da640322bf7dd3
2021-09-15 06:28:09 +00:00
Charles Chen
37430c5ba8 [RESTRICT AUTOMERGE] Send DA's config directly when attaching to DA
WindowContext relies on WindowTokenClient#onConfigurationChanged after
calling WMS#attachWindowContextToDisplayArea.
However, it took some time to wait for onConfigurationChanged callback
from the server side so that we may get a stale value right after
creating WindowContext.
This confuses developers especially when the foreground activity is in
size compat mode or freeform because the process config is overridden
by activity's config.
This CL makes #attachWindowContextToDisplayArea return DA's configuration
and applies to WindowContext direcly.
It also benefits WindowProviderService because it can obtain DA's
 configuration before onCreate() based on [1] and this CL.

Bug: 190019118
Bug: 190745506
Bug: 198298520
Test: manual - 1. launch an Activity in size compat mode
               2. create a WindowContext and verify if WindowMetrics
                  matches DA bounds.
Test: atest WindowContextTest WindowContextTests
Test: atest WindowContextControllerTest ContextGetDisplayTest
[1]: dd4a748af0

Change-Id: I8dd3987b731662502bc01e9d2ed67e718ada5f46
2021-09-14 03:06:50 +00:00
Vishnu Nair
28ab86f0d4 SurfaceView: Fix SurfaceControl synchronization issues
Hold the surface control lock in PositionUpdateListener
callbacks before checking if the SurfaceControl will
be null. UI tread might release it after the checks
causing crashes.

Also fix a case where the ViewRootImpl may be null
in the positionChanged callback.

Bug: 199261027
Test: run steps in bug
Test: go/wm-smoke
Change-Id: I5a4cac35fe14356389b29268fddf9703b25c03aa
(cherry picked from commit 2cafd8b44d)
2021-09-13 17:21:06 +00:00
TreeHugger Robot
b14918c0f2 Merge "SurfaceView: Fix SurfaceControl synchronization issues" 2021-09-13 17:17:58 +00:00
Naomi Musgrave
0f7b150d6f Merge "[1/n] Introduce API for all available max WindowMetrics" into sc-v2-dev am: aca90d6d64 am: f8e8e36f93
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15557284

Change-Id: Ia04fdf1c680df6162c7768c98f66f9769ee7745d
2021-09-10 16:13:14 +00:00
Naomi Musgrave
aca90d6d64 Merge "[1/n] Introduce API for all available max WindowMetrics" into sc-v2-dev 2021-09-10 15:35:32 +00:00
Joanne Chung
06c8b28bff Merge "Allow translation should also work on non-resume state" into sc-v2-dev am: fb894242ba am: d9cc1370f2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15786469

Change-Id: I7dbebe2a073cc891d71d646de15fc1801828a807
2021-09-10 15:22:59 +00:00
Joanne Chung
fb894242ba Merge "Allow translation should also work on non-resume state" into sc-v2-dev 2021-09-10 14:51:45 +00:00
Naomi Musgrave
f70f8ecefc [1/n] Introduce API for all available max WindowMetrics
New API provides all maximum WindowMetrics, for all
possible rotations in each DeviceState. This information
allows launcher apps to determine different device
layouts ahead of time, without having to reload the
grid model on every device state change (fold/unfold).

Done:
* WindowManager calculates bounds for the given display, in
  possible rotations
* Defining API surface

Not started:
* WindowManager calculates insets for each rotation
* Display stack builds collection of DisplayInfo, for all
  possible display states (folded, unfolded)
* Display stack pushing set of DisplayInfos to WindowManager

Bug: 181127261
Test: atest FrameworksCoreTests:WindowMetricsTest
Test: atest FrameworksCoreTests:WindowInsetsTest
Change-Id: Ic4580f9c1ee919e5e93cd96b8f11c743fa42f9f1
2021-09-10 09:53:49 +01:00
Naomi Musgrave
d3fc9072c6 Merge "[1/n] Introduce API for all available max WindowMetrics" 2021-09-10 08:38:01 +00:00
Kriti Dang
ca2b154112 Merge "Default resolution settings [Backend]" 2021-09-10 07:31:02 +00:00
Vishnu Nair
2cafd8b44d SurfaceView: Fix SurfaceControl synchronization issues
Hold the surface control lock in PositionUpdateListener
callbacks before checking if the SurfaceControl will
be null. UI tread might release it after the checks
causing crashes.

Also fix a case where the ViewRootImpl may be null
in the positionChanged callback.

Bug: 199261027
Test: run steps in bug
Test: go/wm-smoke
Change-Id: I5a4cac35fe14356389b29268fddf9703b25c03aa
2021-09-09 19:57:24 -07:00
Adam He
e6664abbc8 Merge "Fill in javadocs for translation feature." into sc-dev am: 1553fc7fad am: 4b02f45293
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15597859

Change-Id: I538dd665f0f322cfe01ce79d83f1fde064749329
2021-09-09 16:23:06 +00:00
Sally Yuen
2b00db99b0 Merge "Add API to inform the system a drag is initiated by an A11yAction#ACTION_DRAG_START." into sc-v2-dev am: cd9481d29a am: 19813a5ded
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15787312

Change-Id: If2949fc7d22534e0f0a600ee5c3ec3b4765d0b83
2021-09-09 16:18:43 +00:00
Adam He
4b02f45293 Merge "Fill in javadocs for translation feature." into sc-dev am: 1553fc7fad
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15597859

Change-Id: I214790439c5b6520131cf8a9f03a255ebe16421f
2021-09-09 16:04:28 +00:00
Sally Yuen
19813a5ded Merge "Add API to inform the system a drag is initiated by an A11yAction#ACTION_DRAG_START." into sc-v2-dev am: cd9481d29a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15787312

Change-Id: I0ef3dc0af15c1ec3b266401c5246c2f2a92f7a5b
2021-09-09 15:58:05 +00:00
Sally Yuen
cd9481d29a Merge "Add API to inform the system a drag is initiated by an A11yAction#ACTION_DRAG_START." into sc-v2-dev 2021-09-09 15:57:38 +00:00
Kriti Dang
ccc7d4bd37 Default resolution settings [Backend]
Added new APIs to DisplayManager to:
1. set the user preferred display mode,
2. clear user preferred display mode and
3. wheteher user has chosen a display mode

These new settings are stored in Settings.Global.

Bug: 192332479
Test: atest DefaultDisplayModeTest
Test: atest LocalDisplayAdapterTest
Change-Id: I3a60e271c7ec23c84e74487e89b3e29ca91e8a40
2021-09-09 14:58:04 +02:00
Naomi Musgrave
65fe74c166 [1/n] Introduce API for all available max WindowMetrics
New API provides all maximum WindowMetrics, for all
possible rotations in each DeviceState. This information
allows launcher apps to determine different device
layouts ahead of time, without having to reload the
grid model on every device state change (fold/unfold).

Done:
* WindowManager calculates bounds for the given display, in
  possible rotations
* Defining API surface

Not started:
* WindowManager calculates insets for each rotation
* Display stack builds collection of DisplayInfo, for all
  possible display states (folded, unfolded)
* Display stack pushing set of DisplayInfos to WindowManager

Bug: 181127261
Test: atest FrameworksCoreTests:WindowMetricsTest
Test: atest FrameworksCoreTests:WindowInsetsTest
Change-Id: Ic4580f9c1ee919e5e93cd96b8f11c743fa42f9f1
2021-09-09 12:36:25 +00:00
Adam He
4e3a00abbc Merge "Fill in javadocs for translation feature." into sc-dev am: 1553fc7fad am: 44ef83555f am: c6caf136f5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15597859

Change-Id: If47d2f678466ccf67feed85d21f15090d5608d56
2021-09-08 20:36:55 +00:00
Adam He
c6caf136f5 Merge "Fill in javadocs for translation feature." into sc-dev am: 1553fc7fad am: 44ef83555f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15597859

Change-Id: Ie250391bba22fb83b0ca02ecc099f57c7a8fa7d7
2021-09-08 20:18:29 +00:00
Adam He
1ee68ced5b Merge "Fill in javadocs for translation feature." into sc-dev am: 1553fc7fad am: ed877ee1ac
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15597859

Change-Id: I9ab6500fa6c8c64ca1c14383dbf1bb7b2a64f909
2021-09-08 20:18:06 +00:00
sallyyuen
5d00ad6e13 Add API to inform the system a drag is initiated by an
A11yAction#ACTION_DRAG_START.

This allows the system to run a11y-specific code
and still accept drags via touch events when a11y is
enabled.

Test: builds
Bug: 26871588
Change-Id: I40e8f1adf5b773c8fa02173cbd96aa5e9ed54a4d
2021-09-08 12:19:36 -07:00