From 4ca16dbd65150359c3884da7cb59a30f19abd4b7 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Sun, 12 Dec 2010 17:58:29 +0900 Subject: [PATCH] Highlight auto corrected word Bug: 3230726 Bug: 3215175 Change-Id: I086324cdab610b50a96d8eb08b81aa89c886ba00 --- java/src/com/android/inputmethod/latin/LatinIME.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index a34d883ba..010473f05 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -633,7 +633,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen if (isSuggestionShown() && isPredictionOn()) { // First get the cursor position. This is required by setOldSuggestions(), so that // it can pass the correct range to setComposingRegion(). At this point, we don't - // have valid values for mLastSelectionStart/Stop because onUpdateSelection() has + // have valid values for mLastSelectionStart/End because onUpdateSelection() has // not been called yet. ExtractedTextRequest etr = new ExtractedTextRequest(); etr.token = 0; // anything is fine here @@ -1339,7 +1339,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen CharSequence typedWord = mWord.getTypedWord(); TextEntryState.backToAcceptedDefault(typedWord); if (!TextUtils.isEmpty(typedWord) && !typedWord.equals(mBestWord)) { - // TODO: Will call InputConnection.commitCorrection() here. + if (ic != null) { + CorrectionInfo correctionInfo = new CorrectionInfo( + mLastSelectionEnd - typedWord.length(), typedWord, mBestWord); + ic.commitCorrection(correctionInfo); + } if (mCandidateView != null) mCandidateView.onAutoCorrectionInverted(mBestWord); }