Commit Graph

8973 Commits

Author SHA1 Message Date
Vishnu Nair
f752c800d3 Fix Magnifier position updates
When the magnifier content moves relative to the parent surface,
it will call setPosition on the content surface control. This conflicts
with position updates called by the BlastBufferQueue adapter
causing a flicker on screen. Fix this by providing a wrapper surface
to BlastBufferQueue adapater to send buffer updates.

Fixes: 186072574
Test: Select text and see magnifier surface does not flicker or move
around

Change-Id: Idfcc06a5d90f400f69e5cbe91008a0cb59fd4646
2021-04-26 10:27:50 -07:00
Jeff DeCew
5e7b103e14 Merge "Allow passing 0 to RemoteViews.setDimen() or setAttr()" into sc-dev 2021-04-20 13:44:38 +00:00
TreeHugger Robot
6ba89099f8 Merge "Ensure that the root view is an AppWidgetHostView in setRemoteAdapter" into sc-dev 2021-04-20 11:33:59 +00: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
Kohsuke Yatoh
93528b8f5b Merge "Introduce SpellCheckerSessionParams." into sc-dev 2021-04-20 03:06:40 +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
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
Jeff DeCew
208b1b1b69 Allow passing 0 to RemoteViews.setDimen() or setAttr()
Bug: 185488522
Test: atest RemoteViewsTest
Change-Id: I535e44a431701e68edcfaf527e326fd0e769b16a
2021-04-16 13:08:40 -04:00
Stevie Kideckel
fb2df70041 Ensure that the root view is an AppWidgetHostView in setRemoteAdapter
Bug: 185367016
Test: atest RemoteViewsFixedCollectionAdapterTest

Change-Id: I77d866157e97c4507243dbc2cd5411384f885458
2021-04-16 10:03:06 +00:00
Michel Comin Escude
219106593d Merge "Fixed and decreased isAtEquilibrium thresholds" into sc-dev 2021-04-14 18:03:18 +00:00
Joanne Chung
bef7481684 Merge "Add debug log to help to debug translation problem." into sc-dev 2021-04-14 16:27:31 +00:00
Michel Comin Escude
0ca911f5f8 Added velocity scalar and updated spring values
Updated spring values to the latest ones agreed in design. In addition,
added a velocity multiplier that only affects after it absorbs an impact
at the scroll boundary. This will help to increase the spring behavior
when we fling the content, but keeping it controlled when we pull and
release.

Bug: 183768138
Test: ran EdgeEffectTest and visual
Change-Id: I4ed7b01dd42a9a5adda637917369c349a6ae2f76
2021-04-14 03:07:53 +00:00
Michel Comin Escude
0c81801f9e Fixed and decreased isAtEquilibrium thresholds
Distance and speed were multiplied by LINEAR_STRETCH_INTENSITY which is
not directly related to speed and and distance. Moreover the velocity
threshold was a little bit high (1/0.016, wich means 62 pixels/second)
and the distance as well (1 is ok if there's no scale but since there's
some stretching the difference was being magnified).

Bug: 184892316
Test: EdgeEffectTests and visual
Change-Id: Ibd7adb16d1d00df0ab6e96132bfe96a4fa4d45dc
2021-04-13 18:50:22 -07:00
Nader Jawad
e178f50356 Merge "Adjusted interpolation and stretch intensity" into sc-dev 2021-04-13 22:11:11 +00:00
Michel Comin Escude
9ed86141f2 Adjusted interpolation and stretch intensity
Updated stretch intensity to 0.016 and added a new uniform to control
the intensity of the interpoloation

Bug: 183768138
Test: ran EdgeEffectTest and visual
Change-Id: Iac10bee5980802fffe838ed83e02b7c41dee6f71
2021-04-13 12:30:51 -07:00
Pierre Barbier de Reuille
bc9e66e108 Merge "Add attribute setters for RemoteViews" into sc-dev 2021-04-13 17:10:24 +00:00
Pierre Barbier de Reuille
11d243e01c Add attribute setters for RemoteViews
This implements go/remoteviews-attribute-setters

Bug: 184931139
Test: atest CtsWidgetTestCases:RemoteViewsTest
Change-Id: I135ab857d3a3a52bbb02ee3226e2bf723d8c916a
2021-04-13 09:49:34 +01:00
Joanne Chung
8960d6667b Add debug log to help to debug translation problem.
There are some issues the resume/finish seems not work well. The
debug flag should be enabled manually, but in the most time the
user may forget to enable it before testing. Try to enable it in the
debug rom to help debugging, we use b/182433547 to trace the disable
this check before rom release.

Bug: 182433547
Test: manual
Change-Id: I2f85a0e17f8a2b8a4b93252044cf48d739b4eca2
2021-04-13 13:58:03 +08:00
Ahaan Ugale
44dccdbe1a Merge "Fix UiTranslation for ListView." into sc-dev 2021-04-13 02:11:07 +00:00
Nader Jawad
93ea53bbe2 Merge "Fixed issue with invalid stretch params" into sc-dev 2021-04-13 01:29:31 +00:00
Nader Jawad
0a458ab55a Fixed issue with invalid stretch params
Refactored error checking logic to ignore
all invalid parameters for vecX/vecY
regardless if NaN parameters were
computed through intermediate math
operations or provided as inputs

