Skip to content

Commit 2428ccb

Browse files
committed
Fix spell checker framework
Change-Id: I281d031259dd220936832668e7a4556473ccb2ce
1 parent 0de2ed3 commit 2428ccb

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

core/java/android/view/textservice/SpellCheckerSession.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,6 @@ private void processTask(ISpellCheckerSession session, SpellCheckerParams scp,
281281
if (DBG) {
282282
Log.w(TAG, "Get suggestions from the spell checker.");
283283
}
284-
if (scp.mTextInfos.length != 1) {
285-
throw new IllegalArgumentException();
286-
}
287284
try {
288285
session.onGetSentenceSuggestionsMultiple(
289286
scp.mTextInfos, scp.mSuggestionsLimit);

core/java/android/widget/SpellChecker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,8 @@ public void parse() {
491491
wordStart = regionEnd;
492492
// TODO: Find the start position of the sentence.
493493
// Set span with the context
494-
final int spellCheckStart = Math.min(
495-
start, Math.max(wordStart, regionEnd - WORD_ITERATOR_INTERVAL));
494+
final int spellCheckStart = Math.max(
495+
0, Math.min(wordStart, regionEnd - WORD_ITERATOR_INTERVAL));
496496
if (regionEnd <= spellCheckStart) {
497497
return;
498498
}

0 commit comments

Comments
 (0)