Commit Graph

9286 Commits

Author SHA1 Message Date
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
George Mount
d96a2d3e6d 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-02 13:48:14 -08:00
yingleiw
fbfd734049 Add AccessibilityAction ACTION_SHOW_SUGGESTIONS
And implement it for editable text to show the popup
window for typo correction.

Bug: b/143378480

Test: tested with modified talkback.
Change-Id: I8bb1ec87f6bb2177fb4b8fb9a88bfbe10b374173
2021-12-02 12:04:52 -08:00
Nahun Kim
8b7b56f016 Remove unnecessary null check code for RemoteView
* It can not be null and before the statement rv has been already used.

Test: Make AppWidget on the front page.
Fixes: 168335785

Change-Id: If622ef693fb806a2b0d7a86182f9ccb10c80eba6
2021-11-29 22:27:37 +00:00
Stevie Kideckel
8ae95aef56 Deprecate RemoteViews showNext/showPrevious
Only idempotent actions should be used as RemoteViews can be reapplied
frequently. Also, these actions don't work with
partiallyUpdateAppWidget, which causes developer confusion and pain.
Developers should use setDisplayedChild instead and maintain their own
record of the current index.

Test: annotation only, validated that things still built ok
Fix: 197745933
Change-Id: I67a2615567a38dae90d693c89001adcaafba2a8e
2021-11-24 13:16:30 +00:00
Yinglei Wang
f52b121fda Merge "Send TYPE_VIEW_TEXT_CHANGED a11y event when SuggestionSpan is added" 2021-11-18 20:13:09 +00:00
yingleiw
63ab661d5a Send TYPE_VIEW_TEXT_CHANGED a11y event when SuggestionSpan is added
When user types space after a word, we receive a text
change event, but the suggestion span is not added to
the text yet. The spell checker adds the span after the
text change event is sent. Previously we send the event
in onSpanAdded in TextView, but we don't do anything or
update the before text for span removed. This is a bit
confusing and error prone. This change moves the send
event logic into spell checker.

Bug: b/143378480

Test: tested with talkback.
Change-Id: Ibd45843494304602b177df8da520a51058989f10
2021-11-17 20:01:30 -08:00
Yohei Yukawa
01732bb37a Use IMM#invalidateInput() in EditText#setText()
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 viewpoing of IMEs.

 [1]: I3161755779080f98bcef0e47dd0c5247d8a3a256

Bug: 203086369
Test: atest CtsInputMethodTestCases:EditTextImeSupportTest
Change-Id: I8d2e0be22454b106ded15c78c876b55dc6e60a13
2021-11-17 15:22:34 -08:00
Stevie Kideckel
899cc0319c Merge "Optimize parcelization protocol in RemoteViews and RemoteCollectionItems" into sc-v2-dev am: 742187b89d am: 80dd4b4290
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16047867

Change-Id: I8a158874f028642a5c47ad98308ff3d5a69780b6
2021-11-17 23:02:21 +00:00
Stevie Kideckel
80dd4b4290 Merge "Optimize parcelization protocol in RemoteViews and RemoteCollectionItems" into sc-v2-dev am: 742187b89d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16047867

Change-Id: I8a8e729bcbb1c8f47325bdffaecee2db4eee6137
2021-11-17 21:37:43 +00:00
Stevie Kideckel
742187b89d Merge "Optimize parcelization protocol in RemoteViews and RemoteCollectionItems" into sc-v2-dev 2021-11-17 21:24:39 +00:00
TreeHugger Robot
994199991b Merge "Check if the view can be recycled if viewId is set" into sc-v2-dev am: 8b5c93d9ea am: 5df3511ad7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16214434

Change-Id: I9fb4df9313fe4c87b901ab0288e152809a100a74
2021-11-11 23:32:59 +00:00