Commit Graph

1626 Commits

Author SHA1 Message Date
Sudheer Shanka
389a1de0ac Merge "Avoid NPE in trimToLengthWithEllipsis()." 2020-10-08 20:15:47 +00:00
Sudheer Shanka
bfdc47752e Avoid NPE in trimToLengthWithEllipsis().
Currently, the text paramter is annotated with @Nullable
but passing a null value will cause an NPE.

Test: atest core/tests/coretests/src/android/text/TextUtilsTest.java
Change-Id: I95a71246aa0fe3398f09cb9b4b037ca096900ad4
2020-10-08 01:46:06 -07:00
Kohsuke Yatoh
291a0f9682 Add API to differentiate grammar suggestions.
The following attributes are added for grammar suggestions.
- SuggestionSpan#FLAG_GRAMMAR_ERROR
- SuggestionsInfo#RESULT_ATTR_LOOKS_LIKE_GRAMMAR_ERROR

Bug: 166304720
Test: atest CtsInputMethodTestCases:SpellCheckerTest
Change-Id: I0e5da3125d28bb881e513d0d69e0a2d336a9f286
2020-10-05 23:29:14 -07:00
Seigo Nonaka
f3a1915b2e Add TextShaper API
TextShaper API provides a primitive text layout result, e.g. what glyph is used etc.

Here is the new APIs and its description

- PositionedGlyphs
This is a native instance backed object that gives layout information to developers.

- GlyphStyle
The glyph style is an object that holds the parameters that will be used for drawing.
This object is a subset of the Paint object for avoiding creating lots of Paint copy.

- TextShaper#shapeText
This does a text shaping and gives TextShaper.Result. This is a native backed primitive
shaping API.

- StyledTextShaper
This is a text shaper for a styled text. This will be the top-level developer facing
API for shaping text.

Bug: 168048923
Test: atest FontTest TextShaperTest StyledTextShaperTest
Change-Id: I2e91d1ef8503b25b28efc94da7de7cad49c4c1a9
2020-09-29 12:38:28 -07:00
Jeff Sharkey
4b5b0174d0 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570 am: 487d394296
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: Id01f468b43fd5b2aada78608010625b392c1b647
2020-09-15 21:01:48 +00:00
Jeff Sharkey
a8cec413b6 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: I245b8d9cac722da76ea67983738a3cbb9deb68df
2020-09-14 10:00:07 -06:00
Xin Li
628590d7ec Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
2020-08-31 21:21:38 -07:00
Siyamed Sinir
bc372d0352 Merge "Remove clarabayarri from text OWNERS" am: 3fe6523d2f am: 153ae28af7 am: c7790b29ad am: 0e72570b88 am: 3d690999c3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1406974

Change-Id: Ifff11b7d1ff7487e15a4c3b62fef285be6928f0c
2020-08-24 12:38:45 +00:00
Siyamed Sinir
c7790b29ad Merge "Remove clarabayarri from text OWNERS" am: 3fe6523d2f am: 153ae28af7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1406974

Change-Id: I36b8f7edad6cd11e54c89c8adcc43177710d8fac
2020-08-24 11:30:56 +00:00
Clara Bayarri
0ac2e4ac31 Remove clarabayarri from text OWNERS
Change-Id: Ic67b5937d150096fddfe839d3406b29ba4bcb3a7
2020-08-21 17:07:57 +00:00
vichang
bf325c8d05 Merge "Update language in android.text.format to comply with Android’s inclusive language guidance" am: f7b2126b75 am: 80a5722b9b am: ecf22c3507 am: 21ddfb5a16 am: 0f813ef386
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1373056

Change-Id: I0a54d1b90eb7f0dace467d6fe9743c92e943fa3c
2020-07-28 16:30:07 +00:00
vichang
ecf22c3507 Merge "Update language in android.text.format to comply with Android’s inclusive language guidance" am: f7b2126b75 am: 80a5722b9b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1373056

