Commit Graph

16506 Commits

Author SHA1 Message Date
Wilson Wu
08f5b9c846 Prevent addtional removeSurface calls
The surface may not be cleared by its owner when
it lose control last time. We had CL[1] to clean
up the surface if we don't plan to show.

Add new checking condition for last control, so
once we have control we only remove the surface
if last control was null.

[1]: I4910c2a06cc67b0470477b245fc1de54b75f10f9

Bug: 185557884
Test: atest InsetsSourceConsumerTest
Change-Id: I1a4f05f9b4cf6fa121554ff0abc9fdc418b95276
2021-04-22 12:46:35 +08:00
Joanne Chung
6b0cff16cf Merge "Update javadoc for ViewTranslationRequest.Builder for virtual view." into sc-dev 2021-04-21 11:22:30 +00:00
Mathew Inwood
f715fddd3c Merge "API changes as requested by API council." into sc-dev 2021-04-21 08:40:16 +00:00
Joanne Chung
e847921bea Update javadoc for ViewTranslationRequest.Builder for virtual view.
Bug: 185273314
Test: n/a. Only update javadoc.
Change-Id: I63b0115184113b1a85833408a61859b7c3d55713
2021-04-21 14:19:18 +08:00
Rob Carr
79f15c60f3 Merge "SurfaceControl: Fix builder" into sc-dev 2021-04-21 05:22:27 +00:00
Yanchao Su
2e2e479ef1 Merge "fix bug 184901520." into sc-dev 2021-04-21 01:44:08 +00:00
TreeHugger Robot
51f7357af1 Merge "Add back deprecated Translator.translate() method" into sc-dev 2021-04-21 00:57:08 +00:00
Joanne Chung
497dadea9c Merge "Remove the deprecated APIs in UiTranslationManager." into sc-dev 2021-04-21 00:48:53 +00:00
Joanne Chung
be20ca46f6 Merge "API feedback: Translation View API refinement." into sc-dev 2021-04-21 00:29:24 +00:00
Adam He
1c3372f37d Merge "Remove onError from translationResultCallback." into sc-dev 2021-04-21 00:26:34 +00:00
Winson Chung
839b9a1147 Merge "Skip some unnecessary allocations" into sc-dev 2021-04-21 00:17:01 +00:00
Robert Carr
c3d4925a04 SurfaceControl: Fix builder
Recently introduced check for isBufferQueueLayer doesn't work
because the FX_SURFACE_NORMAL flag is 0x0 not 0x1 as expected.

Bug: 185941687
Test: Existing tests pass
Change-Id: I1b341bffcd8b0f0c0e7f2e3da27cb201b6e1d6ff
2021-04-20 16:50:58 -07:00
Adam He
f187b6dc51 Add back deprecated Translator.translate() method
* Deprecatede method was @hide hidden by mistake.

Bug: 185793893
Test: atest CtsTranslationTestCases
Change-Id: I6acfcf866d926d5efd5baf3f711d9906dd95a34e
2021-04-20 15:59:44 -07:00
TreeHugger Robot
32e08f8b0d Merge "Revert^2 "Introduce SpellCheckerSessionParams."" into sc-dev 2021-04-20 16:45:50 +00:00
Mark Renouf
4b45c3601b Merge "Account for padding in dispatchScrollCaptureSearch" into sc-dev 2021-04-20 16:09:14 +00:00
Kohsuke Yatoh
d4e3278b3e Revert^2 "Introduce SpellCheckerSessionParams."
Updated test added in commit 7000b5f89d8c43af5ccd116c1840ea89dd9f17dc

Bug: 179804789
Change-Id: I48c744815662cabcbef8e823916b1e6bba9c9b17
2021-04-20 14:28:56 +00:00
Joanne Chung
108cec2f17 Remove the deprecated APIs in UiTranslationManager.
We introduced some APIs for initial demo but we dropped these APIs.
To avoid to break the client app, we keep the API until the client
moves to new APIs. It's ok to delete these API now.

Bug: 185448758
Test: manual
Test: atest android.translation.cts.UiTranslationManagerTest

Change-Id: I5ea71d4658246f52610e1f62412d60c6c58bb31e
2021-04-20 14:00:36 +00:00
Jeff DeCew
eba7be7876 Merge "CallStyle actions have minimum width" into sc-dev 2021-04-20 13:46:14 +00:00
TreeHugger Robot
9ab42eb145 Merge "Enforce mutual exclusivity in setScrollCaptureHint" into sc-dev 2021-04-20 13:20:13 +00:00
Tiger Huang
dcb0bfbe1d Merge "Clear controls in the temp list after using them" into sc-dev 2021-04-20 13:05:07 +00:00
TreeHugger Robot
3980454a74 Merge "Bugfix: Make InsetsController dump() respect prefix" into sc-dev 2021-04-20 12:51:55 +00:00
TreeHugger Robot
6309cca5d9 Merge "ContentCapture: Log the text length for VIEW_APPEARED events." into sc-dev 2021-04-20 06:52:18 +00:00
Ahaan Ugale
6f4ace91fd ContentCapture: Log the text length for VIEW_APPEARED events.
Helps for matching logs to screen contents while debugging.

