diff options
author | 2014-02-26 14:39:51 +0900 | |
---|---|---|
committer | 2014-03-04 14:31:47 +0900 | |
commit | 32c6d4caea8e1391804f405d78e33e5c0fe89b4b (patch) | |
tree | 2c396147bb5d759c52767c922e7d1a50596d02f9 /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | |
parent | f2b0829aa1b05bae43ddde11407c7d8b29355f8f (diff) | |
download | latinime-32c6d4caea8e1391804f405d78e33e5c0fe89b4b.tar.gz latinime-32c6d4caea8e1391804f405d78e33e5c0fe89b4b.tar.xz latinime-32c6d4caea8e1391804f405d78e33e5c0fe89b4b.zip |
[IL111] Remove a member.
...and improve encapsulation and readability.
Bug: 8636060
Change-Id: I36407630b307df0721ea7fdb7e7a22cdf2b018b3
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index f2f9f1e68..8b83155ea 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -227,17 +227,16 @@ public final class InputLogic { } } - // TODO: stop relying on mApplicationSpecifiedCompletions. The SuggestionInfo object - // should contain a reference to the CompletionInfo instead. - if (settingsValues.isApplicationSpecifiedCompletionsOn() - && mLatinIME.mApplicationSpecifiedCompletions != null - && index >= 0 && index < mLatinIME.mApplicationSpecifiedCompletions.length) { + // TODO: We should not need the following branch. We should be able to take the same + // code path as for other kinds, use commitChosenWord, and do everything normally. We will + // however need to reset the suggestion strip right away, because we know we can't take + // the risk of calling commitCompletion twice because we don't know how the app will react. + if (SuggestedWordInfo.KIND_APP_DEFINED == suggestionInfo.mKind) { mSuggestedWords = SuggestedWords.EMPTY; mSuggestionStripViewAccessor.setNeutralSuggestionStrip(); keyboardSwitcher.updateShiftState(); resetComposingState(true /* alsoResetLastComposedWord */); - final CompletionInfo completionInfo = mLatinIME.mApplicationSpecifiedCompletions[index]; - mConnection.commitCompletion(completionInfo); + mConnection.commitCompletion(suggestionInfo.mApplicationSpecifiedCompletionInfo); mConnection.endBatchEdit(); return; } |