Change-Id: I453f4d3d600865773861dcb6e78c51185cd037f9
2020-07-28 15:45:40 +00:00
vichang
f7b2126b75 Merge "Update language in android.text.format to comply with Android’s inclusive language guidance" 2020-07-28 15:08:47 +00:00
Victor Chang
304910489a Update language in android.text.format to comply with Android’s inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 161896447
Test: m droid
Change-Id: I643275c1ea39fa1a5fef7283076827b93dffcab1
2020-07-27 15:44:28 +01:00
Treehugger Robot
e78ac20b5d Merge "Update language to comply with Android’s inclusive language guidance" am: dce2f1c04b am: c686b1f21c am: 50015ad612 am: 7ee1dc7321 am: 0ead0fc382
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1371481

Change-Id: Ib0e78ce48eaa0be5cc8dc69d3e5674ac8722a287
2020-07-23 21:14:35 +00:00
Treehugger Robot
50015ad612 Merge "Update language to comply with Android’s inclusive language guidance" am: dce2f1c04b am: c686b1f21c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1371481

Change-Id: I05712223149c676ae849114562ef6969fbe8ab18
2020-07-23 20:29:38 +00:00
Treehugger Robot
dce2f1c04b Merge "Update language to comply with Android’s inclusive language guidance" 2020-07-23 17:56:04 +00:00
vichang
4909d91045 Merge "Add vichang into OWNER of android.text.format" am: ed7ca56dfc am: 2965200e3c am: c2bfd3c51b am: a75069f84f am: 11ea5fdd5a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1367377

Change-Id: Iff83d217afef03039256508b31da0fd7c2b1b425
2020-07-23 13:08:04 +00:00
vichang
c2bfd3c51b Merge "Add vichang into OWNER of android.text.format" am: ed7ca56dfc am: 2965200e3c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1367377

Change-Id: I0226581d23d34a7f3e8ad1377274cf8193d240d4
2020-07-23 12:18:34 +00:00
Seigo Nonaka
f47561320f Update language to comply with Android’s inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 161896447
Test: atest TextViewTest
Change-Id: I83f253f6edfb2724972793b3495835540b7b52e4
2020-07-22 22:54:14 -07:00
vichang
2b05393251 Merge "Remove @CorePlatformApi LocaleData usage in frameworks" am: 3f89b904a8 am: 226e3d7641 am: 9ee26b06fb am: f82c013ec3 am: 6e4f9e9e06
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1367376

Change-Id: I7f0c730abced6a03fb8952d602a398a724667569
2020-07-22 20:28:18 +00:00
vichang
9ee26b06fb Merge "Remove @CorePlatformApi LocaleData usage in frameworks" am: 3f89b904a8 am: 226e3d7641
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1367376

Change-Id: Ib23a5ff1491c89d5cd0f962b1f609c988111c18b
2020-07-22 19:48:40 +00:00
vichang
3f9e52d88b Merge "Use DateFormatSymbols directly instead of using LocaleData" am: 3bd9f08ae5 am: da5838aa43 am: 36a3657be8 am: afbfec08c7 am: eb59659998
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1364767

Change-Id: I4dd7683e1473cde7ea560d43de38ad640fe752f6
2020-07-21 17:53:25 +00:00
vichang
36a3657be8 Merge "Use DateFormatSymbols directly instead of using LocaleData" am: 3bd9f08ae5 am: da5838aa43
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1364767

Change-Id: I8fbfc4e551396b32c1aafab4aa750af1baa7c827
2020-07-21 16:56:31 +00:00
vichang
ebafe9a39d Merge "Remove the duplicated constant declaration in DateUtilsBridge" am: 3db0441e5c am: c52a84acf3 am: 70862e266e am: ba3ebf0844 am: a23606dd5e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1364765

Change-Id: If89ea1b23a0e34f2f5e556b79f73c44dd257f0bc
2020-07-21 10:23:41 +00:00
vichang
36bde75bdc Merge changes from topic "DateIntervalFormat" am: 6e706c4cee am: 85c56c1fa4 am: c675c3e826 am: d7b8bede26 am: 076b3347b7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1365636

