From 69865bd6860a97793a06523a48dfe6472e9b7562 Mon Sep 17 00:00:00 2001 From: Gilles Debunne Date: Wed, 9 May 2012 11:12:03 -0700 Subject: Minor changes in SpellCheckSpan pool management in SpellChecker Bug 6464190 The 'inProgress' flag is set to false when the SpellCheckSpan starts to get used (instead of a less intuitive when it is removed). Pool recycling in handled by onSpellCheckSpanRemoved, called from the TextView's SpanWatcher, when a SpellCheckSpan is removed for any reason (from the SC code or due to text editing). The other change is that Sentence SC now correctly removes the span from the text (and hence recycles it in the pool). Change-Id: If8b433fd5e41d4dc0304a127ebcc088ea1eecaa7 --- core/java/android/widget/TextView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/java/android/widget/TextView.java') diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 555c974360fc..277b26e7e89d 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -7214,7 +7214,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener if (mEditor != null && mEditor.mSpellChecker != null && newStart < 0 && what instanceof SpellCheckSpan) { - mEditor.mSpellChecker.removeSpellCheckSpan((SpellCheckSpan) what); + mEditor.mSpellChecker.onSpellCheckSpanRemoved((SpellCheckSpan) what); } } -- cgit v1.2.3