Commit Graph

9308 Commits

Author SHA1 Message Date
Haoyu Zhang
e96b638348 Merge "Scribe for View: handwriting initiation for unfocused" 2022-02-10 22:45:53 +00:00
Haoyu Zhang
f0404bd4c3 Scribe for View: handwriting initiation for unfocused
Bug: 211763729
Test: atest FrameworksCoreTests:HandwritingInitiatorTest
Test: atest FrameworksCoreTests:HandwritableViewInfoTest
Test: atest FrameworksCoreTests:HandwritingAreaTrackerTest
Test: manually test
Change-Id: Ica9ee82cf1dc41feb5e4ff0f52ee13c1e4de8ad4
2022-02-10 10:28:14 -08:00
TreeHugger Robot
b75096f84f Merge "Recycle obtained TypedArrays" 2022-02-10 18:18:11 +00:00
Alan Viverette
7d1188244c Merge "Migrate frameworks/base javadocs references to androidx" 2022-02-10 18:02:28 +00:00
Nikolas Havrikov
0a19db4500 Recycle obtained TypedArrays
Bug: 218835043
Test: make
Change-Id: I34f53b8767b34b77a8a8246e9d3863854477feb6
2022-02-10 14:52:37 +01:00
Alan Viverette
406e0f6553 Migrate frameworks/base javadocs references to androidx
Does not remove Support Library artifacts from docs classpath (ApiDocs.bp)
because they are still used in development/samples, which is not as easy
to migrate as javadoc.

Bug: 158779503
Test: make docs
Exempt-From-Owner-Approval: Mass find/replace for androidx migration
Change-Id: Icf7f53ec36a0e970413352e2ebf40ce9d60ed17e
2022-02-09 22:25:14 +00:00
Sally Yuen
4c286e7ddf Merge "fix TextView a11yNodeInfo isTextSelectable" 2022-02-09 17:59:26 +00:00
TreeHugger Robot
018ffd309d Merge "Fix the empty selection issue when onCreateActionMode returns false" 2022-02-07 20:30:23 +00:00
Lucas Dupin
ecfb379e5e Do not relayout when changing to Marquee
The text field size won't really change, so there's not reason to
remeasure and relayout. This saves us up to 48 measure steps when
unlocking the device.

Test: https://ui.perfetto.dev/#!/?s=519ae4c7f943f3ebad09eae63e445112c1d4286dd8376e18e69d713f1a9c2
Bug: 210432290
Change-Id: Ie3b7e0f7e942aac23605e2588cf6b942d507588f
2022-02-04 09:49:43 -08:00
sallyyuen
889a5ab0f7 fix TextView a11yNodeInfo isTextSelectable
info.TextSelectable needs to also check isTextEditable for edit texts.
Bug: n/a
Test: atest AccessibilityTextTraversalTest

Change-Id: Ic8d5a04db05f0cc4856997ecf5d5c51bc8d16da2
2022-02-03 13:36:55 -08:00
Sally Yuen
3e01ab61ea Merge "Add AccessibilityNodeInfo.isTextSelectable" 2022-02-01 21:58:55 +00:00
Tony Mak
11bd644822 Fix the empty selection issue when onCreateActionMode returns false
One of the optimizations ag/12911059 did was calling
SelectionModifierCursorController.show() before
startActionModeInternal(). The rationale was that if we start the action
mode first, SelectionModifierCursorController.show() would end up
invalidating the action mode twice unnecessarily, once for each handle.

However, with this optimization, we are calling
SelectionModifierCursorController.show() even when onCreateActionMode
returns false.

Reverted this particular optimization to fix the issue.

Added a test which was failing without this fix but passing with it.

Fixes: 199380016
Fixes: 214341747
Test: atest TextViewActivityTest

Change-Id: I793f76a23978cbbbbde2d16e8a522615174bcdd5
2022-02-01 20:47:26 +00:00
Siyamed Sinir
6cac243d33 Merge "Minor JavaDoc grammar fix" am: 86e1a45b56 am: fa264ae28b am: f1cbfa73ab am: 9a191546d1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1964582

