Commit Graph

666 Commits

Author SHA1 Message Date
Chet Haase
280d250c70 am 956b23f4: am a0364e23: Merge "Fix infinite recursion in hashcode of Spannables" into klp-dev
* commit '956b23f4e3b9cac88ea4627bbe4783b165beec03':
  Fix infinite recursion in hashcode of Spannables
2013-10-04 15:18:56 -07:00
Chet Haase
a0364e2360 Merge "Fix infinite recursion in hashcode of Spannables" into klp-dev 2013-10-04 22:12:09 +00:00
Raph Levien
a488c79605 am 2a32771a: am 24871f63: Merge "Fix Text appears on top of existing text when composing in gmail." into klp-dev
* commit '2a32771ace5250ec919a08da688e2d6c91e5c132':
  Fix Text appears on top of existing text when composing in gmail.
2013-10-04 15:10:13 -07:00
Chet Haase
1d3c4b396a Fix infinite recursion in hashcode of Spannables
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
2013-10-04 07:24:19 -07:00
Raph Levien
63b3eb6523 Fix Text appears on top of existing text when composing in gmail.
Fix for bug 6473708. This patch changes from "last update wins" to
merging together the change regions, in the logic of deciding which
blocks need to be updated for painting, so that when there are multiple
changes batched for a draw, they're all taken into account.

Change-Id: I183d453c436125e5efec7031b4d61b43989653f9
2013-10-03 14:28:54 -07:00
Raph Levien
12618bf7f5 am 7c1b1087: Merge "Fix for "Can\'t place cursor after combining accent"" into klp-dev
* commit '7c1b10872f3d57b3afdb0f070fcf602e4d72df37':
  Fix for "Can't place cursor after combining accent"
2013-09-20 16:31:22 -07:00
Raph Levien
7c1b10872f Merge "Fix for "Can't place cursor after combining accent"" into klp-dev 2013-09-20 23:27:57 +00:00
Raph Levien
373b7a8d4e Fix for "Can't place cursor after combining accent"
This patch fixes behavior where attempting to place the cursor at
the end of a string where the last character is a combining accent
actually placed it before that accent. This was especially annoying
for editing Thai text, because it made it difficult to delete a
trailing tone mark.

Fixes bug 8947569 "Can't place cursor after combining accent" and bug
10398332 "[Thailand] Thai Language(IME) -- Can't delete Thai tone mark
while writing message"

Change-Id: Ida1933c8f0ab6cdb0200db39891e9389e4bdba86
2013-09-20 15:21:47 -07:00
Chet Haase
6736d380b7 am bdb61865: Merge "Add equals() and hashcode() to SpannableString" into klp-dev
* commit 'bdb6186580875982dd1a537b6c935922d0e62fe3':
  Add equals() and hashcode() to SpannableString
2013-09-20 11:24:49 -07:00
Chet Haase
9b985721da Add equals() and hashcode() to SpannableString
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
2013-09-19 17:18:55 -07:00
Raph Levien
954f0d7b77 am ba1abbba: Merge "Revert "Revert "Take the input device into account for meta state""" into klp-dev
* commit 'ba1abbba1f140f4be5956ade8ffd4ef4b3f9ffe0':
  Revert "Revert "Take the input device into account for meta state""
2013-09-18 13:42:41 -07:00
Raph Levien
14f10e5d5f Revert "Revert "Take the input device into account for meta state""
This reverts commit 3954fd9a05, which
is equivalent to re-applying 8a1597b396.

The change ("Take the input device into account for meta state") was
valid but caused CTS test failures because the test was wrong. The
test injected a key event with the meta state missing. This faulty
test was masked by the old toggle behavior.
2013-09-18 13:01:11 -07:00
Raph Levien
21b0c88b3c am c540f8e9: Merge "Revert "Take the input device into account for meta state"" into klp-dev
* commit 'c540f8e9d704414a06f7a5b4ade1c713042f8c38':
  Revert "Take the input device into account for meta state"
2013-09-18 12:46:57 -07:00
Raph Levien
3954fd9a05 Revert "Take the input device into account for meta state"
This reverts commit 8a1597b396. That
commit broke some of the handling of meta state, which in turn caused
CTS test failures, notably bug 10210151 (CTS:
android.text.method.cts.BaseKeyListenerTest#testBackspace_withSendKeys
is failing on KLP).

