Commit Graph

8807 Commits

Author SHA1 Message Date
Joanne Chung
a5fa9bc0f7 Add initial View's APIs for auto translation
The initial APIs for auto translation flow. The implementation of
sending request and dealing spans will on the follow up changes.

Bug: 172969740
Test: manual build pass. Use a sample app to call api get expected
result.

Change-Id: Ief45190026e6205ff18366c1aaba8f424a4df00c
2021-01-25 18:57:14 +08:00
Kohsuke Yatoh
93d47b0487 Add supportedAttributes param for spell checker.
Bug: 166304720
Test: atest CtsInputMethodTestCases:SpellCheckerTest
Change-Id: I22f4a59a0c8ccb43f799351062f9fabca42403cd
2021-01-20 20:06:12 +00:00
Treehugger Robot
da1039a992 Merge "AbsSeekBar: Fix growRect computation" am: e1f0416a17 am: 48b3ec73d9 am: e577801dbf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1550782

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic443e0e5839239339b190b6775229058f648b856
2021-01-19 22:58:02 +00:00
Treehugger Robot
e577801dbf Merge "AbsSeekBar: Fix growRect computation" am: e1f0416a17 am: 48b3ec73d9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1550782

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8c779db0fcf2090ed6e6e624ad91279eaad19bf3
2021-01-19 22:44:04 +00:00
Adrian Roos
c5ce225fdf AbsSeekBar: Fix growRect computation
Fixes an issue with the growRectTo computation where if the
difference between the current and target size wasn't an even
number, the resulting rect would not actually have the correct
size.

Also, asserts using the thumb bounds, rather than the view
bounds in case the thumb is not perfectly centered within the
view due to rounding errors on odd densities.

Fixes: 173872859
Test: atest AbsSeekBarTest
Change-Id: Ib2b81a91ba8feeb6743a4e4a588d6116d231eb8d
2021-01-18 10:50:52 +00:00
Nikita Dubrovsky
3b59bf746e Merge "Enable Content Capture for ImageViews by default" 2021-01-15 21:56:54 +00:00
Nikita Dubrovsky
98fcc0850d Enable Content Capture for ImageViews by default
Bug: 167712713
Test: atest CtsWidgetTestCases:ImageViewTest
Test: Manual
Change-Id: I5a77f5e19d6021e799c5fe13c4c9b71c039ff8dc
2021-01-14 21:33:14 -08:00
Jeff DeCew
b1e9252d65 Merge changes from topic "decorate_custom_notifs"
* changes:
  Improve RemoteViews to simplify notification view hierarchy.
  Fully custom view notifications now receive minimal decoration when targeting S.
2021-01-11 21:48:22 +00:00
Nikita Dubrovsky
19d37240a5 Merge "Add MIME types to ViewStructure and autofill/cc ViewNode classes" 2021-01-11 21:17:53 +00:00
Nikita Dubrovsky
e8f7c4ba7c Add MIME types to ViewStructure and autofill/cc ViewNode classes
Bug: 168253885
Test: atest FrameworksCoreTests:TextViewOnReceiveContentTest
Test: Manual
CTS-Coverage-Bug: 170893906
Change-Id: Iac8f73a7a022f20f59ecef9be89e3189ca106e4c
2021-01-11 20:57:48 +00:00
TreeHugger Robot
08a80b3208 Merge "[Magnifier-77] Show it on long press selection" 2021-01-11 19:05:34 +00:00
Jeff DeCew
cb189d4630 Improve RemoteViews to simplify notification view hierarchy.
Test: manual
Change-Id: Iab1579a3e992a53f1e44ff7236511d1093de048f
2021-01-08 17:01:11 -05:00
Jeff DeCew
7946e72910 Annotate method arguments with type annotations
Fixes: 176818261
Test: n/a
Change-Id: If8196c2e86ba7c6b35e3b96cc73191598bab6c8e
2021-01-08 21:05:09 +00:00
Mihai Popa
c9471655ee [Magnifier-77] Show it on long press selection
Before this CL, the TextView magnifier was shown when selecting text,
but only when a selection handle was explicitly grabbed. This CL also enables
the magnifier when selection is performed by dragging after long press.