Change-Id: If44741849325764b37143eaa1016e201aab8a51f
2022-01-31 17:14:27 +00:00
Siyamed Sinir
9a191546d1 Merge "Minor JavaDoc grammar fix" am: 86e1a45b56 am: fa264ae28b am: f1cbfa73ab
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1964582

Change-Id: Ic147bc3d061f0906be7a74705414fe60c9aca0b9
2022-01-31 16:56:12 +00:00
Ian G. Clifton
bae29e0bc1 Minor JavaDoc grammar fix
Replaced "than" (comparative) with "then" (temporal) for the setTextSize JavaDoc. No functional change.

Change-Id: I84b5d1b250cb7a5d925cfbd0a86a2bfef55ade24
2022-01-29 01:37:43 +00:00
sallyyuen
bd0e5becea Add AccessibilityNodeInfo.isTextSelectable
ACTION_SET_SELECTION is needed on all TextView nodes to reset the
cursor. But some non-edit texts are selectable and need to be
identified by a11y services. ACTION_SET_SELECTION has been on these
nodes for years so to avoid the complexity of breaking this, add a
node property.

Services should use ACTION_SET_SELECTION for nodes where
property=true

Bug: 62058901
Test: atest  AccessibilityTextTraversalTest, TextViewTest cts and
core (TextViewTest#testCutShouldNotThrowException keeps failing but
it's unrelated to this change)

Change-Id: Ia825dd806824e663e7fa7d274f51c6bf44f0c2c4
2022-01-28 16:53:53 -08:00
Willie Koomson
35641ae2c0 Propagate apply flags to nested RemoteViews
This change propagates FLAG_WIDGET_IS_COLLECTION_CHILD and
FLAG_USE_LIGHT_BACKGROUND_LAYOUT to nested RemoteViews (either added by
addView, or set as portrait/landscape/sized RemoteViews) if that flag is
also present on the parent RemoteView.

For FLAG_WIDGET_IS_COLLECTION_CHILD, this prevents a PendingIntent from
being set on a RemoteView that is a child of a collection item RemoteView.

For FLAG_USE_LIGHT_BACKGROUND_LAYOUT, this ensures that nested
RemoteViews use their light background layout if this is set on the
parent.

Bug: 214288099
Test: RemoteViewsTest
Change-Id: I8da92d0d338631a99ee718a136bf9674827437bb
2022-01-27 22:43:45 +00:00
Willie Koomson
3a83f0e9a9 Make setRemoteAdapter() work for nested RemoteViews
This change adds applyNestedView() and reapplyNestedView() to
RemoteViews. This makes it possible to pass the top-level
"rootParent" view (usually AppWidgetHostView for widgets) to nested
RemoteViews that are added by addView(). This allows setRemoteAdapter
actions to work properly when they are used in nested RemoteViews.

Bug: 214288099
Test: RemoteViewsTest
Change-Id: I4fa3fe98d89bffdc0a5be46dabed12b9c217219e
2022-01-27 22:43:27 +00:00
TreeHugger Robot
4c4cd6f670 Merge changes from topics "CAI-filters", "onPrepareStylusHandwriting"
* changes:
  Scribe in IMF: Introduce filters in CursoAnchorInfo API 7/N
  Scribe in IMF: Early InkWindow preparation 6/N
2022-01-27 10:32:06 +00:00
Calvin Pan
2801e6de4f Merge changes Ib484fc0c,I2b9ff69c,I0a31b117,I888c65c8,I03723cfe, ...
* changes:
  Clean <plurals> in DateTimeView
  Clean <plurals> in CertificateMonitor
  Clean <plurals> in FillUi
  Clean <plurals> in BugreportProgressService
  Clean <plurals> in keyguard
  Clean <plurals> in ChooserActivity
  Clear <plurals> in TextUtils
  Clean <plurals> in FindActionModeCallback
  Clean <plurals> in ZenModeConfig
  Add util class for plurals
2022-01-27 06:31:58 +00:00
Taran Singh
7fbcbf27c7 Scribe in IMF: Introduce filters in CursoAnchorInfo API 7/N
New filter modes for InputConnection#requestCursorUpdates(mode) to allow
partial data in cursor/anchor updates.
Selective data helps with speedy CursorAnchorInfo updates.

Test: atest InputMethodServiceTest
Bug: 203086136

Change-Id: Ibba06e9a2533ca91c5cc215dfb18d21c9a74fb73
2022-01-26 15:41:27 +00:00
Calvin Pan
e4692b7cae Clean <plurals> in DateTimeView
Bug: 199230228
Test: make
Change-Id: Ib484fc0c59f7900b751f4e782dd67c000cc855bb
2022-01-26 11:55:11 +08:00
Pierre Barbier de Reuille
25cffbf7ea Merge "Deprecate RemoteViews showNext/showPrevious" 2022-01-25 09:12:35 +00:00
James Lin
b0429656ad Merge "Add line break word style parameter in the LineBreakConfig" 2022-01-24 17:27:12 +00:00
Abodunrinwa Toki
91c2178139 Merge "Ensure that "smart" actions are shown in Talkback." 2022-01-24 08:22:19 +00:00
James.cf Lin
664a75b407 Add line break word style parameter in the LineBreakConfig
The line break word style(lw) provides the phrase-based breaking opportunities. When the line break word style is set, it will be brought to ICU for calculation.

Bug: 183780874
Test: atest minikin_tests; atest TextViewTest; atest MeasuredTextTest; atest PrecomputedTextTest
Change-Id: Idd851497e46c1fca87ff590230d93f8bb5c9afae
2022-01-22 12:27:51 +08:00
Abodunrinwa Toki
6487bc38c1 Ensure that "smart" actions are shown in Talkback.
The "Local Context Menu"
(https://support.google.com/accessibility/android/answer/6007066?hl=en-GB)
is missing smart actions. This CL adds them.
We need this to happen even more now that we are going to be rendering
the selection toolbar in a system UI and are experiencing accessibility
focus issues. See referenced bugs for more details.

Bug: 214122485
Test: m
Test: https://screenshot.googleplex.com/3SdNNBt5bWMz2CN.png
Change-Id: If5266c8b44461349877cf0029b7803e0bc8a9174
2022-01-21 19:44:26 +00:00
Bernardo Rufino
1a5cb387d6 Revert "Revert "Migrate unsafe parcel APIs in framework-minus-apex""
This reverts commit 331be9a643.

Reintroducing ag/16366278 since it seems unrelated to b/214053959 (more details on b/214053959#comment55).

Original commit message:

Migrate unsafe parcel APIs in framework-minus-apex

Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()

This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).

A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.

Bug: 195622897
Change-Id: I272432e6e082a973f7a50492ec35d79c2b577c93
Test: TH passes
2022-01-19 11:13:18 +00:00
Alexandre Elias
b080d092e5 Merge "Expose public API to control mIsChildViewEnabled" 2022-01-19 03:17:56 +00:00
James Lin
43a4bbe145 Merge "Add setLineBreakConfig API" 2022-01-19 00:31:43 +00:00
Taran Singh
14d8e9450e Scribe in IMF: CursorAnchorInfo#getEditorBoundsInfo 3/N
Add a new field EditorBoundsInfo in CursorAnchorInfo
and implement it.

Bug: 203086136
Test: atest CurosrAnchorInfoTest

Change-Id: I7f225fa1236534bbd18920f8ce8293df23ea2ce7
2022-01-18 02:24:15 -08:00
Seigo Nonaka
94904647a4 Add setLineBreakConfig API
Add new API to allow applications to specify the line break word style. The line break style is one of the locale extension. When the line break style is set, it will be brought to ICU for calculation.

Bug: 183780874
Test: atest minikin_tests; atest TextViewTest; atest MeasuredTextTest; atest PrecomputedTextTest
Change-Id: Ia9cdb5b83e346f96ae22abbb1bcce05c43207bba
2022-01-15 14:28:40 +08:00
TreeHugger Robot
7f635e3d3b Merge "Implement fallback line spacing for BoringLayout" 2022-01-12 23:14:26 +00:00
Ashwini Oruganti
776b439703 Merge "Revert "Migrate unsafe parcel APIs in framework-minus-apex"" 2022-01-12 23:07:08 +00:00
Alexandre Elias
5730e5c56c Expose public API to control mIsChildViewEnabled
This is needed to replace an @UnsupportedApiUsage of the field
in appcompat/widget/DropDownListView.java

Bug: 177008210
Test: AbsListViewTest.testSelectedChildViewEnabled

Change-Id: Ia0bfe3f70f62db8185e1d9784d921e2e1f291006
2022-01-12 13:59:29 -08:00
Bernardo Rufino
331be9a643 Revert "Migrate unsafe parcel APIs in framework-minus-apex"
This reverts commit 90bb3709dc.

Reason for revert: b/214053959

Change-Id: Ic271bab1d3eaf677a5989dda9deb944ee2ad6850
2022-01-12 17:44:44 +00:00
Seigo Nonaka
78c774defb Implement fallback line spacing for BoringLayout
The fallback line spacing is a feature of extending the line height
when the fallback font has taller glyph. This was implemented to
StaticLayout in Android P but not yet implemented in BoringLayout.

This CL enables this feature to the BoringLayout as well.

Not to break existing apps, change this behavior only if the
targetSdk version is T or later.

This is a 2nd attempt of Ia6d6f9f44e73ddaf5e8fe9a8aead7a53efbddd44
The root cause of SystemUI crash was wrong API usage. (start, end) was
passed instead of (start, count).

Bug: 210923482
Test: atest FallbackLineSpacingTest BoringLayoutFallbackLineSpacingTest
Test: atest CtsGraphicsTestCases
Test: atest CtsTextTestCases
Test: atest SystemUITests
Change-Id: I9137607b0120934f7ad2a12c0f0b8aaa52915831
2022-01-12 00:00:53 -08:00
Iris Yang
2e79cc3ec6 Merge "Set launch display id to an action performed on RemoteViews." 2022-01-11 10:24:23 +00:00
John Reck
46cff23420 Merge "Don't animate TextView marquee if not visible" 2022-01-10 15:31:42 +00:00
Shubham Dubey
da511945c3 Revert "Implement fallback line spacing for BoringLayout"
Revert "Add font extent calculation"

Revert "Add test case for fallback line spacing"

Revert submission 16486662-fallback_line_spacing

Reason for revert: Investigate test failures on master


BUGID: b/213826416
BUGID: b/213829920

Reverted Changes:
I06cd7ab71:Add font extent calculation
I6214d52cd:Implement fallback line spacing for BoringLayout
Ia5825c474:Add test case for fallback line spacing

Change-Id: Ia6d6f9f44e73ddaf5e8fe9a8aead7a53efbddd44
2022-01-10 08:58:04 +00:00
Seigo Nonaka
a1b7ced11c Implement fallback line spacing for BoringLayout
The fallback line spacing is a feature of extending the line height
when the fallback font has taller glyph. This was implemented to
StaticLayout in Android P but not yet implemented in BoringLayout.

This CL enables this feature to the BoringLayout as well.

Not to break existing apps, change this behavior only if the
targetSdk version is T or later.

Bug: 210923482
Test: atest FallbackLineSpacingTest BoringLayoutFallbackLineSpacingTest
Test: atest CtsGraphicsTestCases
Test: atest CtsTextTestCases
Change-Id: I6214d52cde25a044bc6e246d2118e35d3a243c9d
2022-01-06 23:03:28 -08:00
Jeff DeCew
2e4df87b87 Merge "Fix crash in RemoteViews w/ Bundle due to Parcel.allowSquashing" into sc-v2-dev am: 88cccabf2b am: c6136c2959
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16553366

Change-Id: I66f9e0b45a2121675387c7d5ccbdf5a4b13ce916
2022-01-05 20:01:28 +00:00
Jeff DeCew
c6136c2959 Merge "Fix crash in RemoteViews w/ Bundle due to Parcel.allowSquashing" into sc-v2-dev am: 88cccabf2b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16553366

Change-Id: Ib2bed18a6dd1f7b0a872aabb6a8ca9bcf3ac9f4e
2022-01-05 19:54:56 +00:00
Jeff DeCew
a28572eb9d Fix crash in RemoteViews w/ Bundle due to Parcel.allowSquashing
This fixes a failing CTS test, NotificationTemplateTest.

Fixes: 207741735
Bug: 212731590
Test: atest NotificationTemplateTest
Change-Id: Ide0241121d0824a2ba8c721c968e39f3c627f79d
2021-12-30 16:45:17 -05:00
Beverly
5e12fbeae1 Update Toast documentation
to explicitly callout the 2-line limit
Note: more information can be found in
https://developer.android.com/guide/topics/ui/notifiers/toasts
which is also linked in the documentation but
could be missed.

Test: manual
Fixes: 207767563
Change-Id: Icc7fbf6fddf101bd2422bbeab04e0da8084c6698
2021-12-21 14:11:08 -05:00
TreeHugger Robot
5d8375c44d Merge "Use IMM#invalidateInput() in EditText#setText() (2nd try)" 2021-12-20 19:11:13 +00:00
Yohei Yukawa
2b4a008f3f Use IMM#invalidateInput() in EditText#setText() (2nd try)
With this CL, EditText#setText() actually starts using

  InputMethodManger#invalidateInput(),

which does not block the UI thread.

See the previous CL [1] about how that API actually works.

There should be no observable changes from the viewpoint of IMEs.

Note that this CL was once reverted due to Bug 208941904, which was
caused by a misbehaving InputConnection#endBatchEdit() implementation
as a combination of the following bugs:

 * Chromium (crbug.com/1277732)
 * EditableInputConnection (Bug 209958658)

Now those two bugs were addressed.  We have also implemented a
safeguard [2] against the same type of app issues so that the system
can gracefully fall back to the previous behavior as needed.

 [1]: I3161755779080f98bcef0e47dd0c5247d8a3a256
      daa6695c2e
 [2]: I109e0c26d8249fc2e01323e3e1cb36395fa7cc97
      60c7c55c36

Bug: 203086369
Fix: 209008342
Test: atest CtsInputMethodTestCases
Change-Id: I2ce4be729e23ef686e128f832f8cf7debdcd551e
2021-12-17 20:03:31 +00:00
Bernardo Rufino
90bb3709dc Migrate unsafe parcel APIs in framework-minus-apex
Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()

This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).

A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.

Bug: 195622897
Test: TH passes
Change-Id: I11a27b9bdab7959ee86e90aa1e1cbebd7aaf883c
2021-12-15 18:21:38 +00:00
Iris Yang
30691cd24d Set launch display id to an action performed on RemoteViews.
When user click notification's action (i.e. answer call), the activity
wouldn't display as the user is interacting with.
Add ActivityOptions#setLaunchDisplayId to the display that the given view
is currently on. So the activity will be launched to the display as the
user is interacting with.

Bug: 191222363
Test: Manually tested using Exo. Open calling application(e.g.WhatsApp)
on Exo virtual display, and answer the call from the notification of
phone.
https://drive.google.com/file/d/1OhS1yn5nCcUe1Aiti3_MLL7k5BLFf7_W/view?resourcekey=0-CCR2Mihn-cfCSIqQZMg-ow

Change-Id: I215519965074b2ddc66eb0a53320673295d4fb17
2021-12-15 09:41:22 +00:00
TreeHugger Robot
80bad32262 Merge "Release stretch overscroll when new items are added." into sc-v2-dev am: f0786d5d90
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16468159

Change-Id: Ib03a37982c6921d0325f1fea2e03c8b50bf305c3
2021-12-15 01:15:38 +00:00