So this revert fixes those test failures, but leaves bug 8303489
(Pressing shift on the hardware keyboard messes with unrelated
keypresses, including virtual ones) still present. We'll plan to
address that in a future release.

Change-Id: Iea42c643b6d08f33cbd2ed1747e8de3b5f8116a6
2013-09-18 11:03:02 -07:00
Raph Levien
dcb2c68fd1 am 7558ec40: Merge "Fix for AIOBE at android.text.AndroidBidi.directions" into klp-dev
* commit '7558ec405f67b59afbf6089d13928cfdb2f950ff':
  Fix for AIOBE at android.text.AndroidBidi.directions
2013-09-12 21:36:57 -07:00
Raph Levien
68669a42fb Fix for AIOBE at android.text.AndroidBidi.directions
This fixes bug 9900288: Multiple apps crashing; AIOBE at
android.text.AndroidBidi.directions.

The AndroidBidi.directions() method was not correctly handling the case
of a run of length 0, causing ArrayIndexOutOfBoundsException. This
patch simply avoids accessing the levels array in that case.

Change-Id: I036a85b7792ea3364725a87033ca74b94f0e93a1
2013-09-12 16:21:39 -07:00
Brian Carlstrom
61dbdabaf7 am 98c9491f: am 39e885dc: Merge "Make MeasuredText.sCached field final"
* commit '98c9491f4d0854c4ba2de2071dee2548d572e6d0':
  Make MeasuredText.sCached field final
2013-08-29 22:06:57 -07:00
Brian Carlstrom
d4f4526cb4 Make MeasuredText.sCached field final
Change-Id: Id3be64c48be1bcf55ac1a4b00b76a40861bf2f61
2013-08-29 01:32:13 -07:00
Elliott Hughes
f9818d33f9 Fix NPE in DateFormat.is24HourFormat.
In some cases, we end up being called by code that doesn't have a valid
Context. It got away with this historically because it wasn't formatting
times (just dates), so it never went down a path that tried to query the
user's 12/24-hour preference. This patch just ensures that we don't try
to get the preference unless we actually need it.

Bug: 10339015

(cherry picked from commit 8d8ef00c82)

Change-Id: If074a67fa52943c0ec7bb5c5bbe5a11f54fb1f97
2013-08-16 14:53:26 -07:00
Elliott Hughes
ae73645241 am 2a8be3cf: am ecdf20d4: Merge "Fix NPE in DateFormat.is24HourFormat."
* commit '2a8be3cf5ebabbbb0c42d946f28cfe33d5653be6':
  Fix NPE in DateFormat.is24HourFormat.
2013-08-16 14:20:50 -07:00
Elliott Hughes
8d8ef00c82 Fix NPE in DateFormat.is24HourFormat.
In some cases, we end up being called by code that doesn't have a valid
Context. It got away with this historically because it wasn't formatting
times (just dates), so it never went down a path that tried to query the
user's 12/24-hour preference. This patch just ensures that we don't try
to get the preference unless we actually need it.

Bug: 10339015
Change-Id: I2df466d85cdeba14dbf882498808cbad9bbb57f4
2013-08-16 11:56:35 -07:00
Elliott Hughes
2fe5e27db8 am 8a196065: am 82461951: Merge "DateUtils should use the user\'s 12/24-hour preference, not the locale\'s."
* commit '8a196065992a6b2df690467075ef644131465d76':
  DateUtils should use the user's 12/24-hour preference, not the locale's.
2013-08-14 15:33:07 -07:00
Elliott Hughes
12285f3d9f DateUtils should use the user's 12/24-hour preference, not the locale's.
Bug: 10312832

(cherry picked from commit f0b79aeed3)

Change-Id: I0d78725d47009553f9003ccfba06f70f178a6ec1
2013-08-14 15:27:17 -07:00
Elliott Hughes
f0b79aeed3 DateUtils should use the user's 12/24-hour preference, not the locale's.
Bug: 10312832
Change-Id: If23c124cf8442988de5feccb6f2c40b808a2eb89
2013-08-14 15:12:43 -07:00
Amith Yamasani
d8415f4bf0 Developer option to force RTL layout
Make sure screen layout changes are taken into account in Configuration diffs.
Initialize the SystemProperty from Global settings on startup of
ActivityManagerService.