Bug: 119819194
Change-Id: I9546023723ef9ff84dbc6ca4c8fe5642c66a0146
Test: manual testing
2021-01-08 18:25:23 +00:00
Jeff DeCew
7ccbcf1713 Merge "Fill out RemoteViews methods for editing LayoutParams." 2021-01-08 14:53:47 +00:00
TreeHugger Robot
8fc190c6fc Merge "IME API: InputConnecton#setImeTemporarilyConsumesInput(boolean)" 2021-01-08 07:20:49 +00:00
Lan Wei
30fe6aa964 IME API: InputConnecton#setImeTemporarilyConsumesInput(boolean)
Add API to set IME will temporarily consumes the input, for
this case, the cursor will be invisible in the app.

Bug: 175362887
Test: atest FrameworksCoreTests:TextViewTest
Test: atest CtsWidgetTestCases:TextViewTest

Change-Id: Ic04cacfd73f1f4cb254bb16caf6b04c00c91a318
2021-01-08 09:23:55 +08:00
Treehugger Robot
2c3ca49e7c Merge "Update deprecated link to RecyclerView" am: 9e1690609b am: 98aee6b904 am: a8faba9e7c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1539888

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib372d4d26974f4c0ebcb1eb0988f96b993350a24
2021-01-07 21:38:23 +00:00
Treehugger Robot
a8faba9e7c Merge "Update deprecated link to RecyclerView" am: 9e1690609b am: 98aee6b904
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1539888

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Idaa4e0082711e3043038ea565bed623bc70a6e4a
2021-01-07 21:18:48 +00:00
Jeff DeCew
a2114a56c8 Fill out RemoteViews methods for editing LayoutParams.
* All these methods are still hidden
* Methods take either a dimen or a value with a TypedValue COMPLEX_UNIT (as used for TYPE_DIMENSION)
* Rather than having 8 margin methods, I chose to have only 2, and create an @IntDef MarginType
* Created a set of methods in TypedValue for creating typed value data equivalent to that of dimension resources.

Bug: 175345582
Test: atest TypedValueTest
Change-Id: I3a8a5a1511158a6dbf55d4f9931ba100a369cb35
2021-01-07 14:30:57 -05:00
Nikita Dubrovsky
7c2e5bb7c5 Remove AUTOFILL_TYPE_RICH_CONTENT and related code
This reverts the autofill API changes made in ag/9884022 (only the
autofill-related changes in that CL, not the rest). This is because
non-text content in autofill is now handled via a separate code path
rather than via an autofill type (the new pipe for rich content was
added in ag/12642608).

Bug: 168837034
Test: Manual (image suggestions in augmented autofill)
Test: atest FrameworksCoreTests:AutofillValueTest
Test: atest CtsWidgetTestCases:TextViewOnReceiveContentTest
Change-Id: I261148646d21474ea10662a3e6a5d8b0ba6708f4
2021-01-07 01:33:17 +00:00
Dustin Lam
1f46828d7b Update deprecated link to RecyclerView
Previously pointing to the support.* version, and now points
to androidx.* one.

Fixes: 175752845
Test: N/A docs change
Change-Id: I7d63bd526000235bbc03a8631640058742726c38
2021-01-05 18:29:27 +00:00
Taran Singh
dc211bfac3 Prevent Fullscreen IME when app is in portrait.
When an app is running in portrait orientation, regardless of
what orientation display is in, IME shouldn't use fullscreen-mode.

Setting IME_FLAG_NO_FULLSCREEN in EditorInfo makes sure IME doesn't go
fullscreen.

Bug: 157870379
Test: Manually using steps in bug
Change-Id: I5a5e73e1dec776665f28a7e2eb091b555198001b
2020-12-21 05:57:47 -08:00
Kohsuke Yatoh
e5f12abfec Add RESULT_ATTR_DONT_SHOW_UI_FOR_SUGGESTIONS.
Bug: 166304720
Test: atest CtsInputMethodTestCases:SpellCheckerTest
Change-Id: I2f5796d899c79ea1cd6795c16f2011389ae7afea
2020-12-17 00:16:36 +00:00
Nikita Dubrovsky
9d3615f71d Merge "Hide ContentInfo.partition from the public API" 2020-12-16 17:41:41 +00:00
Kohsuke Yatoh
e751e1036a Add InputConnection#performSpellCheck().
IME can use this method to redo spell checking after it has learned a
new user dictionary word.

Bug: 166304720
Test: atest CtsInputMethodTestCases:SpellCheckerTest
Change-Id: I956cd46f25bb77b7e1a6a3e1478c0d7efa1a056a
2020-12-15 22:48:47 +00:00
Nikita Dubrovsky
c9f90b56df Hide ContentInfo.partition from the public API
Per API Council feedback, this method will not be exposed in the public
API. App developers will instead use the support library for this.

