Commit Graph

16518 Commits

Author SHA1 Message Date
Wilson Wu
3e0705d6e8 Merge "Prevent addtional removeSurface calls" into sc-dev 2021-04-22 07:41:49 +00:00
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
Tiger Huang
755cd83f49 Merge "Stop processing if the new control equals the current one" into sc-dev 2021-04-22 04:23:38 +00:00
Treehugger Robot
1bff978184 Merge "Fix grammatical error in LayoutAnimationController documentation." am: 84fdb3b19f am: 07a7231bc8 am: 1c166fa20d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1680106

Change-Id: I7be25e32f785c30b21d8b286be38c8907524b9dd
2021-04-21 23:50:20 +00:00
Treehugger Robot
1c166fa20d Merge "Fix grammatical error in LayoutAnimationController documentation." am: 84fdb3b19f am: 07a7231bc8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1680106

Change-Id: I456c07ee5beeceb6d9581ed2dc0313f4ba9fadd1
2021-04-21 23:07:23 +00:00
Rob Carr
c2d41154f0 Merge "View: Expose gatherTransparentRegion" into sc-dev 2021-04-21 22:18:11 +00:00
Sally Yuen
93595946da Merge "Add prefetch result to a11y tracing" into sc-dev 2021-04-21 22:02:07 +00:00
Adam He
528059b7be Merge "API feedback: change language from String to ULocale." into sc-dev 2021-04-21 20:44:02 +00: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
Adam He
e565d31bce API feedback: change language from String to ULocale.
Bug: 176208267
Bug: 184685163
Test: atest CtsTranslationTestCases
Change-Id: I10310f4980d4b9d869eb76542e0327420ad2f9de
2021-04-20 18:23:13 -07: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
Robert Carr
354c56590e View: Expose gatherTransparentRegion
Recently exposed ViewRoot API requires requestTransparentRegion for
many of the use cases we want to support. requestTransparentRegion is
already public API, however the documentation and definition is a little
confusing and arguably it shouldn't do anything unless we also implement
gatherTransparentRegion. gatherTransparentRegion is already made public
through SurfaceView, and so exposing it properly on View seems like
a non disruptive option.

Bug: 179647628
Test: android.view.cts.ViewRootSyncTest
Change-Id: I72fb2744bc03cdd26d64547dbebeb12751a33a2a
2021-04-20 15:38:26 -07:00
Sally
3e5df20043 Add prefetch result to a11y tracing
Test: callback appears in trace
Bug: 157601519
Change-Id: I65c8dd1fa5c33c84c873ffa7b6d772395d0adbdb
2021-04-20 22:06:05 +00:00
TreeHugger Robot
32e08f8b0d Merge "Revert^2 "Introduce SpellCheckerSessionParams."" into sc-dev 2021-04-20 16:45:50 +00:00
Megan Robinson
063e1c8f2b Fix grammatical error in LayoutAnimationController documentation.
Change-Id: I274079b932154fa61ebe64a7e0ed0dc1feb089cc
2021-04-20 16:26:43 +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
Tiger Huang
55581522ea Stop processing if the new control equals the current one
InsetsSourceConsumer#setControl compares the identities between the new
control and current one. If they are the same, the function stops
processing. However, the instance of the control returned from relayout
will always be different, which makes setControl process more than
expected.

This CL overrides InsetsSourceControl#equals, and use it to decide if we
should do further processing in setControl.

Bug: 185193241
Fix: 185460364
Test: steps in the bug
Change-Id: If347df353202ef441b57dabccfd0ef254ec72477
2021-04-19 15:33:10 +08: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