TextUtils checks the override flag to decide if the default layout direction
should be forced to RTL.

Bug: 10244047
Change-Id: I23a2583d790a355060d0d898ba44e5f7dc896b46
2013-08-08 13:42:02 -07:00
Elliott Hughes
89a8250e24 am 710f3e2c: am 60ae2617: Merge "If frameworks wants ASCII casing, it should explicity ask for it."
* commit '710f3e2cc6bc2cdc2f2cddb2190823ea31efd52a':
  If frameworks wants ASCII casing, it should explicity ask for it.
2013-08-02 17:58:33 -07:00
Elliott Hughes
cb64d43062 If frameworks wants ASCII casing, it should explicity ask for it.
http://elliotth.blogspot.com/2012/01/beware-convenience-methods.html

Bug: https://code.google.com/p/android/issues/detail?id=58359
Change-Id: Iaab02e718a7be7bda22e626dca05d79bfd2a8fc4
2013-08-02 15:12:32 -07:00
Elliott Hughes
efaad3e2c6 resolved conflicts for merge of a35ec14f to master
Change-Id: Ib2eb18fe6df2e404d0bf739b300fc200ca81f539
2013-07-25 10:36:59 -07:00
Elliott Hughes
6139e64cd6 Switch DateUtils.formatDateRange over to an icu4c-based implementation.
Bug: 7289514
Change-Id: Ia382f49aa23737bde91b7891d95545da084ec57c
2013-07-24 14:46:31 -07:00
Fabrice Di Meglio
ff4ea79877 Merge "Fix bug #9073962 - Carret is still on the left with an empty EditText in Arabic Locale" 2013-06-19 22:12:50 +00:00
Fabrice Di Meglio
e631889e1a Fix bug #9073962 - Carret is still on the left with an empty EditText in Arabic Locale
- fix StaticLayout special case with empty string or new line

Change-Id: Icb51feedce49db661ed17b6907eb0db83d0b763c
2013-06-19 14:45:13 -07:00
Scott Main
2887271ff3 am 8303a203: am 94ba190e: am de04dfb6: Merge "some extra docs for TextDirectionHeuristic" into jb-mr2-dev
* commit '8303a2036efd93eecda6da1e481e1659a40ca12e':
  some extra docs for TextDirectionHeuristic
2013-06-17 22:14:28 -07:00
Scott Main
8303a2036e am 94ba190e: am de04dfb6: Merge "some extra docs for TextDirectionHeuristic" into jb-mr2-dev
* commit '94ba190ebbd4fe7f8933d531cce7b4be8e04f287':
  some extra docs for TextDirectionHeuristic
2013-06-17 22:13:17 -07:00
Scott Main
e442662330 some extra docs for TextDirectionHeuristic
Change-Id: I8ceac72a76a29bde0e25ed418110a6e4120654e3
2013-06-17 19:05:29 -07:00
Elliott Hughes
f0542ee466 am 704dfbfe: am 48fa06f3: am f6a67139: Merge "Correct Date format for el_GR, sv_SE and tr_TR locales"
* commit '704dfbfec40b4a51000e244a98e8723bb00ba321':
  Correct Date format for el_GR, sv_SE and tr_TR locales
2013-06-17 13:43:53 -07:00
Elliott Hughes
48fa06f34f am f6a67139: Merge "Correct Date format for el_GR, sv_SE and tr_TR locales"
* commit 'f6a671394ca3d269835d5f5b882b46f9539e9a96':
  Correct Date format for el_GR, sv_SE and tr_TR locales
2013-06-17 13:38:59 -07:00
howardb
5ad2451f9f Correct Date format for el_GR, sv_SE and tr_TR locales
Amend DateFormat.getDateFormat to CLDR data from icu4c
instead of locale specific resource entries which are incorrect
for several locales.

No CTS tests are added as they require changing the locale which
is not currently possible.

Bug: https://code.google.com/p/android/issues/detail?id=56385

