Merge "Accept a null input attributes for reading settings."

This commit is contained in:
Jean Chalard 2012-06-11 18:18:43 -07:00 committed by Android (Google) Code Review
commit 15c0090e88
2 changed files with 1 additions and 3 deletions

View file

@ -400,8 +400,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final Resources res = getResources(); final Resources res = getResources();
mResources = res; mResources = res;
// TODO: remove the following when it's not needed by updateCorrectionMode() any more
mInputAttributes = new InputAttributes(null, false /* isFullscreenMode */);
loadSettings(); loadSettings();
ImfUtils.setAdditionalInputMethodSubtypes(this, mSettingsValues.getAdditionalSubtypes()); ImfUtils.setAdditionalInputMethodSubtypes(this, mSettingsValues.getAdditionalSubtypes());

View file

@ -188,7 +188,7 @@ public class SettingsValues {
private int createCorrectionMode(final InputAttributes inputAttributes) { private int createCorrectionMode(final InputAttributes inputAttributes) {
final boolean shouldAutoCorrect = mAutoCorrectEnabled final boolean shouldAutoCorrect = mAutoCorrectEnabled
&& !inputAttributes.mInputTypeNoAutoCorrect; && (null == inputAttributes || !inputAttributes.mInputTypeNoAutoCorrect);
if (mBigramSuggestionEnabled && shouldAutoCorrect) return Suggest.CORRECTION_FULL_BIGRAM; if (mBigramSuggestionEnabled && shouldAutoCorrect) return Suggest.CORRECTION_FULL_BIGRAM;
return shouldAutoCorrect ? Suggest.CORRECTION_FULL : Suggest.CORRECTION_NONE; return shouldAutoCorrect ? Suggest.CORRECTION_FULL : Suggest.CORRECTION_NONE;
} }