Bug: 177687849
Test: manual
Change-Id: Id7e43034843f65f36c9030278728d27ec4f27168
2021-04-19 22:08:54 -07:00
Yi-yo Chiang
ea80476aa4 Merge "Revert "Introduce SpellCheckerSessionParams."" into sc-dev 2021-04-20 04:41:45 +00:00
Yi-yo Chiang
cef2817d90 Revert "Introduce SpellCheckerSessionParams."
Revert "Use SpellCheckerSessionParams in CTS."

Revert submission 14191185-ky-tsm

Reason for revert: breaks build test_suites_x86_64 b/185855437
Reverted Changes:
I724aaad15:Introduce SpellCheckerSessionParams.
I510a4cfec:Use SpellCheckerSessionParams in CTS.

Change-Id: I4173bd5bee62f02a248de69df77420c39326b9f0
2021-04-20 03:57:05 +00:00
Joanne Chung
f6a52811a1 API feedback: Translation View API refinement.
Bug: 178046780
Test: manual
Test: atest android.translation.cts.UiTranslationManagerTest
CTS-Coverage-Bug: 177960696

Change-Id: I557ca4b3b4e7324af12e81dd8b5ac8a04a17b6b8
2021-04-20 11:14:22 +08:00
Kohsuke Yatoh
93528b8f5b Merge "Introduce SpellCheckerSessionParams." into sc-dev 2021-04-20 03:06:40 +00:00
TreeHugger Robot
e354625105 Merge "Rename destSpecs to targetSpecs" into sc-dev 2021-04-20 01:21:06 +00:00
Rob Carr
00019e2e56 Merge "SurfaceFlinger: Prepare to remove BufferQueueLayer" into sc-dev 2021-04-20 00:42:30 +00:00
Chavi Weingarten
8570e52d00 Merge "Updated DisplayHash APIs" into sc-dev 2021-04-19 16:30:45 +00:00
Tiger Huang
88ae86be6b Clear controls in the temp list after using them
The list would be cleared while next time we use them, so it could
constantly occupy the memory. This CL clears the temp list right after
we use the controls. So it won't occupy the memory while they are not
being used.

This CL also sends a new list to the app when dispatching the insets
animation progress. In this way, we don't need to clear mTmpRunningAnims
after dispatching it. Also, the app might use the animation list AFTER
the 'onProgress' callback. This change can make the list stay the same.

Fix: 183684434
Test: Use Android Memory Profiler to check if there is
      InsetsAnimationControlImpl or WindowInsetsAnimation instances
      after GCing after playing insets animation in Launcher.
Change-Id: I781233abb2c9c8400c6f76b537bef161745e67f7
2021-04-20 00:13:55 +08:00
Mathew Inwood
c89513ac27 API changes as requested by API council.
Bug: 183512729
Test: m
Merged-In: Ie465c49ff02065e78a2e8e211a13350a0ff7f0a4
Change-Id: Ie465c49ff02065e78a2e8e211a13350a0ff7f0a4
2021-04-19 14:02:52 +00:00
Ahaan Ugale
1281143a36 Merge "AutoTranslate: Pad view text for compatibility reasons." into sc-dev 2021-04-19 05:19:53 +00:00
Huihong Luo
81d78b91f9 Merge "Webview overlay support" into sc-dev 2021-04-19 04:45:52 +00:00
Mark Hansen
89a5375d83 Bugfix: Make InsetsController dump() respect prefix
Before, the prefix was printed on a blank line above InsetsController, this wasn't intended.

BUG=140002885

Change-Id: Ife14e60400dc73232302a797b6b9b8f4d201535f
2021-04-18 23:51:58 +00:00
Kohsuke Yatoh
94635fcb89 Introduce SpellCheckerSessionParams.
SpellCheckerSessionParams encapsulates parameters for
TextServicesManager#newSpellCheckerSession().

Bug: 179804789
Test: atest CtsInputMethodTestCases:SpellCheckerTest
Change-Id: I724aaad15b0a4bd38f6a24585c4c45cfeee5b499
2021-04-17 22:49:25 +00:00
Huihong Luo
054b8d3000 Webview overlay support
The basic idea is to create a child surface control from the root surface control passed from ViewRootImpl to the render thread.

Transactions are sent back to the java layer to get merged.

In case of offscreen layers, SurfaceControl must be disabled.

This new feature is disabled for Vulkan at the moment, a new CL will be used to enable the support.