Rather than removing the method completely, it is marked with @hide so
that it can still be used in system code (e.g. RemoteInputView).

Bug: 174125311
Test: atest CtsViewTestCases:ContentInfoTest
Change-Id: I83b55bea38c0d2b3dc60a16658616e46ebe4cb48
2020-12-14 22:04:57 -08:00
Treehugger Robot
431139218a Merge "Add missing IMF OWNERS" am: 4e3959e571 am: 30497d0911 am: 03ced7e52e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1525813

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5896f244b5d601ceec3da6d25cc2a1b633ff4f55
2020-12-12 02:54:04 +00:00
Treehugger Robot
03ced7e52e Merge "Add missing IMF OWNERS" am: 4e3959e571 am: 30497d0911
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1525813

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3534455778648e6be10ffedbd2d692656d88d318
2020-12-12 02:14:04 +00:00
Adrian Roos
bb4c35d0d2 Add missing IMF OWNERS
Test: n/a
Change-Id: Ib1ec672f872a3b1faf65c3583e300f473bac8f0c
2020-12-11 17:02:19 +01:00
Jeff Sharkey
0ab7007631 resolve merge conflicts of 358f0d4fc8 to master
Bug: 174932174
Test: I solemnly swear I tested this conflict resolution.
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Change-Id: I9262a08ffc1ccede8e519d0eed90ed2bfcf0232c
2020-12-08 11:01:05 -07:00
Jeff Sharkey
24d251403b Improve OWNERS coverage across frameworks/base/. am: fab0ab3c9c am: c7c4a74a78
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519383

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5120a3701af3564f363900b20bca75f3ad2a854c
2020-12-08 16:43:17 +00:00
Jeff Sharkey
c7c4a74a78 Improve OWNERS coverage across frameworks/base/. am: fab0ab3c9c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519383

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0211462ecbcd9ad66f66af87e31cf12e1582fc65
2020-12-08 16:01:16 +00:00
Jeff Sharkey
fab0ab3c9c Improve OWNERS coverage across frameworks/base/.
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.

Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas.  Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:

-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage

Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance.  With this extensive
effort, we've now improved our coverage as follows:

-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage

This specific change is automatically generated by a script from
detailed ownership information confirmed by team leads.

Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I9789c97c1de8e5d962b48c29c57d82fe83729eba
Change-Id: I9789c97c1de8e5d962b48c29c57d82fe83729eba
2020-12-08 08:36:27 -07:00
Tony Mak
e902a646ce Merge changes from topic "s-suggestselection"
* changes:
  Integrate the SuggestSelection API in TextView
  Introduce TextSelection.Builder.setIncludeTextClassification and TextSelection.getTextClassification()
2020-12-03 22:43:02 +00:00
TreeHugger Robot
88839c7303 Merge "Provide AutoCompleteTextView as an accessibility class name" 2020-12-03 05:52:54 +00:00
Tony Mak
92e31b5943 Integrate the SuggestSelection API in TextView
Fixes: 173512834

Test: atest
cts/tests/tests/textclassifier/src/android/view/textclassifier/cts/TextViewIntegrationTest.java

Change-Id: Ice57e69bf173b45ea2dded5cb7585c0710aeecc7
2020-12-02 21:31:17 +00:00
Xin Li
d31ee38811 Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855
Bug: 172690556
Merged-In: I78222391b83a4add8e964340ec08bb8a1306e1c6
Change-Id: I28bbf40820674675ccf765c912aa8140d3f74ab2
2020-12-02 00:38:58 -08:00
Kohsuke Yatoh
b11b963ed1 Prepare switching font loading to system server.
Currently, fonts are loaded in Zygote.
This CL adds a preparation to switch it to system server and
bindApplication(), so that system server will be able to update font map
at runtime.

(1) Zygote will be initialized without fonts.
(2) System server will maintain a serialized font map in ashmem.
(3) Apps will load font map from the ashmem in bindApplication().

The change is guarded by Typeface.ENABLE_LAZY_TYPEFACE_INITIALIZATION,
and the new behavior is disabled by default.
I tested with ENABLE_LAZY_TYPEFACE_INITIALIZATION = true.

