| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.
This is a resubmit of ag/12929664 with some APIs excluded that caused
test failures; see bugs 171886397, 171888296, 171864568.
APIs excluded:
Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord;
Landroid/os/Process;->myPpid()I
Landroid/os/SharedMemory;->getFd()I
Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I
Bug: 170729553
Test: Treehugger
Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
|
| |
|
|
|
|
|
|
|
| |
This reverts commit 72f07d6a8a32db4a0dedd7682a0b3385be2b9cd6.
Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397
Bug: 171886397
Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
|
| |
|
|
|
|
|
|
|
|
| |
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.
Bug: 170729553
Test: Treehugger
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Those annotations could be inferred by some tools (like Kotlin), but the
https://checkerframework.org/ doesn't check inherited annotations
complaining about all equals() invocations that get nullable argument.
The change was generated by running
find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /'
in the frameworks/base directory and by automatically adding and
formatting required imports if needed. No manual edits.
Bug: 170883422
Test: Annotation change only. Should have not impact.
Exempt-From-Owner-Approval: Mechanical change not specific to any component.
Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
|
| |
|
|
|
|
|
|
| |
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.
Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I288969b0c22fa3a63bc2e71bb5009fe4a927e154
|
| |
|
|
|
|
| |
Bug: 73359036
Test: atest SpannableStringTest SpannableStringBuilderTest
Change-Id: Idfaf71cde914d5c5325a6c6a3bfcda20ebee62f2
|
| |
|
|
|
|
|
|
| |
This API is necessary for identifying the cursor locations.
Bug: 112327179
Test: atest android.graphics.cts.PaintTest
Change-Id: Ief6770bd622a296ae356094fe3ce58e9c4371088
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For packages:
android.text.util
android.text.style
android.text.method
android.text.format
android.text
This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.
Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@
Bug: 110868826
Test: m
Change-Id: I9afbd4ca8826c37cb70db43252e39b9a674e5ae0
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The root of this bug was in the fact that Selection.removeSelection
removes two spans, the start index and end index of the selection.
Each span removal triggers Editor#onSpanRemoved, which in turn tries
to set a selection. This meant that if we started with selection
(100, 120), then removeSpan(start) was called, so we had (-1, 120),
then the onSpanRemoved code tried to set a selection so set it to
(120, 120), then removeSpan(end) was called, ending up in (120, -1).
There are two stages to this fix
1. A lot of our code assumes that when either start or end selection
are larger than -1, both are valid. Therefore when we have one of them
out of sync, we crash. Fixed this assumption in all the places I found
2. We didn't have a mechanism to use FLAG_INTERMEDIATE when removing
spans, only when adding them, so this CL adds a remove with flags. This
allows us to not trigger onSpanRemoved when only one of the selection
indexes is removed.
Because this is an added method to an interface, the default just
calls the existing method. The new method is implemented in
SpannableStringInternal and SpannableStringBuilder to read
FLAG_INTERMEDIATE and avoid sending a spans changed event.
Selection.removeSelection then uses FLAG_INTERMEDIATE when removing
the first of the two selection spans.
Note that 2. would be enough to fix the current bug, but we want to
avoid other implementations of Spannable from crashing in the wild.
In general, it seems like a good idea to verify both selection indexes
are valid whenever they are used.
Bug: 72101848
Test: atest FrameworksCoreTests:SpannableStringBuilderTest
Test: atest FrameworksCoreTests:SpannableStringTest
Test: atest CtsWidgetTestCases:TextViewTest
Test: atest CtsWidgetTestCases:EditTextTest
Test: atest android.text.cts.SelectionTest (note new test as well)
Test: atest android.view.inputmethod.cts.BaseInputConnectionTest
Test: atest android.text.DynamicLayoutTest
Change-Id: I0d647fad152d0bef0f2115a46c3d17ebd8642281
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Update SpannableStringBuilder, SpannedString and SpannableString classes
so that they don’t enforce paragraph constraint for copy constructors.
If a paragraph constraint is not satisfied for a span, that span is not
copied. Before this change it would throw an exception.
Test: New tests added for SpannableStringBuilder and SpannableString
cts-tradefed run cts -m CtsTextTestCases
Bug: 36511794
Change-Id: I62abf08a8d4fe7e342ed97b8e8c3a577a9397e39
|
| |\
| |
| |
| |
| |
| | |
am: 1764efad93
Change-Id: I33b2f25901330e79bbc166a318f71d5124d0b332
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Sort function was broken for odd number of elements.
Test: Added new CTS tests.
Bug: 33567024
Change-Id: I7457dee6ac279c6aab5b92431b347dc1f16a8fa0
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Add cached int buffers for sorting.
Test: All CtsTextTestCases
Bug: 33609774
Change-Id: Ice0b3c3fffc541b26aca94c93fd01e30e13efe2e
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All draw* calls in Canvas are regular JNI
All draw* calls in DisplayListCanvas are FastNative
Unifies Canvas JNI on nMethodName naming
CanvasPerf results before:
INSTRUMENTATION_STATUS: basicViewGroupDraw_min=12492
INSTRUMENTATION_STATUS: recordSimpleBitmapView_min=13912
and after:
INSTRUMENTATION_STATUS: basicViewGroupDraw_min=11945
INSTRUMENTATION_STATUS: recordSimpleBitmapView_min=13318
Test: refactor, makes & boots
Change-Id: I06000df1d125e17d60c6498865be7a7638a4a13e
|
| |
|
|
|
|
|
|
|
|
| |
During the offset calculation for selection, SpannableStringBuilder
had an overflow while multiplying two int values. This CL uses long to
calculate the multiplication, and also checks for overflow after
casting the final result into int again.
Bug: 29108549
Change-Id: I11eff4677916701074b38bc5214730fe704707c4
|
| |
|
|
|
|
|
|
|
| |
This CL fixes the case where SpannableStringBuilder.getSpans call
forgot to check the case where sort is false, and the span priority
is not set.
Bug: 26761571
Change-Id: I3a548b9c01768e6977a0ff15d6ecb8ca9ec3c075
|
| |
|
|
|
|
|
|
|
|
|
| |
SpannableStringBuilder used to return the result of getSpans in the
order of start indices because of the interval tree it uses. However,
style spans has to be applied in the order of insertion to get
predictable results. Sorted the results of getSpans ordered first by
priority flag and then by insertion time. Moreover improved the
performance of SpannableStringInternal copy constructor.
Bug: 26240132
Change-Id: I0b0fa7bb30a3bd9ca37dedca66d8993718586027
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
When SpannableStringBuilder.replace is called with a source text that
contains a span with SPAN_PARAGRAPH flag, the code tries to retain the
spans. However when the paragraph boundary constraint is not satisfied,
setSpan method throws an exception. Updated the rule as: if the source
text has a span with SPAN_PARAGRAPH flag check if it can be copied into
the target. If not, discard the span. Also updated the JavaDoc for
Spanned and Editable.
Bug: 22521443
Change-Id: Ie8541e00bfdf5b8b0115ad7b26cb9f83a6a3ee55
|
| |
|
|
|
|
|
|
|
|
| |
Previously, when getSpans() was called with a null parameter, an
unintentional NullPointerException would be thrown.
Now, we explicitly return an empty array of Objects.
Bug: 19805521
Change-Id: I52f3ae08c2bcf62f6a4d0c01f0fe08ad1134abb8
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use span properties to detect:
* Composing text - don't record undo operations
* Completing a composition - record an insert undo operation
* Canceling a composition - don't record
Save the composition state on parcel/unparcel.
Stop using begin/end batch edit to try to detect when a TextWatcher
is modifying the text. IMEs trigger multiple InputFilter passes in
a single batch edit. Use SpannableStringBuilder to determine when
we're in a TextWatcher callback because it is the authority on that
state.
Fix a bug in undo manager where it doesn't forget undos correctly if
there are more than one in the stack.
Bug: 19332904
Change-Id: Iaa9b0b2a7bf6683302cc85e7616e5d5fcc9fa202
|
| |
|
|
|
|
|
|
| |
This CL greatly improves the speed of SpannableStringBuilder by storing
the spans as an interval tree with binary search.
Bug: 7404182
Change-Id: I2540b2cfe8aef128337e63829479660ba51e62b5
|
| |
|
|
|
|
| |
span that is applied to the appended text.
Change-Id: Ibdc4a71346e5691bcfe6af23f34beff69d642908
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The dirFlags and bidiFlags enums are distinct, and have different
meanings. The former is a determined direction for a run of text, while
the latter is a request for the bidi algorithm. They have been used
interchangeably, and this has caused some problems, notably running the
bidi algorithm needlessly when the direction for a run is already
determined.
This patch cleans up the confusion, by always naming each occurrence
explicitly "boolean isRtl" or "int bidiFlags" (the previous code often
just used "int flags", which added to the confusion), and converts
between the meanings when a function takes an isRtl argument but passes
it to another function expecting bidiFlags.
Fixes b/15089607 Clean up bidi flag mess
Change-Id: I410b6604376e853dd12c255e7f5a9d2b9a310dd9
|
| |
|
|
|
|
|
|
|
|
| |
SpannableStringBuilder should throw an exception when the
parameters to #insert and related methods are in the wrong
order.
We'll have to reopen b/9570771 and deal with it separately.
Bug: 14965397
Change-Id: I01847e0010d23f98ad3def8ba030d36570528900
|
| |
|
|
|
|
| |
Bug:13028925
Change-Id: I0a9301248b10a339afbdc5e4ffe3310ac4fa1fb7
|
| |
|
|
|
|
|
|
|
|
|
| |
ExtractedText#partialStartOffset and #partialEndOffset are
from the app, that sets it as it sees fit. We need to
validate them so that we don't crash.
Still emit a warning if this is the case, as this is
not expected.
Bug: 9570771
Change-Id: Id9d6babd1620da39bf0e454b14d7ce716bd9d9d3
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An app created a SpannableStringBuilder, one of which's spans was the
instance of the string builder itself (that is, the builder contained a span
that was the builder). This caused infinite recursion in the hashcode()
method because it computes a hash from its fields, including all of its spans.
The fix detects the case where a span equals the current instance and
noops the computation on that span. A similar adjustment was made to equals()
to avoid the same recursion problem.
Issue #11051658 StackOverflowError in android.text.SpannableStringBuilder.hashCode
Change-Id: I742687ab32d81ac51c4b9135f698cf5e96a1d295
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ActionBar uses a transition to animate text changes. This transition
depends on testing the equality of start/end text values in CharSequence
objects. Without equals(), SpannableString will return false for objects
whose references are different, but whose text is exactly the same.
This CL adds the equals() method, and the accompanying hashcode method,
to ensure that two Spanned implementations will always be equal
if their text and span data are equal.
Issue #10760075 Wrong unread count in actionbar
Change-Id: I5e77d40dd302eca035e8c56d40f3cd0aef8e6424
|
| |
|
|
|
|
|
|
|
| |
their dependencies
- remove the ICU related methods and update the methods using the "reserved" argument
- update to CTS in another CL too
Change-Id: I5509736568c342d9d17bfeafc17951117ab5d3cc
|
| |
|
|
| |
This reverts commit 6d9fe5bd22b531bfce69b146254a4791c76acddc.
|
| |
|
|
|
|
| |
See bug #7623824
Change-Id: Ie2f9422821f6dcc73c99e8695f448e966b587b1d
|
| |
|
|
|
|
|
|
|
| |
Bug 6448052
The empty EXCLUSIVE removal condition was incorrect.
Also changed the unit test the didn't catch this problem.
Change-Id: I5576d830cdfa6cc3716c878fb698695a2978b296
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Bug 6343982
Finally deeply understood the meaning of the POINT and MARK flags.
Updated the Spanned documentation to reflect this.
Updated tests to come.
Change-Id: I400d56b7b4929bc1e7eb4f0497d8e081ee23682e
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Bug 6344997
The early exit we used to do when both replaced and replacement
strings were empty has been added back.
Only this time it correctly also makes sure no spans from the
replacement string would get added with a 0-length.
Change-Id: Ifc38a7e3619c57aa7647c0a8e63d7627d86f1036
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Found while tracking bug 6326750
A bug in the SpannableStringBuilderSpanTest JUnit CTS test was hiding
this problem.
Also removed the instanceof test on SpanWatcher. All spans, including
those implementing this interface should be copied.
Change-Id: I5233818fb0c08ab56477720db932a5be453e88ee
|
| |
|
|
|
|
|
|
|
| |
Bug 6331765
A call to replace was previously not sending any span modification to the
attached span watchers.
Change-Id: Ic9e4a8ac0210e422961adfb18e205d80531889fe
|
| |
|
|
|
|
| |
Bug 6312196
Change-Id: I9cece36b40d8948e0e85bd433954818991009ad5
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a new version of CL 179343 which had to be reverted.
This problem of the previous CL is that the ComposingSpan that
was part of the replacement text was correctly added during the
replace but was immediately removed because it had a zero-length
size.
Swapping the add and remove blocks solves the problem.
The new non-zero length enforcement also revealed a bug in the
spell checker where we were creating useless range spans.
Change-Id: I59cebd4708af3becc7ab625ae41bc36837f1a1cf
|
| |\ |
|
| | |
| |
| |
| |
| |
| | |
No change in the functionnalities.
Change-Id: I009acc75b4f70e65a810cdc67505bc0b13e627b2
|
| |/
|
|
|
|
|
|
|
|
| |
Bug 6300658
This change reveals a weird race condition where sometimes the
text is entered twice. Adding a debugger slows down everything,
and the problem is no longer reproducable. Reverting for now.
This reverts commit ebd9a23817052c4d2aaa1058efa2b80b08003d4a.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The original method was adding a suspicious space that was eventually
removed with a series of 3 calls to change.
This should not be necessary. I have tested this with various gap
positions and lengths, for all replace cases I could think of.
The test can not be added to the CTS as it would need to expose the
internal resizeFor and moveGapTo methods.
Change-Id: I194457fbcfd758fa69a7f380665cfd5ae4d3f1d4
|
| |
|
|
|
|
|
|
|
|
|
| |
Made TextWatcher notification process clearer by moving it to
a single place, with methods renamed.
Also reverts CL 177544: we cannot broadcast span chages just yet,
the layout has not been reflown. A future CL will change this
behavior to make sure span changes are correctly broadcasted.
Change-Id: I9ef88dce91dff5f5f45e2845d5b3f18f1c853de3
|
| |
|
|
|
|
| |
More consistent with the SpanWatcher design.
Change-Id: I3a1e4d92fb422f4cc689dabcdef1473d93fef5ad
|
| |
|
|
| |
Change-Id: I2f4e7a8b0022d76bc30199ff80c2fe637dbe03ef
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Removed the Runnable in SpellChecker, spell check is triggered at the end
of updateSpellCheckSpans instead of when a new SpellCheckSpan is created.
Cache the spans in updateSpellCheckSpans to limit the calls to getSpans.
When typing, every new letter in a word will create a SpellCheckSpan
(this is needed in case the user taps somewhere else on the screen)
The SpellCheckSpans are pooled in SpellChecker to limit unnecessary new
SpellCheckSpan creation.
Minor optimization on test order in getSpans to avoid some calculation.
Spell check is not started everytime the selection is changed (would be
triggered when the insertion handle is moved). Explicitely do that only
on tap.
Change-Id: Ibacf80dd4ba098494e0b5ba0e58a362782fc8f71
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
getSpans was called too many times in handleRun. Pre-compute the
subset of intersected spans and iterate over a subset of it instead.
Moving the instanceof test in getSpans after the other tests also
speeds things up a lot.
On a text with ~300 words, all with a span attached, getSpans went down
from 78% to 14% of the CPU usage.
Change-Id: I59bc44f610e9a548e0dcec68b180934da9e5c559
|
| |
|
|
|
|
|
|
|
|
|
| |
New UX interactions (the Paste action is no longer displayed after a delay)
suggestionEnabled flag replaced by existing input type flag.
removeSpans fixed in SpannableStringBuilder to always send notifications
SuggestionSpan handled by TextView instead of SpannableStringBuilder
New span update algorithm to correctly handle edition around word boundaries.
Change-Id: I52c01172f19e595fa512e285a565a3fd97c3c50e
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
SuggestionSpans do not make sense anymore when the text they
refer to is modified. Removed these at the lowest possible common
level: In the SpannableStringBuilder that is used to back the Editable.
This way, IME do not have to care about removing these when they change
text. And they cannot forget to so either.
Also fixed a bug in TextView's paste with multi-item paste text (never
exercised, since we have no source for such a thing).
Change-Id: I08ed921f8c04ffb1a00936a3e554a85ee82f103c
|
| |
|
|
|
|
|
| |
- remove ICU reference in API names
- use a "reserved" int parameter to pass either "0" for Harfbuzz or "1" for "ICU"
Change-Id: I88b4f76feafd203a6999cd7349402fa36a9a4b2a
|