Fixes: 183781985
Test: Added CTS test
Change-Id: Ib9f3dd1becc0486dc15ce306660bd5d469b81256
2021-04-12 14:51:02 -07:00
TreeHugger Robot
c66db32d3b Merge "Fix consumption multiplier" into sc-dev 2021-04-12 18:08:52 +00:00
Rob Carr
88a1e89a3f Merge "Port magnifier widget to BLAST" into sc-dev 2021-04-09 21:55:11 +00:00
TreeHugger Robot
3e6905a8aa Merge "Fix magnifier appearing unexpectedly on scroll" into sc-dev 2021-04-09 21:39:56 +00:00
Mihai Popa
08093739f1 Fix magnifier appearing unexpectedly on scroll
Fixes: b/183057391
Test: manual testing
Change-Id: Iecd67be64084f52f26bf471c91bde3ba3f2b5c64
2021-04-09 16:11:51 +00:00
Robert Carr
fcdbf71fe6 Port magnifier widget to BLAST
It is one of the last users of deferTransactionUntil which we
are hoping to remove in the server (and gain some CPU usage wins
in the process).

Bug: 168505645
Test: Existing tests pass
Change-Id: I2ba66caf7b0eaf2ed7d4fe896d7dc58f57c6e37f
2021-04-08 20:12:26 -07:00
Stevie Kideckel
c134d8fac3 Apply tints when setting dial/hands to icons
Bug: 184731376
Test: local testing with sample app
Change-Id: Ib7c1aeaec6f805e93b9a731bc2d34e2182243ae1
2021-04-08 15:18:33 +00:00
Pierre Barbier de Reuille
2837eab16b Replace RemoteViews#setViewId with a constructor
This is a request of the API Council.

There was a hidden and, AFAICT, un-used constructor with the same
signature, which I have removed. Before replacing the constructor I
checked the whole OS builds and run with the constructor simply removed.

Fix: 182824754
Test: atest CtsWidgetTestCases:RemoteViewsRecyclingTest
Test: atest CtsWidgetTestCases:RemoteViewsTest
Change-Id: I0f12d2fa520cf4f0d54a7e3859337cc9a395ae66
2021-04-07 13:17:19 +01:00
Ahaan Ugale
d3ef775737 Fix UiTranslation for ListView.
There are 2 changes:
* When a view is scrapped, Autofill IDs in its subtree are reset. This
prevents flaky behavior like translating the wrong views when events are
ordered a certain way.
* Views that are being translated are marked as having transient state
since the system needs to attach the response to it later as well as
deliver UI Translation state changes to it.

Bug: 182491706
Test: atest CtsTranslationTestCases
Test: atest CtsContentCaptureServiceTestCases
Test: atest CtsAutoFillServiceTestCases
Test: manual - check in logs that autofill ids aren't reused on
 scrolling or new views appearing
Test: manual - translated views stay translated while on the screen
 when other views are scrolled off the screen
Test: manual - translated views stay translated when new views appear
Change-Id: I20a52415e3fd191768442d70614d536e11633dfa
2021-04-02 23:19:55 -07:00
TreeHugger Robot
c5f71969ab Merge "Fixed NaN exceptions in EdgeEffect" into sc-dev 2021-04-03 02:08:09 +00:00
George Mount
fc14e37a8b Fix consumption multiplier
Bug: 184392385

The pull consumption should be related to the width, not the height.

Test: Ran ApiDemos and result is vastly improved
Change-Id: I19e1262c42b4b85920e5038a789e2e934569cac3
2021-04-02 23:18:00 +00:00
Nader Jawad
3a0b122b8d Fixed NaN exceptions in EdgeEffect
Added more error checking logic to
protect against invalid usages of EdgeEffect
that include setSize not being called or
invalid bounds parameters.

Fixes: 183945458
Fixes: 183895581
Fixes: 183781985
Test: Added CTS test to EdgeEffectTests
Change-Id: I1eabd96206216526dbe843d0fb8c0fe6cccd8395
2021-04-02 12:20:20 -07:00
Alan Viverette
5c15f94f79 Merge "FIx issue: https://issuetracker.google.com/issues/183024999" am: 2e1c97a4e8 am: 095c053c3f am: 9ee35481d1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645426

Change-Id: Idba06d2713407fff424eecf503066f902bee0924
2021-03-31 23:28:57 +00:00
Alan Viverette
9ee35481d1 Merge "FIx issue: https://issuetracker.google.com/issues/183024999" am: 2e1c97a4e8 am: 095c053c3f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645426

Change-Id: I624bd5a9fcecf731c34d80930a4593e10e390f5a
2021-03-31 22:43:01 +00:00
Seigo Nonaka
0b8ee8ecc3 Merge "Override isRestricted for preventing unexpected resource loading" into rvc-qpr-dev am: 39c49f8daa
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13855846