Bug: 172891184
Test: atest FrameworksCoreTests:TypefaceTest
Test: atest CtsGraphicsTestCases
Test: atest CtsTextTestCases
Test: atest CtsWidgetTestCases
Change-Id: I40832962a4b27f6160c4dc6268689c52f6a4dd33
2020-12-01 16:05:33 -08:00
Nikita Dubrovsky
83de85f7b6 Merge "Move/rename OnReceiveContentListener.Payload to android.view.ContentInfo" 2020-11-30 22:33:03 +00:00
Yinglei Wang
0a993aac9a Merge "setAccessibilityFocused for NumberPicker" 2020-11-30 22:17:43 +00:00
Nikita Dubrovsky
10f027f69f Move/rename OnReceiveContentListener.Payload to android.view.ContentInfo
Bug: 174125311
Test: atest CtsViewTestCases:ViewOnReceiveContentTest
Test: atest CtsWidgetTestCases:TextViewOnReceiveContentTest
Test: atest FrameworksCoreTests:TextViewOnReceiveContentTest
Change-Id: If3988dfe9dbed6bcd5e1f1566cb3ecdb111aef3f
2020-11-27 15:50:31 -08:00
Chang Li
3650ad14f8 Always swallow the IllegalStateException from AsyncTask.
Because we use suppliers for TextClassifier, the
mTextClassificationHelper::isTextClassifierDestroyed actually always
returns false. Always swallows the exception temporarily to unblock
other teams. We may want to keep a reference of the TCSession in the
AsyncTask and check it ideally (b/174300371).

Bug: 174300371
Fix: 172627102
Test: atest AccessibilityTextTraversalTest.java
Change-Id: I5988db992956d666e24e608cd99d4fc87fd6820b
2020-11-27 23:30:13 +00:00
TreeHugger Robot
94b24197c3 Merge "Makes the multi-touch prevention only works for editable TextView." into rvc-qpr-dev am: b72c8a096b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12906239

Change-Id: Ie3f9e6e8e00f4a647dc6f9d317763601cdc26adb
2020-11-26 06:45:47 +00:00
yingleiw
8f72ffcbfa setAccessibilityFocused for NumberPicker
NumberPicker uses AccessibilityNodeProvider. When creating
AccessibilityNodeInfo, the accessibility focus boolean property should
be set. Otherwise, talkback doesn't think it is accessibility focused
and won't speak the usage hint.

Fix: b/170267520

Test: tested manully with talkback on. Unit test added.

Change-Id: Icd280bce4a394ccff2a60314518109c07808338d
2020-11-25 19:46:18 -08:00
Hiroki Sato
8dbd056398 Provide AutoCompleteTextView as an accessibility class name
This helps AccessibilityService to detect if an EditText is capable of
showing an auto complete or not.

Bug: 173744816
Bug: 150827488
Test: manual.
Change-Id: I47636bf9491fdbfc1fbca3c24f4ea5a551578cfd
2020-11-24 05:47:30 +00:00
Chang Li
3895a03567 Conditionally swallows Exceptions from TextClassificationAsyncTask.
After ag/12036126, the AsyncTask may throw RuntimeException if we
destroy the TCSession before it is done. However, this kind of Exception
should be swallowed silently because we do not need the result anymore.

In b/172627102, the test fails because we perform a cut action to the
text immediately after we trigger a selection. The cut action will
destroy and TCSession and thus cause a session-already-destroyed
Exception in the AsyncTask. With this, we will check whether the Text
Classifier has already been destroyed and therefore can fix it.

Bug: 172627102
Fix: 172627102
Test: atest AccessibilityTextTraversalTest.java

Change-Id: Ia2ca04a06e97858cd897e5d35f707f5edeee56cf
2020-11-23 14:20:50 +00:00
Nikita Dubrovsky
53bf38e9ff Add View.performReceiveContent in addition to View.onReceiveContent
Bug: 170191676
Bug: 152068298
Test: atest CtsViewTestCases:ViewOnReceiveContentTest
Test: atest CtsWidgetTestCases:TextViewOnReceiveContentTest
Test: atest FrameworksCoreTests:TextViewOnReceiveContentTest
Change-Id: I3a3a3ec3b386c5af9c7e997fb32201fefa564545
2020-11-17 15:26:58 -08:00
Sally
ba819fcef4 Change forceBoldText to fontWeightAdjustment in TextView
Use the weight adjustment instead of a binary on/off

Bug: b/170966021, b/110991537
Test: Manual with bold text toggle,
atest CtsWidgetTestCases:TextViewTest, CtsTextTestCases

Change-Id: Ic60ca7eed497bfc798d653a07824a9e5fabe5bc2
2020-11-13 19:43:42 +00:00
Nikita Dubrovsky
00813be0ed Merge "Update onReceiveContent() logic for app vs platform processing" 2020-11-13 15:54:02 +00:00