Bug: 173671170
Test: manual, webview apks
Change-Id: I119405d13eca3c59fd3ec78e50dc7739f78411d4
2021-04-17 13:24:48 -07:00
Ahaan Ugale
7110641881 AutoTranslate: Pad view text for compatibility reasons.
Some apps operate on the view text based on layout calculations made on
the transformed text. This can cause issues (even crashes) if the
transformed text is longer than the original, as is often the case with
Translate. A previous temporary fix,
I685ae4a9752c817db81f0d736f1d746b2e4a9839, ellipsized the translated
text. This change fixes it properly by instead padding the original
text.

A followup change will make this controllable by API instead of padding
every TextView.

The en space character, U+2002, is used for the padding here. It seems
to work well in practice for multiple languages. We don't make this
configurable through API as it could make debugging harder (issues
triggered by server-side changes).

Bug: 179693024
Test: atest CtsTranslationTestCases
Test: manual - toggling between original and translated, scrolling, new
 views appearing, multiple apps
Change-Id: I9d7db5d2bc200e4042baf3267796f00cfc298f19
2021-04-16 19:38:28 -07:00
TreeHugger Robot
ad6ad26441 Merge "Add a test api for checking if system supports TaskSnapshot" into sc-dev 2021-04-16 23:25:12 +00:00
Mark Renouf
c14734d865 Account for padding in dispatchScrollCaptureSearch
When dispatching to self, ViewGroup is  not applying padding
to localVisibleRect, only when dispatching to child views.

Also when deducting padding from the visible bounds,
it must be intersected with bounds, not subtracted.

Test: atest ViewGroupScrollCaptureTest
Bug: 185153400
Change-Id: Ib92e4c552fbe02fd863123f166878e19b8b1c952
2021-04-16 17:01:27 -04:00
Adam He
7ae022ade8 Merge "Add cancellationSignal to the Translator#translate() api." into sc-dev 2021-04-16 20:58:59 +00:00
Jeff DeCew
24220aae09 CallStyle actions have minimum width
This ensures that the major action buttons have a minimum visual emphasis in the layout.

Bug: 179178086
Test: manual
Change-Id: I58744ada45d789a9acb53b0f4965354835595b19
2021-04-16 13:08:40 -04:00
Mark Renouf
c86a84fd9e Enforce mutual exclusivity in setScrollCaptureHint
This change causes HINT_EXCLUDE to take precedence
over HINT_INLUDE when both are present.

Test: atest ViewGroupScrollCaptureTest
Bug: 184370898
Change-Id: Ie4779067c3db82c65816dc4a5129badf74b3c9b4
2021-04-16 17:01:10 +00:00
Mark Renouf
3a37c9ea0b Merge "Update Javadoc method references" into sc-dev 2021-04-16 16:47:59 +00:00
Winson Chung
e5b567749e Skip some unnecessary allocations
- Move new matrix/rect construction to if the param is set on the
  builder, we only apply the params if the flags are set anyways
  and if the caller doesn't set those params then we are allocating
  new objects unnecessarily
- Always recycle motion event

Bug: 183756396
Test: Take memory profile when dragging pip
Change-Id: Ie7457c8c508ee61bd27daeebe486c39a5cebe7d7
2021-04-15 22:53:02 -07:00
TreeHugger Robot
c9eaa3d80f Merge "Rename IInputMethodManager#reportPerceptible" into sc-dev 2021-04-16 05:14:30 +00:00
Ming-Shin Lu
c8e411fd1f Add a test api for checking if system supports TaskSnapshot
Use this test api to make sure testing
KeyboardVisibilityControlTest#testRestoreImeVisibility_.* that
requires the system supporting TaskSnapshot mechanism, otherwise skip
the test when the system doesn't support it.

Bug: 184978234
Test: m checkapi & atest KeyboardVisibilityControlTest
Change-Id: I777053aeeb6a2734a4bbd37711cf56ced41c1bd9
2021-04-16 11:37:52 +08:00
Robert Carr
660a6679d9 SurfaceFlinger: Prepare to remove BufferQueueLayer
To prepare to remove BufferQueueLayer we port over the public Java API
(getSurface) and a few remaining clients (largely tests), by returning
a BBQ from getSurface.

Bug: 185492007
Test: Existing tests pass
Change-Id: I5c59dc5785333c543ef9f5e70faafab5da110bbd
2021-04-16 03:02:15 +00:00
Chavi Weingarten
d6ea380f13 Merge "Use BLAST layer for screen rotation, surface freezer, and organizer" into sc-dev 2021-04-16 00:30:11 +00:00
Mark Renouf
d389165bd6 Merge changes I3a11ac86,I84e0b1fd into sc-dev
* changes:
  ScrollCaptureConnection: fix npe on close() when active
  Scroll Capture: Add configurable post-scroll capture delay
2021-04-15 19:19:27 +00:00