diff options
author | 2013-03-19 01:15:12 -0700 | |
---|---|---|
committer | 2013-03-19 01:15:12 -0700 | |
commit | 3c5b7d4814c25f1b514fb7677d1d20ba1fb2cd22 (patch) | |
tree | 7726d384e0de2b5ce0a5981ebdb3bcf7e9106587 /java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java | |
parent | 3b93f0e9a7fa5c26c016288b1fed63365ae0fa58 (diff) | |
parent | 6d90a10a343723b8613fd22d323c586ecc33b284 (diff) | |
download | latinime-3c5b7d4814c25f1b514fb7677d1d20ba1fb2cd22.tar.gz latinime-3c5b7d4814c25f1b514fb7677d1d20ba1fb2cd22.tar.xz latinime-3c5b7d4814c25f1b514fb7677d1d20ba1fb2cd22.zip |
am 6d90a10a: am 0cc0544a: Merge the dictionary pack in Latin IME.
* commit '6d90a10a343723b8613fd22d323c586ecc33b284':
Merge the dictionary pack in Latin IME.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java index 63f46b79e..9a1114f7f 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java @@ -16,6 +16,7 @@ package com.android.inputmethod.latin.spellcheck; +import android.os.Binder; import android.text.TextUtils; import android.util.Log; import android.view.textservice.SentenceSuggestionsInfo; @@ -133,22 +134,27 @@ public final class AndroidSpellCheckerSession extends AndroidWordLevelSpellCheck @Override public SuggestionsInfo[] onGetSuggestionsMultiple(TextInfo[] textInfos, int suggestionsLimit, boolean sequentialWords) { - final int length = textInfos.length; - final SuggestionsInfo[] retval = new SuggestionsInfo[length]; - for (int i = 0; i < length; ++i) { - final String prevWord; - if (sequentialWords && i > 0) { + long ident = Binder.clearCallingIdentity(); + try { + final int length = textInfos.length; + final SuggestionsInfo[] retval = new SuggestionsInfo[length]; + for (int i = 0; i < length; ++i) { + final String prevWord; + if (sequentialWords && i > 0) { final String prevWordCandidate = textInfos[i - 1].getText(); // Note that an empty string would be used to indicate the initial word // in the future. prevWord = TextUtils.isEmpty(prevWordCandidate) ? null : prevWordCandidate; - } else { - prevWord = null; + } else { + prevWord = null; + } + retval[i] = onGetSuggestionsInternal(textInfos[i], prevWord, suggestionsLimit); + retval[i].setCookieAndSequence(textInfos[i].getCookie(), + textInfos[i].getSequence()); } - retval[i] = onGetSuggestions(textInfos[i], prevWord, suggestionsLimit); - retval[i].setCookieAndSequence(textInfos[i].getCookie(), - textInfos[i].getSequence()); + return retval; + } finally { + Binder.restoreCallingIdentity(ident); } - return retval; } } |