Change-Id: I987c7a0bf346d6805b615586a3afe76702f30456
2020-07-21 10:22:49 +00:00
vichang
70862e266e Merge "Remove the duplicated constant declaration in DateUtilsBridge" am: 3db0441e5c am: c52a84acf3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1364765

Change-Id: Iab8475912ecf95b90d24eb5b2dc9165e4442a347
2020-07-21 09:36:43 +00:00
vichang
c675c3e826 Merge changes from topic "DateIntervalFormat" am: 6e706c4cee am: 85c56c1fa4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1365636

Change-Id: I6ff83f882fac3cf045defe4aa297495d3b011ddc
2020-07-21 09:36:18 +00:00
Victor Chang
bbe4493efb Add vichang into OWNER of android.text.format
Most android.text.format classes are wrappers of ICU4J or libcore.

Test: n/a
Change-Id: I3269efece738cfc7344d1823f7a79677f6cb93fc
2020-07-20 21:17:48 +01:00
Victor Chang
55a6efbfd9 Remove @CorePlatformApi LocaleData usage in frameworks
They can be replaced by the public API provided by ICU4J instead.
No extra layer of caching equivalent to the LocaleData cache is
added because ICU4J has caches instances, e.g. DateFormatSymbols,
etc.

Bug: 160606356
Test: atest FrameworksCoreTests:android.text.format
Change-Id: I07048e0e1a4835d2744b7fce6a5ed79a112e456b
2020-07-20 21:09:40 +01:00
Victor Chang
c744bd5f64 Use DateFormatSymbols directly instead of using LocaleData
Bug: 160606356
Test: atest FrameworksCoreTests:android.text.format
Change-Id: Id5d70328ab146d439ed45135e0fa9d1b9cc95257
2020-07-20 21:09:40 +01:00
Victor Chang
6a691eeec7 Remove the duplicated constant declaration in DateUtilsBridge
Bug: 160606356
Test: m droid FrameworksCoreTests
Change-Id: Ifa79b2a29c6fc0c767337efe569da2d2ba29f959
2020-07-20 21:09:40 +01:00
Victor Chang
3a3a8ada42 Make a copy of DateIntervalFormat from libcore - part 2
Bug: 160606356
Test: atest FrameworksCoreTests:android.text.format
Change-Id: I4c4253c707211f2a5ee0a11da107ab1dd6c4fab8
2020-07-20 21:09:40 +01:00
Victor Chang
8ee3807a01 Make a copy of DateIntervalFormat from libcore
It allows the removal of @CorePlatformApi in libcore.icu

Bug: 160606356
Test: n/a
Change-Id: Id0ed2d212b6cd84ff73edc70794e002ea5f63cd0
2020-07-16 16:23:58 +01:00
vichang
e6b6b491bd Merge changes from topic "DateUtilsBridge" am: 59d12aa8bd am: f65666d055 am: f5ed148053 am: fe1600c0db am: 175a1a7df9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1356708

Change-Id: Ib57a70ae05a872f2037e3da5716639a33985ebcd
2020-07-13 11:07:16 +00:00
vichang
f5ed148053 Merge changes from topic "DateUtilsBridge" am: 59d12aa8bd am: f65666d055
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1356708

Change-Id: Idd5d71f2d6b787ddbece60746c97dd2713ecc7cc
2020-07-13 10:22:38 +00:00
vichang
59d12aa8bd Merge changes from topic "DateUtilsBridge"
* changes:
  Move/Copy some libcore.icu classes to android.text.format
  Copy some libcore.icu classes to android.text.format
2020-07-13 10:02:16 +00:00
vichang
534ea43ebd Merge "Remove libcore.icu.ICU usage in android.text.format.DateFormat" am: ec71624f22 am: 3b25f55042 am: 8a202538bc am: 13121a763b am: 8ec9138f79
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1355737

