[CB16] Remove unused stuff

Bug: 13406701
Change-Id: Ib863c5181e1f5d74cfa4458060afc49d1ee8109e
main
Jean Chalard 2014-03-25 18:15:15 +09:00
parent 0de7a6d1a2
commit 05c46f59fd
2 changed files with 5 additions and 37 deletions

View File

@ -38,38 +38,25 @@ public final class LastComposedWord {
// or it may be exactly what the user typed if it's in the dictionary or the IME does not have // or it may be exactly what the user typed if it's in the dictionary or the IME does not have
// enough confidence in any suggestion to auto-correct (auto-correct to typed word). // enough confidence in any suggestion to auto-correct (auto-correct to typed word).
public static final int COMMIT_TYPE_DECIDED_WORD = 2; public static final int COMMIT_TYPE_DECIDED_WORD = 2;
// COMMIT_TYPE_CANCEL_AUTO_CORRECT is used upon committing back the old word upon cancelling
// an auto-correction.
public static final int COMMIT_TYPE_CANCEL_AUTO_CORRECT = 3;
public static final String NOT_A_SEPARATOR = ""; public static final String NOT_A_SEPARATOR = "";
public final ArrayList<Event> mEvents;
public final String mTypedWord; public final String mTypedWord;
public final CharSequence mCommittedWord; public final CharSequence mCommittedWord;
public final String mSeparatorString; public final String mSeparatorString;
public final String mPrevWord; public final String mPrevWord;
public final int mCapitalizedMode; public final int mCapitalizedMode;
public final InputPointers mInputPointers =
new InputPointers(Constants.DICTIONARY_MAX_WORD_LENGTH);
private boolean mActive; private boolean mActive;
public static final LastComposedWord NOT_A_COMPOSED_WORD = public static final LastComposedWord NOT_A_COMPOSED_WORD =
new LastComposedWord(new ArrayList<Event>(), null, "", "", new LastComposedWord("", "", NOT_A_SEPARATOR, null, WordComposer.CAPS_MODE_OFF);
NOT_A_SEPARATOR, null, WordComposer.CAPS_MODE_OFF);
// Warning: this is using the passed objects as is and fully expects them to be // Warning: this is using the passed objects as is and fully expects them to be
// immutable. Do not fiddle with their contents after you passed them to this constructor. // immutable. Do not fiddle with their contents after you passed them to this constructor.
public LastComposedWord(final ArrayList<Event> events, public LastComposedWord(final String typedWord, final CharSequence committedWord,
final InputPointers inputPointers, final String typedWord, final String separatorString, final String prevWord, final int capitalizedMode) {
final CharSequence committedWord, final String separatorString,
final String prevWord, final int capitalizedMode) {
if (inputPointers != null) {
mInputPointers.copy(inputPointers);
}
mTypedWord = typedWord; mTypedWord = typedWord;
mEvents = new ArrayList<Event>(events);
mCommittedWord = committedWord; mCommittedWord = committedWord;
mSeparatorString = separatorString; mSeparatorString = separatorString;
mActive = true; mActive = true;

View File

@ -426,9 +426,8 @@ public final class WordComposer {
// Note: currently, we come here whenever we commit a word. If it's a MANUAL_PICK // Note: currently, we come here whenever we commit a word. If it's a MANUAL_PICK
// or a DECIDED_WORD we may cancel the commit later; otherwise, we should deactivate // or a DECIDED_WORD we may cancel the commit later; otherwise, we should deactivate
// the last composed word to ensure this does not happen. // the last composed word to ensure this does not happen.
final LastComposedWord lastComposedWord = new LastComposedWord(mEvents, final LastComposedWord lastComposedWord = new LastComposedWord(
mInputPointers, mTypedWord.toString(), committedWord, separatorString, mTypedWord.toString(), committedWord, separatorString, prevWord, mCapitalizedMode);
prevWord, mCapitalizedMode);
mInputPointers.reset(); mInputPointers.reset();
if (type != LastComposedWord.COMMIT_TYPE_DECIDED_WORD if (type != LastComposedWord.COMMIT_TYPE_DECIDED_WORD
&& type != LastComposedWord.COMMIT_TYPE_MANUAL_PICK) { && type != LastComposedWord.COMMIT_TYPE_MANUAL_PICK) {
@ -459,24 +458,6 @@ public final class WordComposer {
public void discardPreviousWordForSuggestion() { public void discardPreviousWordForSuggestion() {
mPreviousWordForSuggestion = null; mPreviousWordForSuggestion = null;
} }
public void resumeSuggestionOnLastComposedWord(final LastComposedWord lastComposedWord,
final String previousWord) {
mEvents.clear();
Collections.copy(mEvents, lastComposedWord.mEvents);
mInputPointers.set(lastComposedWord.mInputPointers);
mTypedWord.setLength(0);
mCombinerChain.reset();
mTypedWord.append(lastComposedWord.mTypedWord);
refreshSize();
mCapitalizedMode = lastComposedWord.mCapitalizedMode;
mAutoCorrection = null; // This will be filled by the next call to updateSuggestion.
mCursorPositionWithinWord = mCodePointSize;
mRejectedBatchModeSuggestion = null;
mIsResumed = true;
mPreviousWordForSuggestion = previousWord;
}
public boolean isBatchMode() { public boolean isBatchMode() {
return mIsBatchMode; return mIsBatchMode;
} }