This commit is part of a large scale change to fix errorprone
errors that have been downgraded to warnings in the android
source tree, so that they can be promoted to errors again.
The full list of changes include the following, but not all
will be present in any one individual commit:
BadAnnotationImplementation
BadShiftAmount
BanJNDI
BoxedPrimitiveEquality
ComparableType
ComplexBooleanConstant
CollectionToArraySafeParameter
ConditionalExpressionNumericPromotion
DangerousLiteralNull
DoubleBraceInitialization
DurationFrom
DurationTemporalUnit
EmptyTopLevelDeclaration
EqualsNull
EqualsReference
FormatString
FromTemporalAccessor
GetClassOnAnnotation
GetClassOnClass
HashtableContains
IdentityBinaryExpression
IdentityHashMapBoxing
InstantTemporalUnit
InvalidTimeZoneID
InvalidZoneId
IsInstanceIncompatibleType
JUnitParameterMethodNotFound
LockOnBoxedPrimitive
MathRoundIntLong
MislabeledAndroidString
MisusedDayOfYear
MissingSuperCall
MisusedWeekYear
ModifyingCollectionWithItself
NoCanIgnoreReturnValueOnClasses
NonRuntimeAnnotation
NullableOnContainingClass
NullTernary
OverridesJavaxInjectableMethod
ParcelableCreator
PeriodFrom
PreconditionsInvalidPlaceholder
ProtoBuilderReturnValueIgnored
ProtoFieldNullComparison
RandomModInteger
RectIntersectReturnValueIgnored
ReturnValueIgnored
SelfAssignment
SelfComparison
SelfEquals
SizeGreaterThanOrEqualsZero
StringBuilderInitWithChar
TreeToString
TryFailThrowable
UnnecessaryCheckNotNull
UnusedCollectionModifiedInPlace
XorPower
See https://errorprone.info/bugpatterns for more
information on the checks.
Bug: 253827323
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I8446f9076a45ebf7e7ffa06cb0d4ddb1001b6c00
Introduce a new constant FontStyle.FONT_WEIGHT_UNSPECIFIED = -1, which is used when text weight is not specified. Also replace -1 with it in TextView, TextAppearanceSpan.
Bug: 256995042
Test: manually test
Change-Id: Ia8334f5513cc3e5b7383b67b24b27bf2866d05ad
Since Unicode 12, emoji modifier sequences (such as human + light skin
tone) can be combined with zwj. However, current backspace state machine
ignores that and stops when one emoji modifier sequence is found. This
CL make the state machine continue exploration as long as a zwj is found
before an emoji modifier sequence.
BYPASS_INCLUSIVE_LANGUAGE_REASON="man" is the name of the emoji
Bug: 171495034
Test: Do the following:
- Enter an emoji from the "family" subgroup with different skin tones
combined such as 1F468 1F3FE 200D 2764 FE0F 200D 1F48B 200D 1F468
"kiss: man, man, medium-dark skin tone, light skin tone"
- Press the backspace key and confirm that the entire emoji is deleted.
Change-Id: I260f509832cb24486665019d68a25db0ad089d7e
This is an API for IME to request text bounds information from editor to
perform handwriting rich gestures. It's useful for IMEs to create custom
handwriting gesture that's not supported the HandwritingGesture. And
it can also be used to provide default rich gesture implementation for
handwriting gesture compatibility.
Bug: 239843501
Test: atest TextBoundsInfoTest
Change-Id: Ia7522371976a4e1fcdff4cc0d244ea427ad3d7c9
android.util.Range is not suitable for text ranges since it uses
inclusive boundaries, whereas the convention in text is to represent
ranges with an inclusive start boundary and exclusive end boundary. So
the API is updated to use an array of two ints to represent the text
range.
Bug: 251085162
Test: atest android.text.cts.LayoutGetRangeForRectTest
Change-Id: I54ab6d2741d1cfbbb743e477de4fa7299382fcfb
To avoid making WordIterator public, WordSegmentFinder has a public
constructor taking a Locale parameter. The constructor taking a
WordIterator parameter is kept but hidden so TextView can use it.
LayoutGetRangeForRectTest is moved to CTS.
Bug: 243969224
Test: atest android.text.cts.LayoutGetRangeForRectTest
Test: atest android.widget.cts.TextViewHandwritingGestureTest
Change-Id: Ibb829af0324c47e4d275b0ccd69d0f95601e3c08
Also clean up some helper methods by inlining the logic.
These APIs will be made public in a follow up change.
Bug: 243969224
Test: atest android.text.LayoutGetRangeForRectTest
Test: atest android.widget.cts.TextViewHandwritingGestureTest
Change-Id: I7991ef1f3abdf575b9adc0c5dc971f0cdd09fc87
These APIs will be made public in a follow up change.
Bug: 243969224
Test: atest android.text.LayoutGetRangeForRectTest
Test: atest android.widget.cts.TextViewHandwritingGestureTest
Change-Id: I65ddda9d60c486ca8f53bbd9f0d97209d56bec62
It was supposed to be enabled in S, but we missed it due to
https://r.android.com/1490737
Test: android.text.format.DateFormatTest
Change-Id: I0f6495bf2e4434396606743da1e32a39a54a0b19
These shortcut works as follows:
- If the selected region is empty, do nothing.
- If the selected region has at least one character that is not styled,
e.g. bold, apply bold style.
- If the selected region is fully styled, e.g. bold, remove bold style
from the region.
The default TextView/EditText supports styled editing, but it is used
commonly as plain text fields, e.g. email address in the form, etc.
So, not to style the text in such places, disable styled shortcut by
default and let developers to enable it when necessary.
Bug: 240628246
Test: TextViewStyleShortcutTest
Change-Id: Id0f1cd85eb198553a852c5c2b628f5d03a2741e1
This new method computes the horizontal character bounds by making
use of the character advances returned from native layer. It'll be
used in TextView to populate character bounds, and it's much efficent
compared to calling getPrimaryHorizontal for each character.
Bug: 233922052
Test: atest android.text.TextLineTest
Change-Id: Icdd53e61e2d1513b2231affb19bb00ea5d938d48
Re-land http://ag/2443141 because the over-translation issue should be
resolved now.
Use ICU's MeasureFormat to the degree possible for formatting file
sizes.
Bug: 36994779
Bug: 71580745
Bug: 217592956
Test: atest FrameworksCoreTests:android.text
Test: atest CtsTextTestCases
Change-Id: If3416ec38cf18c0441576643bfab850148e18c8e
1) Update the LineBreakConfig class to be immutable.
2) Do not return null in the PrecomputedText.Params#getLineBreaiConfig API
Bug: 216638444
Test: atest TextViewTest; atest MeasuredTextTest; atest PrecomputedTextTest; atest TextViewPrecomputedTextTest; atest StaticLayoutLineBreakingVariantsTest
Merged-In: I93bcb6ebc35344e34e9bb8a24df375aa7b3a8d81
Merged-In: I07766137ff6639c7d4acaad07dbcf11a2841cdb0
Change-Id: I07766137ff6639c7d4acaad07dbcf11a2841cdb0
The LineBreakConfig instance in the StaticLayout is null as default.
Because the LineBreakConfig in StaticLayout was not initialized, the null instance was brought to PrecomputedText and caused the function PrecomputedText.Builder#checkResultUsable to return UNUSABLE.
Bug: b/220992481
Test: atest StaticLayoutTest; atest StaticLayoutPerfTest
Change-Id: I93bcb6ebc35344e34e9bb8a24df375aa7b3a8d81