Change-Id: Ia20f6f9fcc64711e79a9afdd38895ab600b8c691
2020-07-13 02:56:29 +00:00
vichang
8a202538bc Merge "Remove libcore.icu.ICU usage in android.text.format.DateFormat" am: ec71624f22 am: 3b25f55042
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1355737

Change-Id: Ibc2b1561f316afe2371d9549190a0c328a180141
2020-07-13 02:31:18 +00:00
Victor Chang
5e348b2a28 Move/Copy some libcore.icu classes to android.text.format
Bug: 160606356
Test: atest FrameworksCoreTests:android.text.format
Change-Id: I5a3e954419e8bd282ec5dd057b241c3572be6831
2020-07-10 18:00:29 +00:00
Victor Chang
cdf1423650 Copy some libcore.icu classes to android.text.format
Bug: 160606356
Test: N/A
Change-Id: I408ed56e240d2379fb49a52a19f134d83a2b601f
2020-07-07 18:30:55 +01:00
Victor Chang
a0d05f4fdc Remove libcore.icu.ICU usage in android.text.format.DateFormat
The methods can be implemented with ICU4J directly.

Bug: 160606356
Test: atest android.text.format.DateFormatTest
Test: atest CtsTextTestCases:android.text.format.cts.DateFormatTest
Change-Id: I3d5f639a94026c599b487563c95bf9d165adfeec
2020-07-06 21:30:24 +01:00
vichang
26ed852eaf Merge "Use new package name for ZoneInfo and libcore.timezone" am: af6f8e2301 am: 64937407f2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1346485

Change-Id: I5ded5092e4c7706f58417a5c97f3207524b44a95
2020-06-30 17:23:46 +00:00
Victor Chang
2ea241f6ee Use new package name for ZoneInfo and libcore.timezone
Bug: 141747409
Test: None
Merged-In: Id99a345ec024179295063c3644f72c062cb50554
Change-Id: Id99a345ec024179295063c3644f72c062cb50554
2020-06-30 13:53:47 +01:00
Victor Chang
6c22f6adb0 Use new package name for ZoneInfo and libcore.timezone
Bug: 141747409
Test: None
Change-Id: Id99a345ec024179295063c3644f72c062cb50554
2020-06-25 18:30:29 +01:00
Jason Hsu
27f8500443 Merge "Fix talkback did not speak out ReplacementSpan's content description." into rvc-dev am: dac6071aca am: 5684903daa am: 6005f85a64 am: b1b7ef92a7
Change-Id: I22d864f337efb115dba4fbe5410332ec7fdddff4
2020-05-30 02:01:05 +00:00
Jason Hsu
b1b7ef92a7 Merge "Fix talkback did not speak out ReplacementSpan's content description." into rvc-dev am: dac6071aca am: 5684903daa am: 6005f85a64
Change-Id: I9df0b450741d01b95ab53a1b3ddc663921aafc3f
2020-05-30 01:39:50 +00:00
Jason Hsu
540918349a Merge "Fix talkback did not speak out ReplacementSpan's content description." into rvc-dev am: dac6071aca
Change-Id: I762f05ffdba5a63e1d805beed44e28a8020fbc33
2020-05-30 01:12:12 +00:00
jasonwshsu
c70a456060 Fix talkback did not speak out ReplacementSpan's content description.
* setContentDescription() back to ReplacementSpan when receiving parcel
* extend writeToParcel to handle AccessibilityReplacementSpan

Bug: 155833272
Test: atest AccessibilityNodeInfoTest#testSetTextWithImageSpan_shouldTextSetToInfo
Change-Id: Iab902bdcee53fc09cbba2c7c06858823524a3af9
2020-05-28 03:34:16 +08:00
Neil Fuller
29867f046d Merge "Be more defensive around invalid tzids" am: f60c302dad am: 96c57398b4
Change-Id: If8695ee257155eaedc901aa797f1939eab0c721e
2020-05-26 10:54:50 +00:00