From 554346e94c852222a16b8ade732832158cbd34af Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Wed, 5 Mar 2014 15:33:43 +0900 Subject: [PATCH] [IL126] Move a setting value to SettingsValues Bug: 8636060 Change-Id: I7cb082df13a10cf5a3aa5786e6a9599376652dee --- java/src/com/android/inputmethod/latin/LatinIME.java | 5 +---- .../android/inputmethod/latin/settings/SettingsValues.java | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index df4ba7783..fc5c7f7ec 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -169,7 +169,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private int mDelayUpdateSuggestions; private int mDelayUpdateShiftState; - private long mDoubleSpacePeriodTimeout; private long mDoubleSpacePeriodTimerStart; public UIHandler(final LatinIME ownerInstance) { @@ -184,8 +183,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final Resources res = latinIme.getResources(); mDelayUpdateSuggestions = res.getInteger(R.integer.config_delay_update_suggestions); mDelayUpdateShiftState = res.getInteger(R.integer.config_delay_update_shift_state); - mDoubleSpacePeriodTimeout = - res.getInteger(R.integer.config_double_space_period_timeout); } @Override @@ -327,7 +324,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen public boolean isAcceptingDoubleSpacePeriod() { return SystemClock.uptimeMillis() - mDoubleSpacePeriodTimerStart - < mDoubleSpacePeriodTimeout; + < getOwnerInstance().mSettings.getCurrent().mDoubleSpacePeriodTimeout; } // Working variables for the following methods. diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java index 5a652a557..d47a61ed1 100644 --- a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java @@ -50,6 +50,7 @@ public final class SettingsValues { // From resources: public final SpacingAndPunctuations mSpacingAndPunctuations; public final int mDelayUpdateOldSuggestions; + public final long mDoubleSpacePeriodTimeout; // From preferences, in the same order as xml/prefs.xml: public final boolean mAutoCap; @@ -132,6 +133,7 @@ public final class SettingsValues { mBlockPotentiallyOffensive = Settings.readBlockPotentiallyOffensive(prefs, res); mAutoCorrectEnabled = Settings.readAutoCorrectEnabled(autoCorrectionThresholdRawValue, res); mBigramPredictionEnabled = readBigramPredictionEnabled(prefs, res); + mDoubleSpacePeriodTimeout = res.getInteger(R.integer.config_double_space_period_timeout); // Compute other readable settings mKeyLongpressTimeout = Settings.readKeyLongpressTimeout(prefs, res);