Commit Graph

9297 Commits

Author SHA1 Message Date
Sally Yuen
3e01ab61ea Merge "Add AccessibilityNodeInfo.isTextSelectable" 2022-02-01 21:58:55 +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
George Mount
aab9304c6a Release stretch overscroll when new items are added.
Bug: 206526994

When items are added to a ListView, any current stretch
should be released and a new touch should scroll and not
stretch.

Test: new tests. manual test
Test: If426eddf2e582169090e5e5e5694668c583288dc
Change-Id: I1f0ae1aa38b064dbb399e46869d8f14ac9d22a92
2021-12-14 17:38:40 +00:00
Joanne Chung
3a6037d159 Merge "Fix translation animation flash for the same translation" into sc-v2-dev am: 1ff5a29afd am: 5c32e894cb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16432382

Change-Id: Ifb0b11a3afe6591d0651d4ea2949ed691b1bc756
2021-12-13 03:11:29 +00:00
Joanne Chung
5c32e894cb Merge "Fix translation animation flash for the same translation" into sc-v2-dev am: 1ff5a29afd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16432382

Change-Id: I6cb7a365fb9bfb6e719227d2292aa08a5609396b
2021-12-13 02:54:00 +00:00
Joanne Chung
a5d4f094e8 Fix translation animation flash for the same translation
The system received the same multiple translation responses in a very
short time. We use a isShowingTranslation flag to determine if the
duplicated responses to call onShowTranslation. However the
isShowingTransation flag is set in a post runnable, this may cause the
system  allow the duplicate responses can call onShowTranslation
because the isShowingTransaltion isn't set true yet.

Use multiple flags isShowingTranslation and a new isRunningAnimation
to check if the same translation response should skip to call
onShowTranslation.

Bug: 207457172
Test: manual
Test: atest CtsTranslationTestCases
Change-Id: I7003b7f49fc0a8ce2e909228bcb89acedee6d3d0
2021-12-10 05:00:00 +00:00
Stevie Kideckel
224126d7a0 Merge "Copy caches when initializing RemoteViews" into sc-v2-dev am: 45cf23a6a4 am: 81bd66a5a5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16422417

Change-Id: I91e713a1c8e363f27199f2903d45f254101dec8a
2021-12-08 23:19:59 +00:00
Stevie Kideckel
81bd66a5a5 Merge "Copy caches when initializing RemoteViews" into sc-v2-dev am: 45cf23a6a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16422417

Change-Id: I965ad2bc3ddf198d96440b0a363a5fc76ea64be0
2021-12-08 23:03:33 +00:00
Stevie Kideckel
8d3c1aa054 Copy caches when initializing RemoteViews
If the BitmapCache is not copied when cloning RemoteViews, then Bitmaps
will be dropped.

Fix: 208865678
Test: cts, verified locally

Change-Id: I7547ab3a60ac3ee16b9cfb8d592988d0e410172d
2021-12-08 18:38:08 +00:00
Yinglei Wang
2fbe059072 Merge "Make SuggestionRangeSpan public" 2021-12-06 23:24:44 +00:00
yingleiw
dd5ca6bf56 Make SuggestionRangeSpan public
when we have overlapped SuggestionSpans, the
range of text being replaced can change depends on
the number of suggestions in the SuggestionSpans, so
accessibility services need to know the text being replaced.
We send text change event with the before text doesn't have the
SuggestionRangeSpan and after text has the SuggestionRangeSpan,
so a11y services can inform the user about the text being
replaced.
Other ui toolkits like compose can convert their style indicating
text being replaced to SuggestionRangeSpan.

Bug: b/143378480

Test: tested the event is sent.

Change-Id: I6d0d33e46f7c8ac9dbcc177ab54718184e715fb6
2021-12-06 12:42:53 -08:00
Yinglei Wang
8c0d172d51 Merge "Add AccessibilityAction ACTION_SHOW_SUGGESTIONS" 2021-12-03 23:28:51 +00:00
Yohei Yukawa
1f9ee62670 Revert "Use IMM#invalidateInput() in EditText#setText()"
This reverts commit 01732bb37a [1].

Reason for revert: Caused regression in Chrome Omnibox

 [1]: I8d2e0be22454b106ded15c78c876b55dc6e60a13

Bug: 203086369
Fix: 208941904
Test: presubmit
Change-Id: I5915f6bad63d8e978cb98a79076b9c57089422f8
2021-12-03 14:58:08 +00:00