Change-Id: Ibd11c7fd9b595e19a3e2bf508e1585aa50067e03
Signed-off-by: howardb <android@howardb.com>
2013-06-17 13:35:29 -07:00
Raph Levien
5d0db65e73 am 38272ad2: am 21403857: Merge "Fix for bug 8911390 RTL text alignment is changed ..." into jb-mr2-dev
* commit '38272ad2b1d3ab90c83fcd74139503fcd3148a19':
  Fix for bug 8911390 RTL text alignment is changed ...
2013-05-15 13:49:46 -07:00
Raph Levien
38272ad2b1 am 21403857: Merge "Fix for bug 8911390 RTL text alignment is changed ..." into jb-mr2-dev
* commit '214038571992a4ba65531297bf4a89af9a0b5fd4':
  Fix for bug 8911390 RTL text alignment is changed ...
2013-05-15 13:35:06 -07:00
Raph Levien
01524651cb Fix for bug 8911390 RTL text alignment is changed ...
The predicate for detecting whether text was right aligned was missing
some cases - it was correctly sensing RIGHT or OPPOSITE aligned text
in the LTR case, but was missing NORMAL for rtl. This patch just adds
that case.

Change-Id: I06691e7122e1ca91d66299cf0d7ef1f8a476a44b
2013-05-14 14:00:07 -07:00
Victoria Lease
176498b5ea Merge "enable selection of Linkify-annotated text" 2013-05-07 18:08:09 +00:00
Elliott Hughes
ba8d2e58f8 am c2639e58: am 0bb4c701: Merge "Use ICU for getDateFormatOrder."
* commit 'c2639e58fa5724c06a1d910ad76aebed647b4ba2':
  Use ICU for getDateFormatOrder.
2013-04-30 12:17:25 -07:00
Elliott Hughes
c2639e58fa am 0bb4c701: Merge "Use ICU for getDateFormatOrder."
* commit '0bb4c701bab0f69172417b7a511acb6bdfa052db':
  Use ICU for getDateFormatOrder.
2013-04-30 12:15:00 -07:00
Elliott Hughes
edd6f9e688 Use ICU for getDateFormatOrder.
Bug: 7207103
Change-Id: I680bb727cb74cd4b050f237f036d9e696201fc0b
2013-04-30 11:09:53 -07:00
Victoria Lease
cd0b01327b enable selection of Linkify-annotated text
Bug: 8515643
Change-Id: I74e8b9e45e2645ec6287abd1cd6e47d383c4f3e0
2013-04-29 14:42:01 -07:00
Fabrice Di Meglio
16cea16570 am b241f60f: am c3d0a81a: Merge "Fix bug #8656546 API REVIEW: android.text.bidi / android.text" into jb-mr2-dev
* commit 'b241f60fe76677d106d472d4118d1e6959563331':
  Fix bug #8656546 API REVIEW: android.text.bidi / android.text
2013-04-20 21:37:04 -07:00
Victoria Lease
a5d3459316 am 7e170b63: am bcf3ec96: Merge "do not attempt to parcel unknown ParcelableSpans" into jb-mr2-dev
* commit '7e170b632147da55f93864223419a9f7fa651410':
  do not attempt to parcel unknown ParcelableSpans
2013-04-20 21:36:55 -07:00
Fabrice Di Meglio
8c08fc9a86 Fix bug #8656546 API REVIEW: android.text.bidi / android.text
- clean BidiFormatter APIs

Change-Id: I8591ce3c3e8f2de4138698aa14ddb38b933de5e1
2013-04-19 17:34:01 -07:00
Victoria Lease
577ba5354b do not attempt to parcel unknown ParcelableSpans
Bug: 8639983
Change-Id: I27335f6e9d3a0671ecdd161fdbf765785ef8065d
2013-04-19 13:38:34 -07:00
Fabrice Di Meglio
98c8c890aa am 4febbf35: am bd286426: Merge "Fix bug #8599905 Add simple BidiFormatter getInstance() helper API" into jb-mr2-dev
* commit '4febbf35011ecb30796c78cf3e159ef781564f45':
  Fix bug #8599905 Add simple BidiFormatter getInstance() helper API
2013-04-11 17:50:26 -07:00