Change-Id: If44737735289f45e9cc30fc3c9498e591b479fa3
2021-03-31 22:40:50 +00:00
Nikita Dubrovsky
2bb75a4007 Merge "Rename getOnReceiveContentMimeTypes (drop "On")" into sc-dev 2021-03-31 21:06:21 +00:00
Sunny Goyal
b94b6a18a3 Merge "Fixing Spline parameters when changing duration/position of Overscroller" into sc-dev 2021-03-30 20:14:56 +00:00
Sunny Goyal
98d4e403cd Fixing Spline parameters when changing duration/position of Overscroller
> This allows the scroller to be used in Launcher3 instead of a custom copy

Bug: 183966408
Test: Verified with Launcher3
Change-Id: I1c945774d0323fabcf4bfd5a02c2eaf8e95a218d
2021-03-30 09:49:00 -07:00
Pierre Barbier de Reuille
e65f50862d Merge "Update the description of RemoteViews#setViewId" into sc-dev 2021-03-30 15:10:14 +00:00
Nikita Dubrovsky
85826befae Merge "OnReceiveContentListener: Handle IME insertion permissions release" into sc-dev 2021-03-30 14:10:21 +00:00
Pierre Barbier de Reuille
521e9648f8 Update the description of RemoteViews#setViewId
This is a request of the API Council (see bug for justification).

Fix: 182824754
Test: N/A
Change-Id: I82e373272c3e2261b7f42f59eb37b10c487ce55e
2021-03-30 12:54:10 +01:00
Nikita Dubrovsky
f3ebaed6e4 Rename getOnReceiveContentMimeTypes (drop "On")
Bug: 179143943
Test: Presubmit
Change-Id: Ib2109f0a45c25ae6c4507a9199bf8b34fc394af5
2021-03-26 10:48:58 -07:00
Joanne Chung
f51da99ac1 Implement dispatchRequestTranslation for getting translation information.
This change doesn't contain the virtual view part and the API, it
will be done in the next change.

Bug: 178046780
Test: manual
Test: atest CtsTranslationTestCases
CTS-Coverage-Bug: 177960696

Change-Id: Idba66a882a90168ecdd93423c0d5d054ab040dad
2021-03-25 22:31:54 -07:00
Nikita Dubrovsky
10646dff7e OnReceiveContentListener: Handle IME insertion permissions release
For content insertion from the IME, the platform currently assumes
that it can automatically revoke URI permissions (via
InputContentUriTokenHandler.finalize) any time after the
InputContentInfo instance is garbage collected and
InputContentInfo.releasePermission() has not been called explicitly.
This can cause permissions to be revoked before the receiving code
has had a chance to read the content when using
OnReceiveContentListener, since we did not keep a reference to
InputContentInfo.

This change does the following:
* Sets the InputContentInfo instance in the ContentInfo payload passed
to OnReceiveContentListener.
* Exposes a hidden API on ContentInfo to allow system features to
proactively release permissions for sources that allow this (IME and
drag-and-drop).
* Updates notifications direct-reply code to proactively release
permissions as soon as they are no longer needed.

Bug: 183643556
Test: Manual
Change-Id: I1cbc55d53804810a3cd4b6b97c197f4dd2d7d8e6
2021-03-25 09:37:21 -07:00
Qi Wang
590d6a9d48 Merge "Fix the SuggestionSpan overwrite logic." into sc-dev 2021-03-25 15:09:59 +00:00
Joanne Chung
b6a9530dc1 Merge "Update View translation APIs." into sc-dev 2021-03-25 14:31:40 +00:00
Joanne Chung
a749f2aadb Update View translation APIs.
This change doesn't contain the virtual view part and the API
dispatchTranslationRequests, it will be done in another change.

Bug: 178046780
Test: manual
Test: atest CtsTranslationTestCases
CTS-Coverage-Bug: 177960696

Change-Id: I65fe1db19c9dff21c0caca425fbb7d08559e730b
2021-03-25 15:28:13 +08:00
Qi Wang
7e821f0539 Fix the SuggestionSpan overwrite logic.
Previously, the SpellChecker use the start and end positions as the key
to maintain the SuggestionSpan cache.

However, the actual start/end position of the SuggestionSpan may changes
when the text is changed. Hence we may not be able to find the
corresponding SuggestonSpan for a new suggestion with the changed
start/end positions.

In this fix, we deprecated the cache and use Spanned#getSpans to find
overlapped spans instead.

Change-Id: I1e732f335ad745d85a7620e3ced6858551f18232

Fix: 182982338

Test: atest CtsInputMethodTestCases:SpellCheckerTest
Change-Id: I327e5163499cfc978ff8480664a7e728b6ea7249
2021-03-25 13:49:21 +08:00
Michel Comin Escude
d29d73d814 Updated Stretch based on design feedback
Bug: 179047472
Test: re-ran EdgeEffectTests
Change-Id: I1ed6df2d8ec1d69670cf4977cf7286052240b0d1
2021-03-23 07:03:33 +00:00